1
0
mirror of https://github.com/shimunn/aria2xspf.git synced 2023-11-17 09:27:54 +01:00

indicate last position

This commit is contained in:
shimunn 2019-04-26 16:26:46 +02:00
parent 312ce4a80b
commit 61dc6b7d8e

View File

@ -1,10 +1,23 @@
(function($, window) {
window.jumpVid = function (id, time) {
$("video").each(function(e) {
if(btoa(this.currentSrc) == id) {
this.currentTime = time;
this.play();
}
});
};
$(window).on('load', function() {
$("video").each(function(e) {
var src = this.currentSrc;
var id = btoa(src);
console.log(src);
var start = window.localStorage[btoa(src)];
var start = window.localStorage[id];
if (start) {
if(!$(this).prev().find(".resume").length){
$(this).prev().append(' <div class="resume"></div>');
}
$(this).prev().find(".resume").html('Resume <a href="javascript:jumpVid(\''+id+'\',' + start + ');">@'+Math.round(start / 60) +'min');
this.currentTime = parseFloat(start);
}
});