浏览代码

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

yuusora 3 年之前
父节点
当前提交
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');