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

Added option to disable native tracks #3786

Merged
merged 2 commits into from
Nov 23, 2016

Conversation

forbesjo
Copy link
Contributor

@forbesjo forbesjo commented Nov 16, 2016

Description

This PR provides a tech level option to disable native audio and video tracks.

Specific Changes proposed

This adds nativeAudioTracks and nativeVideoTracks tech options, this will disable hooking into the native track APIs. This would be useful when using videojs-contrib-hls on Edge.

Usage:

videojs(video, {
  html5: {
    nativeAudioTracks: false
  }
});

Requirements Checklist

  • Feature implemented / Bug fixed
  • If necessary, more likely in a feature request than a bug fix
    • Change has been verified in an actual browser (Chome, Firefox, IE)
    • Unit Tests updated or fixed
    • Docs/guides updated
    • Example created (starter template on JSBin)
  • Reviewed by Two Core Contributors

Copy link
Member

@gkatsev gkatsev left a comment

Choose a reason for hiding this comment

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

Can we add a test?

@gkatsev
Copy link
Member

gkatsev commented Nov 16, 2016

Also, just realized that https://github.com/videojs/video.js/blob/master/src/js/tech/html5.js#L83-L125 would need to be tweaked a bit to use this as well.
As is, this PR just adds a way to disable the feature switch.

@forbesjo
Copy link
Contributor Author

Why would that block need to be tweaked?

@gkatsev
Copy link
Member

gkatsev commented Nov 16, 2016

For the native audio tracks, we want to not add the native tracks to our audio tracks list, right? That block still ads native tracks to their respective lists, even if native versions are disabled.

@forbesjo
Copy link
Contributor Author

forbesjo commented Nov 16, 2016

My change exposes an option to set this https://github.com/videojs/video.js/blob/master/src/js/tech/html5.js#L89 which will cause it to return early and not hook into the native tracks API.

@gkatsev
Copy link
Member

gkatsev commented Nov 16, 2016

D'oh. Totally missed that when scanning that section. Carry on.

@gkatsev gkatsev merged commit 9b9f89e into videojs:master Nov 23, 2016
@forbesjo forbesjo deleted the disable-native-tracks branch November 23, 2016 19:12
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.

2 participants