add autoPlayback

This commit is contained in:
Harvey Zack committed 2022-04-25 15:38:26 +08:00
1 parent 07edda2e22
commit 59d19b67c7
4 files changed
+53 -1

No files matched your search

+25
View File
@@ -4815,6 +4815,27 @@
};
}
function autoPlayback(art) {
var storage = art.storage;
art.on('video:timeupdate', function () {
var times = storage.get('times') || {};
times[art.option.url] = art.currentTime;
storage.set('times', times);
});
art.on('ready', function () {
var times = storage.get('times') || {};
var currentTime = times[art.option.url];
if (currentTime) {
art.seek = currentTime;
art.notice.show = '';
}
});
return {
name: 'autoPlayback'
};
}
var Plugins = /*#__PURE__*/function () {
function Plugins(art) {
_classCallCheck(this, Plugins);
@@ -4831,6 +4852,10 @@
this.add(lock);
}
if (option.autoPlayback) {
this.add(autoPlayback);
}
for (var index = 0; index < option.plugins.length; index++) {
this.add(option.plugins[index]);
}