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

Replaced Player component is not used by videojs init function #3016

Closed
Naouak opened this issue Jan 21, 2016 · 5 comments
Closed

Replaced Player component is not used by videojs init function #3016

Naouak opened this issue Jan 21, 2016 · 5 comments

Comments

@Naouak
Copy link
Contributor

Naouak commented Jan 21, 2016

Return of the function is using directly a reference to Player instead of using the registered component.

  // Element may have a player attr referring to an already created player instance.
  // If not, set up a new player and return the instance.
  return tag['player'] || new Player(tag, options, ready);
@gkatsev
Copy link
Member

gkatsev commented Jan 21, 2016

Hi can you elaborate on what you mean please?
We recently fixed a bug related to this: #3006
Does that fix your issue?

@Naouak
Copy link
Contributor Author

Naouak commented Jan 21, 2016

Basically, if you want to change a behavior directly in the player object using component, videojs(id) will still use base Player object instead of the new component.

I wanted to do that :

var Player = videojs.getComponent('Player');
videojs.registerComponent('Player', videojs.extend(Player,{
//...
}));

Then later:

videojs('my_video_player');

This is not related to #3006.

@gkatsev
Copy link
Member

gkatsev commented Jan 21, 2016

Oh, I see. I'm not sure I'd want to support something like that. It opens up videojs too much to custom code that will then be reported as issues with videojs but actually it's an issue with the custom player.
Though, to me, it seems like what you probably want to make is a Tech. Have you looked at that?

@Naouak
Copy link
Contributor Author

Naouak commented Jan 21, 2016

My aim was to use the same information between several components in the control bar. I spawn to elements and these two elements will interact with the same information. When the information is changed, player has to reload several stuff (thinks same video with multiple declination on resolutions and languages).

I'm overloading the player to change initial load of the video and also to change the source according to the new information and a config object given at player init. I'm not sure if this is clear.

@gkatsev
Copy link
Member

gkatsev commented Jul 25, 2016

Still not quite following.
There's the PR for tis #3458 and another issue #3335. But I'm still not sure of the usecase.

Closing this issue due to lack of activity. If it is still a problem and we get more information and a reduced test case, we will happily re-open the issue.

@gkatsev gkatsev closed this as completed Jul 25, 2016
gkatsev pushed a commit that referenced this issue Nov 23, 2016
This allows a user to register a new Player component with videojs to be used when videojs is called. If a player has been created already when trying to register a Player component, an error is thrown.
Fixes #3335 and #3016.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants