Skip to content

Commit

Permalink
Fix bug in _isCueActive (#4456)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsilhavy committed Apr 29, 2024
1 parent 2285040 commit dcc3bd4
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/streaming/text/TextTracks.js
Expand Up @@ -421,11 +421,15 @@ function TextTracks(config) {
previousISDState = renderHTML(
cue.isd,
finalCue,
function (src) { return _resolveImageSrc(cue, src) },
function (src) {
return _resolveImageSrc(cue, src)
},
captionContainer.clientHeight,
captionContainer.clientWidth,
settings.get().streaming.text.imsc.displayForcedOnlyMode,
function (err) { logger.info('renderCaption :', err) /*TODO: add ErrorHandler management*/ },
function (err) {
logger.info('renderCaption :', err) /*TODO: add ErrorHandler management*/
},
previousISDState,
settings.get().streaming.text.imsc.enableRollUp
);
Expand Down Expand Up @@ -534,7 +538,8 @@ function TextTracks(config) {
* Only do this for imsc subs (where isd is present).
*/
if (prevCue.isd) {
prevCue.onexit = function () { };
prevCue.onexit = function () {
};
}
// If cues are added when the track is disabled they can still persist in memory
if (track.mode !== Constants.TEXT_DISABLED) {
Expand Down Expand Up @@ -941,7 +946,7 @@ function TextTracks(config) {
function _isCueActive(cue) {
const currentTime = videoModel.getTime();

return cue.startTime >= currentTime && cue.endTime <= currentTime
return currentTime >= cue.startTime && currentTime <= cue.endTime
}

function deleteCuesFromTrackIdx(trackIdx, start, end) {
Expand Down

0 comments on commit dcc3bd4

Please sign in to comment.