Spec is too rigid on requiring initial HAVE_CURRENT_DATA transition occur synchronously within coded frame processing (possibly ditto for HAVE_METADATA and init segment received processing) #215
Labels
Milestone
Spec is too rigid on requiring initial HAVE_CURRENT_DATA transition occur synchronous during coded frame processing.
In practice, implementations (like Chrome and IIUC, Firefox) separate HTMLMediaElement.readyState transition from HAVE_METADATA to >= HAVE_METADATA based on being able to decode some or all coded frames to reach currentTime before transitioning the readyState. Further, such decode-based-transition is commonly done after firing 'updateend' on the corresponding SourceBuffer. This enables web apps to continue to append more media data to the SourceBuffer without awaiting the implementation's decode pipeline figuring out that it can actually play something at it's currentTime.
Further, Chrome has some HTMLMediaElement decoder resource scheduling code that suspends decodes under-the-hood in some cases, delaying initial reaching of HAVE_CURRENT_DATA, to optimize scarce resource utilization (decoder, for example). Likewise, not blocking 'updateend' for such MSE-extended elements allows apps to append more media.
@jyavenard, I suspect relaxing the coded frame processing step to reflect what implementations have chosen to do, is probably the best way forward. What do you think?
The text was updated successfully, but these errors were encountered: