当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- Open source a set of minimalist front and rear end separation project scaffold
- Introduction to the development of small game cloud
- 大数据处理黑科技:揭秘PB级数仓GaussDB(DWS) 并行计算技术
- The Interpreter pattern of behavior pattern
- Countdown | 2020 PostgreSQL Asia Conference - agenda arrangement of Chinese sub Forum
- DC-1 target
- Contract trading system development | construction of smart contract trading platform
- Junit测试出现 empty test suite
- What grammar is it? ]
- How to prepare for the system design interview
猜你喜欢
An article will introduce you to HTML tables and their main attributes
意外的元素..所需元素..
非易失性MRAM存储器应用于各级高速缓存
An article takes you to understand CSS3 picture border
vue3 新特性
[forward] how to view UserData in Lua
This project allows you to quickly learn about a programming language in a few minutes
Markdown tricks
Introduction to Huawei cloud micro certification examination
2020 database technology conference helps technology upgrade
随机推荐
2020-08-24:什么是小文件?很多小文件会有什么问题?很多小文件怎么解决?(大数据)
An article takes you to understand CSS pagination examples
How does filecoin's economic model and future value support the price of fil currency breaking through thousands
What is the tensor in tensorflow?
To Lianyun analysis: why is IPFs / filecoin mining so difficult?
Nodejs中使用jsonwebtoken(JWT)生成token的场景使用
大数据处理黑科技:揭秘PB级数仓GaussDB(DWS) 并行计算技术
Countdown | 2020 PostgreSQL Asia Conference - agenda arrangement of Chinese sub Forum
The memorandum model of behavior model
Pn8162 20W PD fast charging chip, PD fast charging charger scheme
打工人好物——磨炼钢铁意志就要这样高效的电脑
迅为iMX6开发板-设备树内核-menuconfig的使用
Those who have worked in China for six years and a million annual salary want to share these four points with you
谷歌浏览器实现视频播放加速功能
Call analysis of start method in JNI thread and callback analysis of run method
Detect certificate expiration script
小熊派开发板实践:智慧路灯沙箱实验之真实设备接入
With this artifact, quickly say goodbye to spam messages
2020-08-14:数据任务的执行引擎用的哪些?
Stickinengine architecture 12 communication protocol