Extended options for program details

The actual program details should be sufficient for most users. In order to avoid unnecessarily bloating the product management area, we have moved it here for users who are interested in more advanced options.

Final output of the codes as an image

The codes make it possible to convert the final output into URL-compliant Base64 and retrieve it as an image from your own domain.

Why could I use this?

The extension was created in response to a user request. The aim was to display the AutoDJ’s current playlist as an image rather than text. As the names of the actual playlists often do not change, the name of the currently playing playlist is converted into URL-compliant Base64 and then retrieved from a directory on the radio homepage.

Modification of the original code

Change the JavaScript from

<script>
// Define the domain variable here
var loadbalancerDomain = "HOSTNAME.sp.radio.fm";
</script>
<script src="https://HOSTNAME.sp.radio.fm/scripts/js/details.min.js"></script>

to the following

<script>
// Define the domain variable here
var loadbalancerDomain = "HOSTNAME.sp.radio.fm";

//// This Area defines values for the attribute -> data-show-as="img"
// Define your radio homepage url here without http or https://
var radioDomain = "ihre-eigene-domain.de";
// Define the images folder on your homepage which should used by this script
var radioDomainFolder = "ordnername";
// Define the image extension like .png, .jpg and so on
var radioDomainImageExtension = ".png";
</script>
<script src="https://HOSTNAME.sp.radio.fm/scripts/js/details.min.js"></script>

Replace “HOSTNAME” with your SPCast subdomain.

Change the HTML code from

<span class="spcasteu_streaminfo" data-type="now_playing.playlist" data-error="Error loading playlist">Loading...</span>

to the following

<span class="spcasteu_streaminfo" data-type="now_playing.playlist" data-show-as="img" data-imgwidth="256" data-error="Error loading playlist">Loading...</span>

Final note

Once you have made the changes, instead of displaying the playlist name, this output will be displayed as an image on your homepage. Use the browser console if you want to know what the name of the image on your homepage should be. The whole thing works with all codes. What you as a user do with it is entirely up to you.

To calculate the title of a playlist image in advance, please click on the following link: https://sp.radio.fm/scripts/calculate_base64.php