chrome YouTube 视频播放扩展程序
chrome extension for YouTube video playback
我为 YouTube 编写了一个扩展程序,其中包括在打开页面时暂停 YouTube 的视频播放。问题是视频暂停,但视频工具栏没有更新,所以它显示暂停按钮而不是播放按钮。
这是我的代码:
html5Videos = document.querySelectorAll("video");
for (var v = 0; v < html5Videos.length; v++)
html5Videos[v].pause();
我找不到更新视频工具栏的方法。
This is how it looks, I need to hit play but the pause button is shown.
谢谢。
找到 pause
按钮元素并 click
它:
document.querySelector('.ytp-play-button').click();
我为 YouTube 编写了一个扩展程序,其中包括在打开页面时暂停 YouTube 的视频播放。问题是视频暂停,但视频工具栏没有更新,所以它显示暂停按钮而不是播放按钮。
这是我的代码:
html5Videos = document.querySelectorAll("video");
for (var v = 0; v < html5Videos.length; v++)
html5Videos[v].pause();
我找不到更新视频工具栏的方法。
This is how it looks, I need to hit play but the pause button is shown.
谢谢。
找到 pause
按钮元素并 click
它:
document.querySelector('.ytp-play-button').click();