[Icecast] mediaplayer for icecast streams?

Thomas Jensen lianergoist at vongriffen.dk
Wed Nov 22 23:13:52 UTC 2023


Thank you, Ben!

I was afraid it would be very complicated to get the information
extracted, but it was very simple. My only problem now is to find a way
to update the text on the webpage. I was hoping sleep(5) could do the
trick, but it does not work.

<?php
if (1) {
  $jsonobj=file("http://radio.protestbandet.dk:8000/status-json.xsl");
  //var_dump($jsonobj);
  $arr1[]=json_decode($jsonobj[0], true);
  echo '<strong>'.$arr1[0]['icestats']['source']['title'].'</strong>';
  sleep(5);
}
?>

Can anyone help? 


Thanks


-- 
Thomas Jensen, Denmark


ons, 22 11 2023 kl. 15:23 +0000, skrev Weddle, Ben (Library):
> Icecast provides an endpoint (/status-json.xsl) which returns JSON
> with various data, including "Now Playing". Here is a link to the
> documentation:
> https://www.icecast.org/docs/icecast-trunk/server_stats/
> 
> In your case it looks like it would be
> http://radio.protestbandet.dk:8000/status-json.xsl
> 
> Ben Weddle
> 
> -----Original Message-----
> From: Icecast <icecast-bounces at xiph.org> On Behalf Of Thomas Jensen
> Sent: Wednesday, November 22, 2023 5:48 AM
> To: icecast at xiph.org
> Subject: [Icecast] mediaplayer for icecast streams?
> 
> Attention: This email originated from a source external to Metro
> Government. Please exercise caution when opening any attachments or
> links from external sources.
> 
> 
> Hi
> 
> Hope this is not too off-topic here.
> 
> I want to implement a simple mediaplayer on my website where people
> can listen to my radio stream.
> 
> I like simple, and the HTML <audio>-tag seems to work fine, so this
> is perfect for me.
> 
> But I would like to show the title of the current song playing. Is
> there some simple javascript or php I can use, to get this
> information?
> 
> Or maybe a simple mediaplayer I can implement on my web site?
> 
> https://cas5-0-urlprotect.trendmicro.com:443/wis/clicktime/v1/query?url=https%3a%2f%2fprotestbandet.dk&umid=d50cc718-1d9b-40b9-8160-2261ad964db6&auth=1a6d21fc0f08666d9d61586860ead8e0225a9cfa-2d73b0a9551614a73432224aa6e62b00dce8e352
> 
> 
> Thanks...
> 
> 
> Thomas Jensen, Denmark
> 
> _______________________________________________
> Icecast mailing list
> Icecast at xiph.org
> http://lists.xiph.org/mailman/listinfo/icecast
> _______________________________________________
> Icecast mailing list
> Icecast at xiph.org
> http://lists.xiph.org/mailman/listinfo/icecast




More information about the Icecast mailing list