You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text track setting saved to local storage and read by the MediaController during initialization are not taken into account by the TextController/TextTrack.
#4164
if (!textTracks[streamId]) {
return;
}
textTracks[streamId].createTracks();
// Fix start
// The Media Controller loads the initial text track saved in local storage,
// but the Text Track doesn't. Check to see if they're different and then
// try and set the correct text track index.
const textTrack = textTracks[streamId].getCurrentTrackInfo();
const mediaTrack = mediaController.getCurrentTrackFor(textTrack.type, streamId);
if (textTrack && mediaTrack && textTrack.index !== mediaTrack.index) {
setTextTrack(streamId, mediaTrack.index - textTrack.index);
}
// Fix end
The unit tests have the same results with and without this change.
The text was updated successfully, but these errors were encountered:
HugoSaintLaurent
changed the title
The text track setting are saved to local storage and read by the MediaController during initialization are taken into ccount by the TextController/TextTrack.
The text track setting saved to local storage and read by the MediaController during initialization are not taken into account by the TextController/TextTrack.
Mar 30, 2023
Environment
Link to playable MPD file:
https://storage.googleapis.com/shaka-demo-assets/sintel/dash.mpd
Dash.js version: 4.5.2
Browser name/version: Chrome Version 111.0.5563.147
OS name/version: Windows 10
Steps to reproduce
Play a stream with multiple text tracks like https://storage.googleapis.com/shaka-demo-assets/sintel/dash.mpd for example.
Change to a different text tracks, leaving the video, retune, and verify if the text track matches the setting in the options menu.
Observed behavior
The text track setting are saved to local storage (https://github.sie.sony.com/SIE-Private/dashjs/blob/master/src/streaming/controllers/MediaController.js#L210).
And they are read by the MediaController during initialization (https://github.sie.sony.com/SIE-Private/dashjs/blob/master/src/streaming/controllers/MediaController.js#L69).
However, the TextController/TextTrack does not take into account these setting, and instead sets the default text track as the current one (https://github.sie.sony.com/SIE-Private/dashjs/blob/master/src/streaming/text/TextTracks.js#L161).
Turning off the closed captions is not remembered either. I'm not sure if this is expected or not.
This issue appears to be related to #1866
Console output
Sorry, I don't have log at the moment.
Expected behavior
After changing different text tracks, leaving the video, retuning, the text trackshould matches the setting in the options menu.
Possible solution
The following fix resolves the issue, however there might be a better way to fix this.
Modify https://github.sie.sony.com/SIE-Private/dashjs/blob/master/src/streaming/text/TextController.js#L128 as follow:
function createTracks(streamInfo) {
const streamId = streamInfo.id;
The unit tests have the same results with and without this change.
The text was updated successfully, but these errors were encountered: