-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
Techs can change the player poster only once #4910
Comments
Interesting. That's definitely an unintended side-effect of the code. The idea was that if the user sets a poster the tech shouldn't override it but the way that the code accepts a poster from the tech means that it only gets set once. It totally makes sense for the techs to be able to change their poster as much as possible assuming we don't change the behavior that a user-set poster isn't overridden. Would you be able to and interested in submitting a fix? |
Yeah, sure. I wouldn't mind. There'd be a few things to clear up first, since I see a few possibilities here: Introduce techs that have the power to override any poster Could add a static field to the tech that is checked in the posterchange handler e.g if( (!this.poster_ || this.tech_.canOverridePoster) && this.tech_.poster ){
this.poster_ = this.tech_.poster();
this.trigger('posterchange');
} Introduce boolean option in player to allow techs to override the poster if( (!this.poster_ || this.options_.techCanOverridePoster) && this.tech_.poster ){
this.poster_ = this.tech_.poster();
this.trigger('posterchange');
} Track when poster has been set by This could be done with a boolean in the All of these might still require to track when the poster was set by the tech, in order to clear the poster when the tech is disposed of. That's what comes to mind. Thoughts? |
I'd be inclined to leave out techs that can override the poster for now, at least until we see people asking for that. Unless you're asking for it? :) |
The option |
Description
New techs are unable to integrate into the poster lifecycle and can switch a poster only once which triggers a
posterchange
event.Example
The region of code that seems to be responsible is handleTechPosterChange_
Steps to reproduce
Explain in detail the exact steps necessary to reproduce the issue.
posterchange
event and changes the posterposter
method on the new techposterchange
eventResults
Expected
A new poster
Actual
The same old poster.
Error output
None
Additional Information
Please include any additional information necessary here. Including the following:
versions
videojs
5 + 6, most likely older versions as well
browsers
firefox, chrome,
OSes
tested on Kubuntu 16.04
plugins
None
The text was updated successfully, but these errors were encountered: