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

Add unit tests and closed-caption autoselect to fix(subtitles) PR #270

Merged
merged 4 commits into from
Oct 25, 2018

Conversation

mrocajr
Copy link
Contributor

@mrocajr mrocajr commented Oct 24, 2018

No description provided.

- Added tests for autoselect for closed-caption and subtitles
@@ -568,7 +568,7 @@ export const initialize = {
const track = tech.addRemoteTextTrack({
id: properties.instreamId,
kind: 'captions',
enabled: false,
enabled: properties.default && properties.autoselect,
Copy link
Member

Choose a reason for hiding this comment

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

the property name should be default

Copy link
Contributor Author

Choose a reason for hiding this comment

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

properties.default as opposed to (properties.default && properties.autoselect)?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor

@gesinger gesinger left a comment

Choose a reason for hiding this comment

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

Might be worth adding a test where only one of default/autoselect are set.

@@ -726,6 +726,7 @@ function(assert) {
assert.ok(this.mediaTypes[type].groups.sub2[1].playlistLoader,
'playlistLoader created');
assert.ok(this.mediaTypes[type].tracks.en, 'created text track');
assert.equal(this.mediaTypes[type].tracks.en.default, true, 'en track auto selected');
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems to be testing that the default property is set, rather than it being auto selected.

Copy link
Member

Choose a reason for hiding this comment

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

I think that's fine? Actually selecting the caption by default is the job of Video.js, so, there's no need to test that behavior here (or override it). But we do need to make sure that the signal is passed to Video.js properly.

@forbesjo forbesjo merged commit ce2a784 into videojs:set-default-tracks Oct 25, 2018
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.

4 participants