master
iotcat 4 years ago
parent d72ff063ab
commit 1da41f1ecf
  1. 15
      index.html

@ -45,11 +45,11 @@
}else{
cookie.set('last_watch', page.params.url);
}
var dp = {};
$.post("https://acg.watch/api/getQuality.php?url="+page.params.url, function(res){
options.video.quality = JSON.parse(res);
dp = new DPlayer(options);
const dp = new DPlayer(options);
/* recover history playing */
if(options.video.quality[0].url && options.video.quality[0].url != 'https://api.yimian.xyz/video?path=404.mp4'){
if(cookie.get($.md5(options.video.quality[0].url)) != null){
@ -57,8 +57,6 @@
dp.notice("已恢复到上次播放位置", 4000);
}
}
});
/* record seek point */
setInterval(function(){
if(!dp.video.paused && dp.video.currentTime > 10){
@ -74,9 +72,11 @@
setTimeout(function(){
cookie.set('last_watch', res.url);
history.pushState({},page.title,"https://acg.watch/player?url="+res.url);
page.params.url = res.url;
$.post("https://acg.watch/api/getQuality.php?url="+page.params.url, function(res){
dp.switchVideo(
{
url: res.url
quality: JSON.parse(res)
},
{
id: $.md5(res.url+'').substr(0, 16),
@ -88,9 +88,12 @@
unlimited: true,
}
);
}, 3000);
}
}, 2000);
});
});
});
</script>
</body>
</html>

Loading…
Cancel
Save