mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-24 06:31:20 -08:00
修复字幕偏移不准问题
This commit is contained in:
1 parent
09e1d66676
commit
f81225b248
3 files changed
+16
-9
No files matched your search
@@ -33,7 +33,7 @@ export default class Subtitle {
|
||||
|
||||
if ($video.textTracks && $video.textTracks[0]) {
|
||||
const [track] = $video.textTracks;
|
||||
proxy(track, 'cuechange', () => {
|
||||
function updateSubtitle() {
|
||||
const [cue] = track.activeCues;
|
||||
$subtitle.innerHTML = '';
|
||||
if (cue) {
|
||||
@@ -45,7 +45,10 @@ export default class Subtitle {
|
||||
.join('');
|
||||
}
|
||||
this.art.emit('subtitle:update', $subtitle);
|
||||
});
|
||||
}
|
||||
|
||||
proxy(track, 'cuechange', updateSubtitle.bind(this));
|
||||
this.art.on('artplayerPluginSubtitle:set', updateSubtitle.bind(this));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user