当前位置:网站首页>Google browser realizes video playback acceleration function
Google browser realizes video playback acceleration function
2020-11-06 21:45:00 【Architects who can drive】
chrome Browser console creation js Script and execute
Chrome Of snippets It's a little script , You can also create and create in Chrome DevTools In the source panel of the . You can access and run them from any page . When you run a clip , It is executed from the context of the currently open page . This article mainly talks about how to use , And complete a page auto refresh function .
First step
First f12 Open developer tools , And on again Sources The palette , Click on Snippets tab , Right click in navigator , And then choose New.
The second step
Enter the code in the editor . When you have unsaved changes , Next to your script name is “*”, Like the screenshot below . Press Command+S(Mac) or Ctrl+S(Windows and Linux), To save changes .
The third step is to run your code fragment
There are three ways :
1、 In the fragment file name ( All the clips are listed in the left pane ) Right click and select “RUN”.
2、 Click the run button ().
3、 Press Command+Enter(Mac) or Ctrl+Enter(Windows and Linux).
for example : Speed up the video playback function to achieve .
// Speed up the playback
document.getElementById(“tcPlayer_html5_api”).playbackRate = 3
// The space bar controls playback
document.onkeyup = function (event) {
var e = event || window.event || arguments.callee.caller.arguments[0];
var obj = document.getElementById(“tcPlayer_html5_api”);
if (e && e.keyCode == 32) {
obj.paused === true ? obj.play() : obj.pause();
return false;
} else if (e && e.keyCode == 37) {
obj.currentTime !== 0 ? obj.currentTime -= 20 : 1;
return false;
} else if (e && e.keyCode == 39) {
obj.currentTime !== obj.duration ? obj.currentTime += 20 : 1;
return false;
} else if (e && e.keyCode == 38) {
obj.volume <= 0.9 ? obj.volume += 0.1 : 1;
return false;
} else if (e && e.keyCode == 40) {
obj.volume >= 0.1 ? obj.volume -= 0.1 : 1;
return false;
}
};
版权声明
本文为[Architects who can drive]所创,转载请带上原文链接,感谢
边栏推荐
- Erd-online free online database modeling tool
- 非易失性MRAM存储器应用于各级高速缓存
- How does filecoin's economic model and future value support the price of fil currency breaking through thousands
- Introduction to Huawei cloud micro certification examination
- Event monitoring problem
- Unity performance optimization
- What kind of music do you need to make for a complete game?
- Common mathematical basic formulas of recursive and backtracking algorithms
- 递归、回溯算法常用数学基础公式
- 2020 database technology conference helps technology upgrade
猜你喜欢
Basic usage of Vue codemirror: search function, code folding function, get editor value and verify in time
【涂鸦物联网足迹】物联网基础介绍篇
A small goal in 2019 to become a blog expert of CSDN
Take you to learn the new methods in Es5
This project allows you to quickly learn about a programming language in a few minutes
es创建新的索引库并拷贝旧的索引库 实践亲测有效!
An article will introduce you to CSS3 background knowledge
Zero basis to build a web search engine of its own
The isolation level of transaction and its problems
What is the tensor in tensorflow?
随机推荐
JVM memory allocation - xms128m - xmx512m - XX: permsize = 128M - XX: maxpermsize = 512M
移动端像素适配方案
Nodejs中使用jsonwebtoken(JWT)生成token的场景使用
What are the highlights of Huawei mate 40 series with HMS?
【涂鸦物联网足迹】物联网基础介绍篇
2020-08-19:TCP是通过什么机制保障可靠性的?
Exclusive interview of guests at | 2020 PostgreSQL Asia Conference: Wang Tao
STM32F030K6T6兼容替换灵动MM32F031K6T6
An article will introduce you to HTML tables and their main attributes
Zero basis to build a web search engine of its own
【涂鸦物联网足迹】涂鸦云平台全景介绍
Method of code refactoring -- Analysis of method refactoring
Epu360: all the H5 templates you want are here, e-book, big turntable, red envelope rain, questionnaire survey
Js字符串-String字符串对象方法
DC-1 target
MRAM高速缓存的组成
Axios learning notes (2): easy to understand the use of XHR and how to package simple Axios
To solve the problem that the data interface is not updated after WPF binding set
消防器材RFID固定资产管理系统
How much disk space does a new empty file take?