mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-20 12:11:20 -08:00
优化字幕插件
This commit is contained in:
1 parent
450e4ac879
commit
946a2da8a9
11 files changed
+51
-2120
No files matched your search
@@ -59,7 +59,7 @@ function settingMix(art) {
|
||||
|
||||
function artplayerPluginSubtitle(art) {
|
||||
const { clamp } = art.constructor.utils;
|
||||
const { setting, notice, refs, i18n } = art;
|
||||
const { setting, notice, template, i18n } = art;
|
||||
i18nMix(i18n);
|
||||
setting.add(settingMix);
|
||||
|
||||
@@ -70,7 +70,7 @@ function artplayerPluginSubtitle(art) {
|
||||
|
||||
return {
|
||||
set(value) {
|
||||
const cues = Array.from(refs.$track.track.cues);
|
||||
const cues = Array.from(template.$track.track.cues);
|
||||
const time = clamp(value, -5, 5);
|
||||
cues.forEach((cue, index) => {
|
||||
if (!cuesCache[index]) {
|
||||
|
||||
@@ -80,7 +80,7 @@ export default class Template {
|
||||
if (removeHtml) {
|
||||
this.$container.innerHTML = '';
|
||||
} else {
|
||||
this.refs.$player.classList.add('artplayer-destroy');
|
||||
this.$player.classList.add('artplayer-destroy');
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user