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

Player class missing attribute exports #637

Closed
iamjem opened this issue Jul 12, 2013 · 5 comments
Closed

Player class missing attribute exports #637

iamjem opened this issue Jul 12, 2013 · 5 comments

Comments

@iamjem
Copy link
Contributor

iamjem commented Jul 12, 2013

There are several important API methods not exported on Player class instances in the minified version of the source code. I can't imagine this is intentional?

For example, all of these will return undefined when accessed on a player instance returned from the videojs constructor:

playerInstance.remainingTime
playerInstance.supportsFullScreen
playerInstance.enterFullWindow
playerInstance.exitFullWindow
playerInstance.selectSource
playerInstance.preload
playerInstance.ended

I can see maybe hiding some of the fullscreen methods, but ultimately I think virtually every method on the player instance should be public.

@heff
Copy link
Member

heff commented Mar 4, 2014

You're right on these.
ended() is now supported.
selectSource I'd be interested to know what usecase there was behind needing access to it.
Everything else could absolutely be exposed, we've just waited for requests in order to keep the file size as small as possible. Would you be interested in making a pull request for it?

@mmcc
Copy link
Member

mmcc commented Jun 30, 2014

A lot of these are exported at this point (fullscreen methods and ended). @iamjem - Do you still see a need for the others?

@iamjem
Copy link
Contributor Author

iamjem commented Jul 1, 2014

Should be good now, I've just run into some headaches before trying to make some quick one-off custom components for projects where there wasn't access to certain parts of the API.

@heff
Copy link
Member

heff commented Jul 1, 2014

@mmcc it's not the fullscreen methods there, it's the fullWindow methods. Basically everything in that list still needs to be exported except ended and selecSource (unless we find a good use case).

I labeled this as easy, hoping someone will pick it up and do a PR for it. :)

@iamjem, in the next major version we're going to switch from a whitelist approach to a blacklist for variable mangling, so there should be less issue around this.

@dcharbonnier
Copy link

selectSource can be used by some plugins, example this very dirty code : https://github.com/theonion/videojs-vast-plugin/blob/master/videojs.vast.js#L213
You want me to open a ticket for that ?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants