Display album art of a shoutcast v2 stream

698 Views Asked by At

I have a shoutcast server v2.6 and a website with a player on the same server. The player already show title and artist from the audio stream. With shoutcast 2 stream, we can display the album art simply by this URL: url_of_the_server/playingart?sid=1 (for stream 1) but it has to be refreshed So, I am a newbee, would you help me to get a code to display this url and refresh it without refreshing the page, so has to be in javascript or jquery. Thank you

1

There are 1 best solutions below

2
On

This is an example pseudo code for Jquery

function loadImage(){
 $.ajax({
  url: 'url_of_the_server/playingart?sid=1',
  type: 'get',
  success: function(response){
   // Display image from response
  }
 });
}

$(document).ready(function(){
 // Run every 5 seconds
 setInterval(loadImage, 5000);
});

Another option is to remove image every 5 seconds and replace it with a new URL