当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- To teach you to easily understand the basic usage of Vue codemirror: mainly to achieve code editing, verification prompt, code formatting
- An article will take you to understand CSS alignment
- Summary of front-end interview questions (C, s, s) that front-end engineers need to understand (2)
- 轻量型 GPU 应用首选 京东智联云推出 NVIDIA vGPU 实例
- All the way, I was forced to talk about C code debugging skills and remote debugging
- This project allows you to quickly learn about a programming language in a few minutes
- Stickinengine architecture 11 message queue
- image operating system windows cannot be used on this platform
- 大数据处理黑科技:揭秘PB级数仓GaussDB(DWS) 并行计算技术
- Zero basis to build a web search engine of its own
猜你喜欢

ES6 learning notes (2): teach you to play with class inheritance and class objects

Introduction to the development of small game cloud
![[self taught unity2d legendary game development] map editor](/img/3b/00bc81122d330c9d59909994e61027.jpg)
[self taught unity2d legendary game development] map editor

Python basic variable type -- list analysis

An article will take you to understand CSS alignment

How much disk space does a new empty file take?

2020-08-14:数据任务的执行引擎用的哪些?

嘉宾专访|2020 PostgreSQL亚洲大会阿里云数据库专场:曾文旌

ES6 learning notes (4): easy to understand the new grammar of ES6

GitHub: the foundation of the front end
随机推荐
Visual rolling [contrast beauty]
ES6 learning notes (5): easy to understand ES6's built-in extension objects
Markdown tricks
Common mathematical basic formulas of recursive and backtracking algorithms
The isolation level of transaction and its problems
Application insights application insights use application maps to build request link views
An article taught you to download cool dog music using Python web crawler
2020-08-20:GO语言中的协程与Python中的协程的区别?
How to play sortable JS vuedraggable to realize nested drag function of forms
The native API of the future trend of the front end: web components
预留电池接口,内置充放电电路及电量计,迅为助力轻松搞定手持应用
How to make characters move
消防器材RFID固定资产管理系统
统计项目代码行数
Using iceberg on kubernetes to create a new generation of cloud original data Lake
The Interpreter pattern of behavior pattern
Git rebase is in trouble. What to do? Waiting line
Elasticsearch database | elasticsearch-7.5.0 application construction
Small program introduction to proficient (2): understand the four important files of small program development
To solve the problem that the data interface is not updated after WPF binding set