mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-26 00:31:20 -08:00
forEach => for
This commit is contained in:
1 parent
99f5694100
commit
455e2189a7
18 files changed
+159
-103
No files matched your search
@@ -27,7 +27,9 @@ export default class Plugins {
|
||||
this.add(localSubtitle);
|
||||
}
|
||||
|
||||
art.option.plugins.forEach((plugin) => this.add(plugin));
|
||||
for (let index = 0; index < option.plugins.length; index++) {
|
||||
this.add(option.plugins[index]);
|
||||
}
|
||||
}
|
||||
|
||||
add(plugin) {
|
||||
|
||||
@@ -60,7 +60,9 @@ export default function subtitleOffset(art) {
|
||||
if (template.$track && template.$track.track) {
|
||||
const cues = Array.from(template.$track.track.cues);
|
||||
const time = clamp(value, -5, 5);
|
||||
cues.forEach((cue, index) => {
|
||||
|
||||
for (let index = 0; index < cues.length; index++) {
|
||||
const cue = cues[index];
|
||||
if (!cuesCache[index]) {
|
||||
cuesCache[index] = {
|
||||
startTime: cue.startTime,
|
||||
@@ -69,7 +71,8 @@ export default function subtitleOffset(art) {
|
||||
}
|
||||
cue.startTime = clamp(cuesCache[index].startTime + time, 0, art.duration);
|
||||
cue.endTime = clamp(cuesCache[index].endTime + time, 0, art.duration);
|
||||
});
|
||||
}
|
||||
|
||||
notice.show = `${i18n.get('Subtitle offset time')}: ${value}s`;
|
||||
art.emit('subtitleOffset', value);
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user