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 segmented text track selection #3643

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions src/streaming/text/TextController.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,16 +299,15 @@ function TextController(config) {
textTracks[streamId].deleteCuesFromTrackIdx(oldTrackIdx);
mediaController.setTrack(mediaInfo);
textSourceBuffers[streamId].setCurrentFragmentedTrackIdx(i);
} else if (oldTrackIdx === -1) {
//in fragmented use case, if the user selects the older track (the one selected before disabled text track)
//no CURRENT_TRACK_CHANGED event will be triggered because the mediaInfo in the StreamProcessor is equal to the one we are selecting
// For that reason we reactivate the StreamProcessor and the ScheduleController
eventBus.trigger(Events.SET_FRAGMENTED_TEXT_AFTER_DISABLED, {}, {
streamId,
mediaType: Constants.FRAGMENTED_TEXT
});
}
} else if (oldTrackIdx === -1) {
//in fragmented use case, if the user selects the older track (the one selected before disabled text track)
//no CURRENT_TRACK_CHANGED event will be triggered because the mediaInfo in the StreamProcessor is equal to the one we are selecting
// For that reason we reactivate the StreamProcessor and the ScheduleController
eventBus.trigger(Events.SET_FRAGMENTED_TEXT_AFTER_DISABLED, {}, {
streamId,
mediaType: Constants.FRAGMENTED_TEXT
});

}
}
}
Expand Down