Home > Back-end >  Playing IceCast2 stream in html
Playing IceCast2 stream in html

Time:11-05

So, is there any way to play an .m3u file (icecast2 stream) in a web browser? (html) I really need an answer. Thanks.

I tried many js .m3u players, but none of them worked.

CodePudding user response:

Yes you can play back many streams that are broadcast through Icecast. However you don't want to point your player at the m3u file, but directly at the stream URL instead.

There are:

  • "HTML5" players that use the the <audio> or <video> tags
  • JavaScript based abstractions on top of the aforementioned
  • JavaScript 'compiled' players that bring their own decoders and such for browsers that don't support things natively

In "the olden days" there were also Adobe Flash and Java-applet based players, but they really are irrelevant by now.

When it comes to formats, I'd recommend the Opus codec as it is supported by most browser engines nowadays. For some use cases MP3 might be valid and while proprietary is nowadays no longer patent encumbered. AAC might bring licensing requirements for encoders etc. along.

  • Related