xiph / Icecast-Server

Icecast streaming media server (Mirror) - Please report bugs at https://gitlab.xiph.org/xiph/icecast-server/issues
https://icecast.org
GNU General Public License v2.0
464 stars 127 forks source link

Request for suggestions for pure JS HTML5 MSE based player for Icecast streams #15

Open Brahmasmi opened 6 years ago

Brahmasmi commented 6 years ago

Is there a pure Javascript based HTML5 player that can play Icecast streams using Media Source Extensions?

I ask this because the pull request #6 mentions @jucrouzet and @marcelgwerder talking about a JS/HTML5/MSE based player using XHR/Fetch.

I have previously tried to figure out if Google's Shaka player could play Icecast streams, but it seems they cannot, at least based on their current architecture - https://github.com/google/shaka-player/issues/725.

Thanks.

jucrouzet commented 6 years ago

You can play an icecast stream in an <audio> tag as long as the stream is based on a codec that your browser can read. Just put its url in the src attribute (<audio> or <source>).

AFAIK, the #6 PR is useful for a a pure JS player that can use icecast metadata (title, etc.) in the stream, the PR is being reviewed by Icecast team.

Brahmasmi commented 6 years ago

Thanks @jucrouzet for your comment.

I understand that putting the URL source in the audio tag should play the stream, but in certain cases the container + codec is not supported natively in the browser (canPlayType). It is supported via MSE (isTypeSupported).

For example, MS Edge supports WebM, VP9 and Opus via MSE but not natively. Please see here - https://blogs.windows.com/msedgedev/2016/04/18/webm-vp9-and-opus-support-in-microsoft-edge/.

Hence the need to use MSE if one wishes to use open source royalty free container + codecs.

jucrouzet commented 6 years ago

Well, yep, that's one use case for the pure JS / MSE player I'm doing. But yep, it needs #6 to be merge as it needs chunks to be downloaded via XHR/Fetch, so it needs CORS.

guest271314 commented 3 years ago

Is there a pure Javascript based HTML5 player that can play Icecast streams using Media Source Extensions?

Media Source Extensions are not necessary to play an Icecast stream at HTMLMediaElement. I streamed 8 hours of audio using FetchEvent.respondWith(fetch('/path/to/icecast/stream')) https://bugs.chromium.org/p/chromium/issues/detail?id=1161429#c44.