mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-27 09:41:20 -08:00
修复切换字幕bug
This commit is contained in:
1 parent
525bb269d9
commit
7de1939472
1 file changed
+11
-2
@@ -41,16 +41,25 @@ function settingMix(art) {
|
|||||||
$value.innerText = value;
|
$value.innerText = value;
|
||||||
art.plugins.artplayerPluginSubtitle.set(Number(value));
|
art.plugins.artplayerPluginSubtitle.set(Number(value));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
art.on('subtitle:switch', () => {
|
||||||
|
$range.value = 0;
|
||||||
|
$value.innerText = 0;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function artplayerPluginSubtitle(art) {
|
function artplayerPluginSubtitle(art) {
|
||||||
|
const { clamp } = art.constructor.utils;
|
||||||
const { setting, notice, refs, i18n } = art;
|
const { setting, notice, refs, i18n } = art;
|
||||||
const cuesCache = [];
|
let cuesCache = [];
|
||||||
i18nMix(i18n);
|
i18nMix(i18n);
|
||||||
setting.add(settingMix);
|
setting.add(settingMix);
|
||||||
const { clamp } = art.constructor.utils;
|
art.on('subtitle:switch', () => {
|
||||||
|
cuesCache = [];
|
||||||
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
set(value) {
|
set(value) {
|
||||||
const cues = Array.from(refs.$track.track.cues);
|
const cues = Array.from(refs.$track.track.cues);
|
||||||
|
|||||||
Reference in new issue
Block a user