爾雅12倍速自動(dòng)播放下一集

var iframe=$("#iframe").contents().find("iframe").contents();
var video=iframe.find("#video_html5_api")[0];//找到video對(duì)象
video.onmouseout=function(){
? ? return true;
}
video.play();//播放
video.muted=true;//靜音
video.playbackRate=12;//倍速播放
window.setInterval(function(){
? ? if(video.ended){//視頻播放完
? ? ? ? alert("視頻已播完");
? ? }
? ? var ul=iframe.find(".ans-videoquiz-opts:visible");
? ? if(ul){//有題目出現(xiàn)
? ? ? ? iframe.find(".ans-videoquiz-opts input[value='true']").attr("checked",true);
? ? ? ? iframe.find(".ans-videoquiz-submit").trigger("submit");
? ? }
}, 3000);
、
function start() {
? ? var iframe=$("#iframe").contents().find("iframe").contents();
? ? console.log("歡迎進(jìn)入自動(dòng)掛課插件");
? ? var video=iframe.find("#video_html5_api")[0];//找到video對(duì)象
? ? if(video == undefined){
? ? ? ? console.log("沒有找到網(wǎng)頁播放器");
? ? }else{
? ? ? ? console.log("歡迎進(jìn)入自動(dòng)掛課插件");
? ? }
? ? video.play();//播放
? ? video.muted=true;//靜音
video.playbackRate=12;//倍速播放 此處12速率播放
? ? window.setInterval(function(){
? ? ? ? if(video.ended){//視頻播放完
var current=$("#selector .currents").parent().parent();
if(current==undefined){//適配二級(jí)目錄
current=$("#selector .currents").parent().parent().parent();
}
current.find("a")[0].click();
? ? ? ? window.setTimeout(function(){
? start();
},2000);??
? ? ? ? console.log("正在為你自動(dòng)播放下一個(gè)視頻");start();
? ? ? ? }
? ? ? ? var ul=iframe.find(".ans-videoquiz-opts:visible");
? ? ? ? if(ul){//有題目出現(xiàn)
? ? ? ? ? ? iframe.find(".ans-videoquiz-opts input[value='true']").attr("checked",true);
? ? ? ? ? ? iframe.find(".ans-videoquiz-submit").trigger("click");//ext-gen1045
? ? ? ? }
? ? }, 5000);
? ? $("div").mouseleave(function () {
? ? ? ? video.play();
? ? });
}
start();