-
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
feat: Add videojs.getAllPlayers
to get an array of players.
#4842
Conversation
I'm for adding these but against this API. Having it return an array of players when called via |
Yeah, I don't disagree. I had similar thoughts. I like Alternatively, the videojs.getAllPlayers().forEach(p => p.dispose()); Another alternative approach would be to have const playerCollection = videojs.getAllPlayers();
playerCollection.dispose();
const playerArray = videojs.getAllPlayers().toArray(); |
I'm partial to |
videojs.all
to get an array of players or delegate method calls to all players.videojs.getAllPlayers
to get an array of players.
e84c103
to
818684e
Compare
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.
LGTM
Tested: ☑️ |
818684e
to
7d6f4bf
Compare
When working on another PR, I noticed that there were tests somewhere not completely cleaning up after themselves. Then, I thought, wouldn't it be nice to be able to delegate method calls to all players, so we could dispose them?
This new function makes that easier:
Previously, you'd have to do something like:
Requirements Checklist