mirror of
https://github.com/shimunn/aria2xspf.git
synced 2023-11-17 09:27:54 +01:00
23 lines
687 B
JavaScript
23 lines
687 B
JavaScript
(function($, window) {
|
|
$(window).on('load', function() {
|
|
$("video").each(function(e) {
|
|
var src = this.currentSrc;
|
|
console.log(src);
|
|
var start = window.localStorage[btoa(src)];
|
|
if (start) {
|
|
this.currentTime = parseFloat(start);
|
|
}
|
|
});
|
|
});
|
|
setInterval(function() {
|
|
$("video").each(function(e) {
|
|
var src = this.currentSrc;
|
|
var time = this.currentTime;
|
|
if (time) {
|
|
window.localStorage[btoa(src)] = time;
|
|
console.log("Persisted video progress at: " + time);
|
|
}
|
|
});
|
|
}, 5000);
|
|
}($, window));
|