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

Unable to select text track with no ROLES ( v 2.3.0 ) #1212

Closed
kchandran1029 opened this issue Jan 3, 2018 · 1 comment
Closed

Unable to select text track with no ROLES ( v 2.3.0 ) #1212

kchandran1029 opened this issue Jan 3, 2018 · 1 comment
Assignees
Labels
status: archived Archived and locked; will not be updated type: enhancement New feature or request

Comments

@kchandran1029
Copy link

kchandran1029 commented Jan 3, 2018

No way to select a text track that has empty roles when there is another track for same language that has non-empty roles.

Version : 2.3.0

Input code

// this sets currentTextRole_ to empty.
shakaPlayer.selectTextLanguage(this.textTracks[trackId].language, '');
shakaPlayer.setTextTrackVisibility(true);

// Now refine the choice based on role preference.
if (preferredRole) { // Kiran : This won't be true for empty role preference
  var roleMatches = shaka.util.StreamUtils.filterTextStreamsByRole_(
      chosen, preferredRole);
  if (roleMatches.length) {
    return roleMatches;
  } else {
    shaka.log.warning('No exact match for the text role could be found.');
  }
}

Then ,

// Either there was no role preference, or it could not be satisfied.
// Choose an arbitrary role, if there are any, and filter out any other roles.
// This ensures we never adapt between roles.

var allRoles = chosen.map(function(stream) {
  return stream.roles;
}).reduce(shaka.util.Functional.collapseArrays, []);

// Kiran: This will return the stream that has non empty ROLE.

Expected behavior
should return the first track that matches the language as well as exact role, if role preference is empty , should return the track where roles.length === 0.

Current behavior
Always returns the non-empty role text track.

@theodab theodab added needs triage type: enhancement New feature or request and removed needs triage labels Jan 3, 2018
@theodab theodab self-assigned this Jan 4, 2018
joeyparrish pushed a commit that referenced this issue Jan 19, 2018
Beforehand, if there were some text streams with a given language
which had a role, and some which did not, the no-role text streams
would never be chosen.
Now, they are chosen if there is no preferred role.

Closes #1212

Change-Id: I28b426304b1a828f500012425b8d89c94ccc3178
@joeyparrish
Copy link
Member

Cherry-picked to v2.3.1.

@shaka-project shaka-project locked and limited conversation to collaborators Mar 22, 2018
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Apr 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants