You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tl;dr: Looking for a way to get the source object (not just the src URL) from the player.
In developing videojs-contrib-eme, we came across a problem. We needed to, as a plugin, get per-source options. This is because each source needs to have a different set of methods/URLs for accessing certificates and keys.
In the current code, we avoid this problem by having the user pass in the options via player.contribEme(options), and we save them and use them from that point on. However, this is cumbersome, as the user has to have more intimate knowledge about event ordering to properly set options when a new source is set, and isn't the cleanest approach.
Instead, we'd prefer to be able to pass in a source/sources to Video.js with the custom properties attached to the object. This would be the normal approach for a custom tech that needs certain properties to run, and we considered writing videojs-contrib-eme as a custom tech, however, that would not allow us to play together alongside any other tech (e.g., videojs-contrib-hls and videojs-contrib-dash). Instead, as a plugin, we want to be able to call player.source(), or something similar, and get the full source object (or individual object as part of an array) as it was passed into Video.js.
This would mean we could listen for an event that indicates a source change (if there is one, or one similar enough -- otherwise that may be another consideration we'd like to make), and grab the current source object to use along with the properties we need.
In the meantime, a workaround that isn't clean but could function in the meantime (provided by @imbcmdth ), is that we create a fake source handler that always returns false, but grabs the source object to use in the plugin.
Thank you!
The text was updated successfully, but these errors were encountered:
This sounds really similar to #2443, which @chemoish opened a PR for some time ago ( #2678 ). I wonder whether that would work for this as well, in which case, we just need to finish the PR.
You're right @gkatsev . That PR looks to be exactly what we're looking for. I can check out that branch, rebase, give it a quick test, and create a new PR (as I won't be able to update the old branch).
tl;dr: Looking for a way to get the source object (not just the src URL) from the player.
In developing videojs-contrib-eme, we came across a problem. We needed to, as a plugin, get per-source options. This is because each source needs to have a different set of methods/URLs for accessing certificates and keys.
In the current code, we avoid this problem by having the user pass in the options via player.contribEme(options), and we save them and use them from that point on. However, this is cumbersome, as the user has to have more intimate knowledge about event ordering to properly set options when a new source is set, and isn't the cleanest approach.
Instead, we'd prefer to be able to pass in a source/sources to Video.js with the custom properties attached to the object. This would be the normal approach for a custom tech that needs certain properties to run, and we considered writing videojs-contrib-eme as a custom tech, however, that would not allow us to play together alongside any other tech (e.g., videojs-contrib-hls and videojs-contrib-dash). Instead, as a plugin, we want to be able to call player.source(), or something similar, and get the full source object (or individual object as part of an array) as it was passed into Video.js.
This would mean we could listen for an event that indicates a source change (if there is one, or one similar enough -- otherwise that may be another consideration we'd like to make), and grab the current source object to use along with the properties we need.
In the meantime, a workaround that isn't clean but could function in the meantime (provided by @imbcmdth ), is that we create a fake source handler that always returns false, but grabs the source object to use in the plugin.
Thank you!
The text was updated successfully, but these errors were encountered: