修复字幕偏移不准问题

This commit is contained in:
Harvey committed 2019-08-15 10:03:49 +08:00
1 parent 09e1d66676
commit f81225b248
3 files changed
+16 -9

No files matched your search

+5 -2
View File
@@ -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));
}
});
}