video-dev / media-ui-extensions

Extending the HTMLVideoElement API to support advanced player user-interface features
MIT License
29 stars 8 forks source link

Warning API #13

Open heff opened 6 months ago

heff commented 6 months ago

Today, video.error means video playback has failed, but there are many things that happen under the hood that are not ideal even if they don't cause a playback failure. Most notable are problems that result in rebuffering/stalling, slow startup times, or lower quality renditions.

We don't have a standard way to report/capture these issues for the sake of reporting to analytics or responding to in real time.

The API could mimic the errors API

video.addEventListener('warning', (evt)=>{
  let warning = video.warning;
});

That seems good enough as long as:

I could also see an argument for limited-length array of warnings. But that feels more complicated to manage so I'd prefer to avoid that direction if possible.

This is as much a question for discussion as it is a suggestion. It's possible console warnings could be be good enough.