Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug in _isCueActive #4456

Merged
merged 2 commits into from Apr 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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