mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-19 11:21:20 -08:00
update i18n
This commit is contained in:
1 parent
59d19b67c7
commit
b46dacd353
6 files changed
+22
-15
No files matched your search
@@ -1,8 +1,12 @@
|
||||
import { secondToTime } from '../utils';
|
||||
|
||||
export default function autoPlayback(art) {
|
||||
const { storage } = art;
|
||||
const { storage, i18n } = art;
|
||||
|
||||
art.on('video:timeupdate', () => {
|
||||
const times = storage.get('times') || {};
|
||||
const keys = Object.keys(times);
|
||||
if (keys.length > 10) delete times[keys[0]];
|
||||
times[art.option.url] = art.currentTime;
|
||||
storage.set('times', times);
|
||||
});
|
||||
@@ -12,7 +16,7 @@ export default function autoPlayback(art) {
|
||||
const currentTime = times[art.option.url];
|
||||
if (currentTime) {
|
||||
art.seek = currentTime;
|
||||
art.notice.show = '';
|
||||
art.notice.show = `${i18n.get('Auto playback at')} ${secondToTime(currentTime)}`;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -18,9 +18,7 @@ export default class Plugins {
|
||||
this.add(lock);
|
||||
}
|
||||
|
||||
if (option.autoPlayback) {
|
||||
this.add(autoPlayback);
|
||||
}
|
||||
this.add(autoPlayback);
|
||||
|
||||
for (let index = 0; index < option.plugins.length; index++) {
|
||||
this.add(option.plugins[index]);
|
||||
|
||||
Reference in new issue
Block a user