Search code examples
xsltembedicecast

How to embed an Icecast mountpoint player on an Icecast page?


I'm attempting to embed my Icecast mp3 on my Icecast page and getting a 404 parsing error. This is on an Ubuntu 20.04 headless server with nginx.

The mountpoint is in the following format:

https://sub.domain.com/live.mp3

For example, I have tried:

<audio controls><source src="https://sub.domain.com/live.mp3?type=.mp3" type="audio/MPEG">Your browser does not support the audio element.</audio>

This results in 404 - Could not parse XSLT file in my browser.

I have also tried:

<audio>
    <source src="https://sub.domain.com/live.mp3" type="audio/mpeg">
</audio>

And the result is the same. I'm guessing it's because it's an .xsl file? How can I get the embed to work?


Solution

  • The code you're showing is not valid XML, which it needs to be in that XSL file. All you need to do is make sure your tags are closed. You're missing a / on your source tag. And in your first example, you'd need a value for every attribute. Try this:

    <audio controls="controls" preload="none">
      <source src="https://example.com/live.mp3" type="audio/mpeg" />
    </audio>
    

    You'll also note that I added preload="none"... this is so that your stream stays "live" and isn't streaming in the background while not playing.