whatwg / html

HTML Standard
https://html.spec.whatwg.org/multipage/
Other
7.85k stars 2.57k forks source link

Add hint attribute to HTMLMediaElement to configure rendering latency #4638

Open chcunningham opened 5 years ago

chcunningham commented 5 years ago

All user agents delay the start of playback until some minimum number of frames are decoded and ready for rendering. This buffer provides an important cushion against playback stalls that might otherwise be caused by intermittent decoder slowness. It also adds a small amount of latency to start playback. For example, in Chromium this adds roughly 200 milliseconds for common video frame rates.

I'd like to propose an attribute that lets web authors disable this rendering buffer for use cases where sub-second latency is more important than smooth playback.

Some examples include interactive apps like cloud gaming or remote desktop. Notably, this feature does NOT target video streaming sites that offer live sports and TV. For these sites, low latency (e.g. 3 seconds) is very important, but sub-second latency is not critical and should not be prioritized over smooth playback.

Please see here for additional details and examples.

There have been a number of bugs MediaSource bugs [1][2][3] that reference this, but they also discuss a number of MSE specific issues/features-requests. This bug tracks feature that is more broadly applicable to \<audio> and \<video>.

[1] https://www.w3.org/Bugs/Public/show_bug.cgi?id=28379 [2] https://github.com/w3c/media-source/issues/21 [3] https://github.com/w3c/media-source/issues/133

annevk commented 5 years ago

cc @whatwg/media