mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-20 04:01:20 -08:00
update autoPlayback
This commit is contained in:
1 parent
51bee25800
commit
71fad99a6a
3 files changed
+95
-91
No files matched your search
@@ -24,13 +24,15 @@ export default function autoPlayback(art) {
|
||||
const $close = query('.art-auto-playback-close', $autoPlayback);
|
||||
|
||||
art.on('video:timeupdate', () => {
|
||||
const times = storage.get('times') || {};
|
||||
const keys = Object.keys(times);
|
||||
if (keys.length > constructor.AUTO_PLAYBACK_MAX) {
|
||||
delete times[keys[0]];
|
||||
if (art.playing) {
|
||||
const times = storage.get('times') || {};
|
||||
const keys = Object.keys(times);
|
||||
if (keys.length > constructor.AUTO_PLAYBACK_MAX) {
|
||||
delete times[keys[0]];
|
||||
}
|
||||
times[art.option.id || art.option.url] = art.currentTime;
|
||||
storage.set('times', times);
|
||||
}
|
||||
times[art.option.id || art.option.url] = art.currentTime;
|
||||
storage.set('times', times);
|
||||
});
|
||||
|
||||
art.on('ready', () => {
|
||||
|
||||
Reference in new issue
Block a user