-
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
Consider Exporting videojs.MenuButton #647
Comments
No, that was an oversight. If you make a pull request to add it to exports I'll pull it in. On Jul 19, 2013, at 1:09 AM, Dominic [email protected] wrote:
|
Allows for plugins to create menu style buttons. See videojs#647.
This might not be as simple as I thought actually. When creating the menu items, you have to call Of course, I could add the player object as a property on my plugin's Am I missing something here, or should I just suck it up and use one of the work-arounds above? |
Anywhere this.player_ exists there should also be this.player() exposed. Have you tried using that to reference the player? |
Ahh, I missed |
No problem On Jul 22, 2013, at 6:41 PM, Dominic [email protected] wrote:
|
@heff, sorry to resurrect a dead issue, but I think I spoke too soon. I was developing using the unminified source before, but when I tested it on the minified version, I tried adding it to exports.js and it still came up undefined. This might be related to the issues I'm having building the project, but I'm not sure. It's almost as if, the subclasses aren't inheriting the |
It looks like component.player was never exported. Just exported. Try it now? |
Thanks for taking a look. For some reason I would think that both of those classes should inherit the player function from vjs.Component, but they don't for some reason. As you can see, it's easy enough to work around the issue for now by just copying the |
Ok, I'm probably gonna need you show a full example of what you're doing. I just ran the following test and player() was available in both instances. videojs.TestComp = videojs.Component.extend({
init: function(player, options){
videojs.Component.call(this, player, options);
ok(this.player());
}
});
var asdf = new videojs.TestComp(player);
ok(asdf.player()); |
That's interesting. In your first test, does the Did you have a chance to look at the 2 bits of code I linked in the previous message? That would be my full example. On both of those lines, I would like to change |
This line could be breaking it. It's overwriting the player() method with a static ref to player. |
Same with this one. When you run the super init |
Oh man, I feel dumb. That was it. Thanks for taking the time to discover that. I really appreciate it. The code is working as expected now. |
Awesome! No problem. |
hello guys i am about to add resolution selector to my site having video.js player, do i need to create different copies for each video resolution ??? |
@raidpipe, take a look at the example file for the plugin. You should setup your video files to match that. |
I'm working on a plugin that will add a new menu style button similar to the captions button. All of the other properties I need seem to be available (e.g.
videojs.MenuItem
), butvideojs.MenuButton
isn't exposed.I'm sure I could recreate the functionality by extending
videojs.Button
, but that would mean a lot of copy/pasting from the core. Any reason not to exportvideojs.MenuButton
that I'm missing?The text was updated successfully, but these errors were encountered: