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(tracks): don't select tracks based on user pref if no langauge is set #5556

Merged
merged 3 commits into from
Nov 6, 2018

Conversation

gkatsev
Copy link
Member

@gkatsev gkatsev commented Nov 6, 2018

Fixes #5553

if (
userPref && userPref.enabled &&
userPref.language && userPref.language === track.language &&
track.kind in modes
Copy link
Contributor

Choose a reason for hiding this comment

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

💯

test/unit/tracks/text-track-display.test.js Outdated Show resolved Hide resolved
test/unit/tracks/text-track-display.test.js Show resolved Hide resolved
test/unit/tracks/text-track-display.test.js Show resolved Hide resolved

assert.equal(spanishTrack.mode, 'disabled', 'Spanish captions should be disabled');
assert.equal(englishTrack.mode, 'disabled', 'English captions should be disabled');
assert.notEqual(metadataTrack.mode, 'showing', 'Metadata track should not be showing');
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason you're opting for notEqual'ing showing instead of equal'ing hidden? Like Safari's native HLS support or something?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I figured it'll be safer to just make sure it isn't showing since it doesn't really matter what this is set to for this test

Copy link
Contributor

@ldayananda ldayananda left a comment

Choose a reason for hiding this comment

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

LGTM, and tested briefly

@gkatsev gkatsev merged commit c1cbce3 into master Nov 6, 2018
@gkatsev gkatsev deleted the segment-metadata branch November 6, 2018 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants