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

Integrate video & audio tracks with video.js #3173

Closed
wants to merge 33 commits into from
Closed

Integrate video & audio tracks with video.js #3173

wants to merge 33 commits into from

Conversation

brandonocasey
Copy link
Contributor

@brandonocasey brandonocasey commented Mar 11, 2016

Description

Implement VideoTrack, AudioTrack, VideoTrackList, and AudioTrackList using common functionality from TextTrack and TextTrackList. Which is now shared in a base classes called Track and TrackList

Specific Changes proposed

  • Implement Audio/Video Track & Track List
  • Move Common functionality into Track and TrackList classes so it can be shared
  • Add unit tests for individual everything
  • Add unit tests for full integration pieces

Requirements Checklist

  • Feature implemented / Bug fixed
  • Reviewed by Two Core Contributors

videoTracks() {
// cannot use techGet_ directly because it checks to see whether the tech is ready.
// Flash is unlikely to be ready in time but videoTracks should still work.
return this.tech_ && this.tech_['videoTracks']();
Copy link
Member

Choose a reason for hiding this comment

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

This will return undefined when the tech is not ready. The spec says it should return an empty VideoTrackList in that case which seems nice if it's easy to pull off.

@gkatsev
Copy link
Member

gkatsev commented Mar 14, 2016

@benjipott would be great to get your input on this PR!

@@ -70,6 +72,13 @@ class Html5 extends Tech {
}
}

if (this.featuresNativeVideoTracks) {
this.handleVideoTrackChange_ = Fn.bind(this, this.handleVideoTrackChange);
Copy link
Member

Choose a reason for hiding this comment

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

Why these aliases?

Copy link
Member

Choose a reason for hiding this comment

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

This is inline with how the native text tracks are done. The reason for them is that in one vendor, the functions weren't being properly bound if we were using this.handle<Thing>Track<Action> directly. Binding them here and then using the bound version in the listener fixes it.

Copy link
Member

Choose a reason for hiding this comment

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

I'm still confused :) Why weren't they bound properly? By "vendor", do you mean the HTML tech or Flash tech for example?

Copy link
Member

Choose a reason for hiding this comment

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

Vendor like safari, unfortunately, I don't remember the exact details. Was merged as part of #2425.

Copy link
Member

Choose a reason for hiding this comment

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

I don't like the fact we don't remember why we have to do this weird dance here. @brandonocasey would you mind giving this a shot without the binding thing in Safari?

Copy link
Member

Choose a reason for hiding this comment

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

I would be wary to change how it works for the text tracks themselves but OK with not doing it for the new video and audio track support.

@dmlap
Copy link
Member

dmlap commented Apr 20, 2016

LGTM

@dmlap dmlap added needs: LGTM Needs one or more additional approvals and removed needs: updates labels Apr 20, 2016
@misteroneill
Copy link
Member

LGTM

@misteroneill misteroneill removed in progress needs: LGTM Needs one or more additional approvals labels Apr 22, 2016
@gkatsev
Copy link
Member

gkatsev commented Apr 22, 2016

And tests passed in browserstack: https://travis-ci.org/videojs/video.js/builds/125066414

@brandonocasey brandonocasey deleted the integrate-video-audio-track branch April 27, 2016 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed enhancement minor This PR can be added to a minor release. It should not be added to a patch release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants