bvibber / ogv.js

JavaScript media player using Ogg/Vorbis/Theora/Opus/WebM libs compiled with Emscripten
https://brooke.vibber.net/misc/ogv.js/demo/
Other
1.2k stars 101 forks source link

Icecast streams #535

Open zsaraf opened 4 years ago

zsaraf commented 4 years ago

Hello,

It seems like using OGV.js for icecast streams is not working. OGV.js fails during the options request which doesn't seem like it should be a requirement (and Icecast does not accept OPTION requests).

ogv.js:805 OPTIONS http://stream.id3.fm:8000/djramakc net::ERR_EMPTY_RESPONSE
(anonymous) @ ogv.js:805
load @ ogv.js:768
ogv.js:797 Uncaught (in promise) Error: network error
    at XMLHttpRequest.checkError (ogv.js:797)

Any ideas as to how to configure OGV.js to work with Icecast streams despite the failed OPTION request?

bvibber commented 4 years ago

Unless the hostname and port for the stream are the same as the host web page, CORS headers will be required to read data from the stream. This is an inherent limitation of the web platform at present.

There may be something you can change on the icecast side to support OPTIONS requests, I don't know.

Beware also that concatenated streams are not supported in the Ogg demuxer yet, so depending on how the stream is constructed it may or may not work even if you get it loaded.

zsaraf commented 4 years ago

Thanks for the response. I might try out a different branch of Icecast which allows for OPTIONS requests. Any plans on fixing the second point (concatenated streams) any time soon or no?