From fa4835d75006374677c7d8185c76606f7054c512 Mon Sep 17 00:00:00 2001 From: yuusora Date: Fri, 13 May 2022 12:21:31 +0800 Subject: [PATCH] fix(subtitle): a cue's endTime qeual next cues's startTime,track.activeCues prob --- src/js/subtitle.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/subtitle.js b/src/js/subtitle.js index f747100..05ad7a1 100644 --- a/src/js/subtitle.js +++ b/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');