Best HTML5 Player for SHOUTcast, Icecast, MP3, AAC, and OGG
This minimalist HTML5 audio player lets you embed your live stream on any modern site with a simple copy and paste. Update the “src=”https://your-host:8000/stream.mp3” with your stream URL and you are online. The examples below cover SHOUTcast and Icecast using MP3, AAC, and OGG. For the widest compatibility, provide at least two sources, for example MP3 and OGG.
Works with modern browsers, Chrome, Edge, Firefox, Safari. Internet Explorer is no longer supported. Some browsers block autoplay with sound. Visitors may need to click Play to start audio. See the autoplay note below.
Simple cross-browser HTML5 audio pattern
The safest approach is to offer multiple sources inside one <audio>
element. Browsers will pick the first type they support.
<audio id="radioPlayer" controls preload="none" aria-label="Listen live">
<source src="https://your-host:8000/stream.mp3" type="audio/mpeg">
<source src="https://your-host:8000/stream.ogg" type="audio/ogg">
Your browser does not support the audio element.
</audio>
Tips, for live streams use preload="none"
to avoid unnecessary data. Add visible button text and an aria-label
for accessibility. Prefer HTTPS to avoid mixed content blocks.
Icecast stream examples
Replace with your mount point. Icecast commonly uses a named mount, for example /live
or /stream
.
<!-- MP3 -->
<audio controls preload="none">
<source src="https://your-host:8000/mountpoint" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
<!-- OGG Vorbis -->
<audio controls preload="none">
<source src="https://your-host:8000/mountpoint.ogg" type="audio/ogg">
Your browser does not support the audio element.
</audio>
<!-- AAC in MP4 container -->
<audio controls preload="none">
<source src="https://your-host:8000/mountpoint.mp4" type="audio/mp4">
Your browser does not support the audio element.
</audio>
SHOUTcast stream examples
SHOUTcast servers may use a legacy path that requires a semicolon, or a mount path depending on configuration. Test both patterns below with your server.
<!-- Common legacy pattern -->
<audio controls preload="none">
<source src="https://your-host:8000/;" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
<!-- Alternate pattern with explicit file name -->
<audio controls preload="none">
<source src="https://your-host:8000/;stream.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
<!-- SHOUTcast v2 style mount -->
<audio controls preload="none">
<source src="https://your-host:8000/stream" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
MIME types to use
- MP3,
audio/mpeg
- AAC,
audio/aac
or AAC in MP4,audio/mp4
- OGG Vorbis,
audio/ogg
Autoplay behavior in modern browsers
Most browsers block autoplay with sound unless the user interacted with the page, or the site is on the user’s allow list. If you need to start audio automatically, consider a muted intro or show a clear Play button and set expectations. Readers can learn more about autoplay policies in current browser documentation.
Example with muted autoplay for special cases, not recommended for general radio use:
<audio controls autoplay muted playsinline>
<source src="https://your-host:8000/stream.mp3" type="audio/mpeg">
</audio>
Styling and advanced players
Browser default controls will vary by browser and version. For a consistent look, you can wrap the audio element in your own UI and control it with JavaScript, or you can use a third party player that supports SHOUTcast or Icecast, reads metadata, and displays artwork. If you script the audio element, make sure your stream has proper CORS headers.
Quick checklist
- Use HTTPS stream URLs to prevent mixed content issues.
- Offer at least two formats, MP3 plus OGG or MP3 plus AAC.
- Use correct MIME types, see the list above.
- Expect a user click to start audio in most cases.
- For live streams set
preload="none"
, add clear Play and Stop controls, and include accessible labels.
FAQ
The best HTML5 player is one that works across all modern browsers, supports multiple formats like MP3, AAC, and OGG, and is simple to embed. A basic HTML5 <audio> tag with multiple <source> elements is the most reliable option for SHOUTcast and Icecast streams in 2025.
Offer at least two formats to maximize browser coverage. The most common pair is MP3 (audio/mpeg) and OGG Vorbis (audio/ogg). AAC (audio/aac or audio/mp4) is also widely supported and works well alongside MP3.
Modern browsers like Chrome, Safari, Firefox, and Edge block autoplay with sound unless the user has interacted with the site or the site meets certain engagement rules. To comply, expect visitors to click Play or use muted autoplay in special cases.
Use the correct MIME type for each format: MP3 uses audio/mpeg, AAC uses audio/aac or audio/mp4, and OGG Vorbis uses audio/ogg. This helps browsers correctly identify and play the stream.
Add descriptive labels using aria-label, ensure visible Play and Pause controls, and use clear text descriptions. Accessibility improves user experience and helps your player work well for everyone.
Technical Troubleshooting FAQ
This usually means the stream URL is incorrect or the server is not online. Double-check your SHOUTcast or Icecast host, port, and mount point, and test the link directly in a browser.
Different browsers support different codecs. Provide at least two sources in your <audio> tag (e.g., MP3 and OGG) to ensure maximum compatibility.
Live streams often buffer a few seconds to ensure stable playback. You can reduce this by using preload=”none” so the player only starts buffering when the listener presses Play.
Browsers block “mixed content” when an HTTPS page loads an HTTP stream. Always use an HTTPS stream URL to avoid this issue.
If you are customizing the player with JavaScript or fetching metadata, your streaming server must have the correct Cross-Origin Resource Sharing (CORS) headers enabled.
Some HTML5 players do not read ICY metadata directly. You may need a player that supports it or a separate script that fetches and displays metadata from your streaming server’s status page or API.