2 years ago

#50745

test-img

Emil Avramov

VideoJS: Catch global "net:ERR_FILE_NOT_FOUND" and stop URL from automatically convert to Blob

I am using videojs for streaming an HLS stream. Lately it stopped working on Windows and Android and I guess it is related to a recent update on chrome for those systems, that prevents opening of Blob URLs (like blob:https://example.com/00f85-8fac4e6a78-1aae3b). I've set the sorce video url in a plain format (like https://example.com/video.m3u8), but videojs converts it automatically to a Blob. First question is: is there a way to prevent this and get videojs to load the plain url?

Also, sometimes (usually when server's ffmpeg opens the video.m3u8 for writing at the same time the videojs requests it) there is an error in the console ERR_FILE_NOT_FOUND. This error is not comming from the videojs plugin, but from the window object. I want to reinitialize the player when such error occurs, but I don't seem to know how to catch it. I tried window.onerror and window.addEventListener('error', function() {... but with no luck. I would greatly appreciate any help on this issue.

I need a vanillaJS solution, the website is a simple WordPress blog with no npm or node available on the server.

javascript

http-live-streaming

video.js

0 Answers

Your Answer

Accepted video resources