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

Store and use fragmentedText settings in localStorage #3293

Conversation

jeffcunat
Copy link
Contributor

fragmentedText initial settings were already stored in localStorage but never used.
This PR allows to reuse previous subtitles settings stored in localStorage.

They are only used when loading a stream if

  • settings streaming.lastMediaSettingsCachingInfo.enabled is true
  • textDefaultEnabled is not explicitly false (can be undefined if setTextDefaultEnabled is not called)
  • setInitialMediaSettingsFor('fragmentedText') has not been called to set preferred language and/or role

This means that, if no other settings are set, dash.js player will reuse previously used subtitles language/role when loading a new stream (like what is already done for audio content)

samples/captioning/multi-track-captions.html has been modified in order to test various settings combination (no more auto-load to be able to set settings before loading)

@dsilhavy dsilhavy added this to the 3.1.2 milestone Jun 16, 2020
@dsilhavy dsilhavy self-requested a review June 16, 2020 16:38
@@ -282,6 +302,9 @@ function TextController() {

let oldTrackIdx = textTracks.getCurrentTrackIdx();
if (oldTrackIdx !== idx) {
if (allTracksAreDisabled && mediaController) {
mediaController.saveTextSettingsDisabled();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use mediaController.setTrack here instead of saveTextSettingsDisabled?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would complexify mediaController.setTrack

@dsilhavy dsilhavy merged commit c67d3d3 into Dash-Industry-Forum:development Jul 15, 2020
@bbert bbert deleted the textSettingsInLocalStorage branch August 17, 2020 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants