-
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
Feature Proposal: loadMedia, getMedia #4342
Comments
This sounds cool to me. A single API for loading a "video" would be pretty convenient. Wrapping in controls like muted and loop feels a little odd to me, but I haven't read the spec and what they're trying to accomplish. You might consider how this would overlap with the video object schema. If only for terminology of the properties. |
Yeah, not sure whether we want to have those other properties or not yet, just threw it out there. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
`loadMedia` accepts a MediaObject and an optional ready handler. It'll reset the player -- including text tracks, poster, and source -- before setting the new provided media, which include sources, poster, text tracks. `getMedia` will return either the provided media object or the currently set values for sources, text tracks, and poster. Fixes #4342
More and more, when videojs is used, more than just a source is needed. There's the poster image, there's captions, and there's also various properties like muted, and loop, and autoplay.
Loading all these things are often implemented in places like videojs-playlist and Google has a new Media Session API that expects similar items.
This method would accept an object that has all these properties and when called, it'll make sure to unset all the old things. That means that all old posters, all old text tracks would be removed and unset and then the new things would be set. This would be different than something like
src
which wouldn't necessarily remove old textTracks or posters.@imbcmdth I wonder if we'd want to revert the change to the addRemoteTextTrack flag for remove on src change in this case? Or maybe, just keep the default the same?
Also, we're thinking of having it be native in 6.x and be a simpler plugin 5.x that doesn't have as deep of integration with the rest of the player (like removing old text tracks).
The text was updated successfully, but these errors were encountered: