Connect AIO Radio Station Player with SPCast Server via MSE (Media Server Extension)

What is the AIO Radio Station Player and how can I use it?

The AIO Radio Station Player is a versatile HTML5 player that has been specially developed for radio streaming. It supports various servers, such as Icecast, Shoutcast, and now also SPCast Server. With this guide you can extend the player to use it for SPCast via the MSE (Media Server Extension).

What is the Media Server Extension (MSE) for SPCast?

The Media Server Extension (MSE) for SPCast extends the functionality of the AIO Radio Station Player so that you can receive and play audio streams from the SPCast server. This extension is particularly useful for users who host on SPCast servers and require easy integration.

How do I add MSE for SPCast to my AIO Radio Station Player?

The integration is very simple and only requires a small change in your template.html file. Follow these steps:

  1. Open the template.html file in the respective “template” folder which is integrated in the AIO Radio Station Player.
  2. Scroll to the end of the document and look for the closing </body> tag.
  3. Insert the following code directly before the </body> tag:
<!-- MSE for SPCast -->
<script>
    const script = document.createElement("script");
    script.src = "https://HOSTNAME.sp.radio.fm/js/mse/spAudioPlayer.js?v=" + new Date().getTime();
    script.type = "text/javascript";
    document.head.appendChild(script);
</script>

What do I need to consider during integration?

Make sure to replace the HOSTNAME placeholder in the URL with the actual host name of your SPCast server. This will ensure that the player loads the correct file and accesses your server.

Why do I have to load the URL with a new timestamp every time?

The timestamp (?v=" + new Date().getTime()) is used to bypass the browser cache. This ensures that the latest version of the script is loaded and that no outdated scripts are cached.

Is this extension suitable for all browsers?

Yes, the MSE extension is designed to work in all common browsers that support HTML5 and JavaScript. However, there may be limitations with older browsers or outdated versions.

What can I do if the integration does not work?

If the integration causes problems, please check the following points:

  • Make sure that you use the correct host name.
  • Check whether JavaScript is activated in the browser.
  • Check whether the SPCast server is running properly and is accessible.
  • Check here whether your browser supports MSE for audio-only tags.

Can I also use the MSE extension with other players?

The integration was specially developed for the AIO Radio Station Player. The aim was to integrate it without touching the actual developer’s code. This was achieved by integrating a simple JavaScript file. You cannot use the integration for other radio players without further ado.