-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Conversation
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 (Please note that this is a fully automated comment.) |
@pam retry |
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 (Please note that this is a fully automated comment.) |
let textTracksChanges = function() { | ||
let updateDisplay = Fn.bind(this, function() { | ||
this.trigger('texttrackchange'); | ||
player.trigger('texttrackchange'); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 ;-)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Ugh, that isn't what I meant to do. |
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 (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.
b624a5c
to
eeff082
Compare
Alright, I think I have it. The main issue was that we were triggering the |
Good catch, probably my fault when I refactored. It looks better now :) |
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 (Please note that this is a fully automated comment.) |
The error I'm getting locally is a |
@heff thoughts? |
@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() { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Two minor notes, looks good to me. |
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 (Please note that this is a fully automated comment.) |
@pam retry |
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 (Please note that this is a fully automated comment.) |
Fix #2172