When we have a video file which browser can not play (issue might due to formats or codec), I want to inform the user that the file can not be played by the browser.
In the case of browser being unable to play the video (due to unsupported format or codec), onloadedmetadata event does not get fired.
I would like to know:
onloadedmetadata event?
- Is there an event which fires when metadata load fails?
- Is there an error handler for onloadedmetadata event?
Instead of a specific event which fires when metadata or onloadmetadata fails; You can do a trycatch:
try {
// load your video.
} catch (error) {
// inform the user that the file can not be played by the brower.
}
For a great documentation about trycatch, visit here