mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-26 17:01: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
@@ -0,0 +1,22 @@
|
||||
export default function autoPlayback(art) {
|
||||
const { storage } = art;
|
||||
|
||||
art.on('video:timeupdate', () => {
|
||||
const times = storage.get('times') || {};
|
||||
times[art.option.url] = art.currentTime;
|
||||
storage.set('times', times);
|
||||
});
|
||||
|
||||
art.on('ready', () => {
|
||||
const times = storage.get('times') || {};
|
||||
const currentTime = times[art.option.url];
|
||||
if (currentTime) {
|
||||
art.seek = currentTime;
|
||||
art.notice.show = '';
|
||||
}
|
||||
});
|
||||
|
||||
return {
|
||||
name: 'autoPlayback',
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user