From c1da26cbe0e9e57dd8c9088e13d3723a745c9d65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20G=C3=B3mez=20Llorente?= Date: Wed, 10 Feb 2021 21:02:58 +0100 Subject: [PATCH] fix: Fix subtitle display in timing edge case (#3152) We've seen some SmartTVs show one subtitle without removing the previous one. I think this is happening because two different subtitles may meet the condition of "greater or equal than" and "lower or equal than" at the same time. After changing the greater than or equal with a greater than subtitles were fixed. @joeyparrish will add a regression test after this fix. Closes #3151 --- lib/text/ui_text_displayer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/text/ui_text_displayer.js b/lib/text/ui_text_displayer.js index e00fc5d27e..c16962bd2e 100644 --- a/lib/text/ui_text_displayer.js +++ b/lib/text/ui_text_displayer.js @@ -162,7 +162,7 @@ shaka.text.UITextDisplayer = class { // Return true if the cue should be displayed at the current time point. const shouldCueBeDisplayed = (cue) => { return this.cues_.includes(cue) && this.isTextVisible_ && - cue.startTime <= currentTime && cue.endTime >= currentTime; + cue.startTime <= currentTime && cue.endTime > currentTime; }; // For each cue in the current cues map, if the cue's end time has passed,