forked from QUST-Coder/AutoRunForZHS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainCode
40 lines (38 loc) · 1.56 KB
/
MainCode
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
var fa=$("body");
var btn=$("<li></li>");
var json={
"background":"#31e16d",
"height":"16px",
"padding":"5px",
"cursor": "pointer",
"top":"300px",
"right":"80px",
"position": "fixed"
};
btn.css(json);
btn.html("<span id='lfsenior'>开启自动播放模式</span>");
fa.append(btn);
var bodywidth=$("#body").css("width");
var mainwidth=$("#main").css("width");
btn.click(function () {
$("#lfsenior").html("自动模式已开启");
//关闭弹题
setInterval(function(){
//开启倍速播放
document.getElementsByClassName("speedTab15")[0].click();
$(".popboxes_close").click();
//获取当前进度
var spans=$(".current_play span");
var progress=spans[spans.size()-1].innerHTML;
if("100"==progress.substring(progress.lastIndexOf("『")+1,progress.lastIndexOf("』")-1)){
//播放完毕
$(".next_lesson a").click();
}else{
$("#vjs_mediaplayer_html5_api")[0].play();
$("#vjs_mediaplayer_html5_api")[0].muted=true;
}
$("#lfsenior").html("自动模式已开启,本章进度:"+progress+"%");
},100);
});
//开启自动模式
document.getElementById("lfsenior").click();