-
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
SourceHandlers need a way to specify that they are not ready to it's tech #2268
Comments
That's not the way I'd recommend building your source handler (or tech). The video element guarantees all properties and methods are available immediately, though many of them have asynchronous effects. It has to do long-running jobs like fetching video data to begin playback, too. It expresses that asynchronicity through |
What's the specific error that's happening here? What is trying to do what with the source handler before it's ready and what happens? |
@dmlap That is true but the video element also has internal behavior like acknowledging that
@heff It's been a while, but it was related to a plugin (playlist if I recall) that called As a result, the |
I agree that writing source handlers/techs is tough and we could do a better job helping manage asynchronous loading processes. |
Wow, that's a shame. There's no reason I can think of why dash.js would need to asynchronously set up a media source, except that it's probably looped that in with creating source buffers. Maybe that wouldn't fix the issue anyway if there's still no source buffers, but it might, if there's any way to feed dash.js an existing media source. Can we look into that, because otherwise we might be complicating source handlers just for dash.js. |
Also, if this means you can't call play() on the video element synchronously after create a dash player, and we can fix that, it might be something we can push back to dash.js to change. |
@imbcmdeath is convincing me that we should manage something like "requested tech state" in the base tech and expose it to source handlers. The dash handler could query that snapshot when it finished booting up and attaching its Media Source, and the Flash tech could use the snapshot to initialize itself once the SWF loaded. We might be able to get rid of It's more complexity for the base tech but I think it would make Source Handlers significantly easier to write. HLS has some async startup shenanigans it has to deal with too, for instance. |
Is there any update on this matter since 6.0.0 was released including async source selection? |
Right now, it is assumed that the source handler is ready once it has returned from the
handleSource
function. It would be helpful if the parent Tech waited for an event or a call back from the sourceHandler before it signals to the world that it is ready to start playing.There are sources which are fetched and processed asynchronously. The current work around seems to be to set the
isReady_
variable tofalse
in thehandleSource
function and then callingtriggerReady
when you are actually ready.The text was updated successfully, but these errors were encountered: