@
操作
-
按住F12,找到對應的位置
-
在出現彈題測驗界面重新刷新一下
-
設置一個定時器3s 定位到靜音圖標和1.5倍數列表
`javascipt
setTimeout(function () { $('.speedTab15').click(); //1.5 倍數播放點擊
$('.volumeIcon').click(); // 音量圖標點擊為靜音,如果再次點擊為播放聲音
}, 3000); //設置時間3s
`
`javascript
if ($(".current_play div b:nth-child(2)").hasClass('time_icofinish') || $(".current_play div b:nth-child(3)").hasClass('time_icofinish'))
`
- setInterval() 方法會不停地調用函數,直到 clearInterval() 被調用或窗口被關閉。
通過不斷調用函數檢查測試彈出和釋放播放結束;
`javascript
setInterval(function () {
if ($('.el-dialog__header>div>h4').text() == "彈題測驗") {
window.setTimeout(function () {
$(".topic-list :first-child").click(); // 循環點擊每個選項進行點擊
$(".el-icon-close").click(); // 點擊關閉圖標
$(".videoArea").click(); // 點擊視頻中央再次播放
}, 3000);
}
if ($(".current_play div b:nth-child(2)").hasClass('time_icofinish') || $(".current_play div b:nth-child(3)").hasClass('time_icofinish')) {
console.log("當前視頻播放結束,跳到下一節");
$('.nextButton').click() // 點擊下一個
$(".videoArea").click(); // 在次點擊屏幕中央就可以播放
setTimeout(function () {
$('.volumeIcon').click(); // 重新設定靜音
$('.speedTab15').click(); // 重新設定倍數
}, 6000);
}
}, 3000)
`
代碼
- 最終代碼直接復制到Console 再按住回車就可以了
`
setTimeout(function () { $('.speedTab15').click();
$('.volumeIcon').click();
}, 3000);
setInterval(function () {
if ($('.el-dialog__header>div>h4').text() == "彈題測驗") {
window.setTimeout(function () {
$(".topic-list :first-child").click();
$(".el-icon-close").click();
$(".videoArea").click();
}, 3000);
}
if ($(".current_play div b:nth-child(2)").hasClass('time_icofinish') || $(".current_play div b:nth-child(3)").hasClass('time_icofinish')) {
console.log("當前視頻播放結束,跳到下一節");
$('.nextButton').click()
$(".videoArea").click();
setTimeout(function () {
$('.volumeIcon').click();
$('.speedTab15').click();
}, 6000);
}
}, 3000)
`