mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-19 03:11:20 -08:00
separate variable constants
This commit is contained in:
1 parent
57a14f63ac
commit
fc3abd7d1d
20 files changed
+143
-80
No files matched your search
@@ -4,13 +4,14 @@ export default function autoPlayback(art) {
|
||||
const {
|
||||
i18n,
|
||||
storage,
|
||||
constructor,
|
||||
template: { $poster },
|
||||
} = art;
|
||||
|
||||
art.on('video:timeupdate', () => {
|
||||
const times = storage.get('times') || {};
|
||||
const keys = Object.keys(times);
|
||||
if (keys.length > 10) delete times[keys[0]];
|
||||
if (keys.length > constructor.AUTO_PLAYBACK_MAX) delete times[keys[0]];
|
||||
times[art.option.url] = art.currentTime;
|
||||
storage.set('times', times);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user