Просмотр исходного кода

fix(subtitle): a cue's endTime qeual next cues's startTime,track.activeCues prob

yuusora 3 лет назад
Родитель
Сommit
fa4835d750
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      src/js/subtitle.js

+ 1 - 1
src/js/subtitle.js

@@ -17,7 +17,7 @@ class Subtitle {
             const track = this.video.textTracks[0];
 
             track.oncuechange = () => {
-                const cue = track.activeCues[0];
+                const cue = track.activeCues[track.activeCues.length - 1];
                 this.container.innerHTML = '';
                 if (cue) {
                     const template = document.createElement('div');