Skip to content

Commit

Permalink
fix: Fix subtitle display in timing edge case (#3152)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
adgllorente authored and joeyparrish committed Feb 22, 2021
1 parent 5568719 commit c1da26c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/text/ui_text_displayer.js
Expand Up @@ -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,
Expand Down

0 comments on commit c1da26c

Please sign in to comment.