mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-22 21:31:20 -08:00
add autoPlayback
This commit is contained in:
1 parent
07edda2e22
commit
59d19b67c7
4 files changed
+53
-1
No files matched your search
@@ -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]);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user