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

Store tracks on player #1874

Closed
wants to merge 2 commits into from
Closed

Conversation

gkatsev
Copy link
Member

@gkatsev gkatsev commented Feb 17, 2015

Previously, we were storing the text tracks on the techs. However, if you switched techs, and you were emulating captions, you would end up getting new text tracks. This meant that UI elements which registered against the initial tech's text tracks would no longer get any events.

@@ -345,13 +345,13 @@ vjs.MediaTechController.prototype.emulateTextTracks = function() {
vjs.MediaTechController.prototype.textTracks_;

vjs.MediaTechController.prototype.textTracks = function() {
this.textTracks_ = this.textTracks_ || new vjs.TextTrackList();
return this.textTracks_;
this.player_.textTracks_ = this.player_.textTracks_ || new vjs.TextTrackList();
Copy link
Member

Choose a reason for hiding this comment

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

Should this logic be bumped into player.js?

@heff
Copy link
Member

heff commented Feb 18, 2015

The test turns off the native text tracks, which are the default for HTML5 video. What happens if you don't do that and switch to/from Flash?

@gkatsev
Copy link
Member Author

gkatsev commented Feb 18, 2015

Yeah, I discussed this with @dmlap last night.
We definitely don't want to bump the texttracks methods out to the player because at least in native text tracks in html5, we don't want a direct reference to the tech element in the player.
However, this current fix would only cover emulated text tracks for html5 switching to another tech that also uses emulated text tracks. If you're switching between one tech that is using native tracks and then switching to another tech with non-native techs, you would lose the tracks.
One thing that's possible to do is to copy over the previous tracks over in that case but I'm not sure it's a good idea. It would depend on how frequent we think someone will be switching techs while playing the same video.

Perhaps in addition to this, we also want to have things like the caption buttons listen to loadstart and if the tracks changed, re-attach their listeners?

@gkatsev
Copy link
Member Author

gkatsev commented Feb 18, 2015

However, regardless of the extra corner cases, I think this particular PR is good to go, as it does fix an issue. There's just possibly more things needed to fix.

@gkatsev
Copy link
Member Author

gkatsev commented Feb 18, 2015

I'll open up a separate issue to discusse the native<->non-native tracks.

@heff
Copy link
Member

heff commented Feb 19, 2015

lgtm

@videojs/core-committers now that we're locked down for 5.0 make sure any fixes meant for patches are opened against the stable branch, because the master branch is about to get very different. The contrib patch start and contrib patch submit commands can make that process easier.

(@gkatsev I'll handle moving the open PRs)

@gkatsev
Copy link
Member Author

gkatsev commented Feb 19, 2015

Thanks. I'll try and remember that for future patches :)

@gkatsev gkatsev closed this in 8b0966c Feb 20, 2015
@gkatsev gkatsev deleted the store-tracks-on-player branch August 12, 2015 18:48
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

3 participants