muxinc / hls-video-element

A custom element (web component) for playing HTTP Live Streaming (HLS) videos.
https://hls-video-element-mux.vercel.app
MIT License
38 stars 18 forks source link

How to do error handling with streams that have codec problems or broken? #44

Open jffluis opened 7 months ago

jffluis commented 7 months ago

just want to catch error and just just a js alert is enough. Can u help?

How can i get a js object to get and error by Hls.js? I'm using vanilla js.

<hls-video
src="myurl"
slot="media"
autoplay
controls
playsinline>
</hls-video>
luwes commented 5 months ago

listen for the error event and check the .error property similar to the native video element. https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/error_event https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/error