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

Update display, instead of toggling it #2215

Closed
wants to merge 4 commits into from

Conversation

gkatsev
Copy link
Member

@gkatsev gkatsev commented May 29, 2015

Fix #2172

@pam
Copy link

pam commented May 29, 2015

Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: bd427ac
Build details: https://travis-ci.org/pam/video.js/builds/64636040

(Please note that this is a fully automated comment.)

@gkatsev
Copy link
Member Author

gkatsev commented May 29, 2015

@pam retry

@pam
Copy link

pam commented May 29, 2015

Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: bd427ac
Build details: https://travis-ci.org/pam/video.js/builds/64638271

(Please note that this is a fully automated comment.)

let textTracksChanges = function() {
let updateDisplay = Fn.bind(this, function() {
this.trigger('texttrackchange');
player.trigger('texttrackchange');
Copy link
Member

Choose a reason for hiding this comment

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

Are you sure this is needed? There's no player anymore in techs, so we need to find another option. The player does listen for texttrackchange events on the tech. I think this is still actually triggering the event on the tech, because the component init is setting the tech as player.

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure. I guess this isn't quite ready. I only looked quickly at this and this was a quick fix for the issue. It worked locally.
Ill take another look later.

Copy link
Member

Choose a reason for hiding this comment

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

I was trying to track this down, but got confused between texttrackchange and cuechange events.

The Captions Settings control explicitly calls an updateDisplay on the textTrackDisplay when a setting is changed. When a cue changes because of the video moving along the timeline, the track fires a cuechange event which causes the tech to fire a texttrackchange event, which seems to just cause the player to fire a texttrackchange event. Nothing fires an updateDisplay on the textTrackDisplay.

EDIT: Okay, the problem is in the migration of textTracksChanges in media/media.js of stable to the one in tech/tech.js of master.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, your EDIT is what when the issue occurs.
Also, I see now what is trying to happen. I went down the rabbithole of only listening to the text tracks events in the display, but that doesn't work anymore because techs own the text tracks now. I might keep the listener in there and then have the tech tell the display to update its listeners.

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good. The event architecture is getting a little opaque; I'll leave it to you core developers, but it'd be nice to have some docs on it at some point in the future ;-)

Copy link
Member

Choose a reason for hiding this comment

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

I might keep the listener in there and then have the tech tell the display to update its listeners.

If there's a way we can do that through an event instead of a direct connection between the tech and the display, that'd be ideal.

Copy link
Contributor

Choose a reason for hiding this comment

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

The event texttrackchange is triggered by the tech. Then, the player re-trigger it on himself if it is the active tech. I'm not sure what the problem is. Is it happening before the tech is loading?

Copy link
Member Author

Choose a reason for hiding this comment

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

The main issue was that the display's listener was calling the wrong method. Though, when I changed that, it seemed to not work still.
Also, I'm actually not a fan of the texttrackchange event since it isn't in the spec. Though, perhaps there isn't a better way of doing it.

I might keep the listener in there and then have the tech tell the display to update its listeners.

If there's a way we can do that through an event instead of a direct connection between the tech and the display, that'd be ideal.

If there was an event for tech switching, the display could listen to it :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, I think the issue is that the updateDisplay function in the tech triggers the texttrackchange event on the wrong object.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think I have it.

@gkatsev
Copy link
Member Author

gkatsev commented Jun 1, 2015

Ugh, that isn't what I meant to do.

@pam
Copy link

pam commented Jun 1, 2015

Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: b624a5c
Build details: https://travis-ci.org/pam/video.js/builds/64957812

(Please note that this is a fully automated comment.)

The actual issue was that we were triggering the events on the incorrect
objects. This commit makes sure that `this` is getting set correctly on
the correct things.
@gkatsev
Copy link
Member Author

gkatsev commented Jun 1, 2015

Alright, I think I have it. The main issue was that we were triggering the texttrackchange event on the text tracks object instead of on the tech. I've fixed up the references to this.

@eXon
Copy link
Contributor

eXon commented Jun 1, 2015

Good catch, probably my fault when I refactored. It looks better now :)

@pam
Copy link

pam commented Jun 1, 2015

Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: eeff082
Build details: https://travis-ci.org/pam/video.js/builds/64958864

(Please note that this is a fully automated comment.)

@gkatsev
Copy link
Member Author

gkatsev commented Jun 1, 2015

The error I'm getting locally is a vjs_getProperty error which seems separate from anything I did. Maybe related to #2205?

@gkatsev
Copy link
Member Author

gkatsev commented Jun 1, 2015

@heff thoughts?

@dmlap
Copy link
Member

dmlap commented Jun 1, 2015

@gkatsev I think you're seeing the same error I was getting in #2208

@gkatsev
Copy link
Member Author

gkatsev commented Jun 1, 2015

@dmlap yep, looks like the same issue.

@@ -234,10 +232,10 @@ class Tech extends Component {
}
};

tracks.addEventListener('change', textTracksChanges);
tracks.addEventListener('change', Fn.bind(this, textTracksChanges));

this.on('dispose', Fn.bind(this, function() {
Copy link
Member

Choose a reason for hiding this comment

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

this.on already does a Fn.bind(this internally, so this one is redundant.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@heff
Copy link
Member

heff commented Jul 8, 2015

Two minor notes, looks good to me.

@pam
Copy link

pam commented Jul 8, 2015

Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: 61e820b
Build details: https://travis-ci.org/pam/video.js/builds/70134333

(Please note that this is a fully automated comment.)

@gkatsev
Copy link
Member Author

gkatsev commented Jul 8, 2015

@pam retry

@pam
Copy link

pam commented Jul 8, 2015

Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: 61e820b
Build details: https://travis-ci.org/pam/video.js/builds/70135836

(Please note that this is a fully automated comment.)

@gkatsev gkatsev deleted the fix-emulated-captions branch August 12, 2015 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

video.js captions (not native browser captions) are broken in V5
6 participants