add seek point

master
iotcat 4 years ago
parent 9a20769028
commit 21786b5447
  1. 12
      index.html

@ -39,6 +39,18 @@
options.video.url = page.params.url;
}
const dp = new DPlayer(options);
/* recover history playing */
if(options.video.url && options.video.url != 'https://api.yimian.xyz/video?path=404.mp4'){
if(cookie.get($.md5(options.video.url)) != null){
dp.seek(cookie.get($.md5(options.video.url)));
}
}
/* record seek point */
setInterval(function(){
if(!dp.video.paused && dp.video.currentTime > 10){
cookie.set($.md5(options.video.url), dp.video.currentTime);
}
}, 1000);
</script>
</body>
</html>
Loading…
Cancel
Save