checking if a icecast stream is active
Hi folks, I run my own icecast2 server. In the near future it looks like, I will be doing some shows. I would like to beable to change my link, so if I am broadcasting, to go to the stream if not pop a box for my schedule.
Now from when I was checking to see if my webcam was up or not, i used this.
<code>
<td style="text-align: center; vertical-align: top;">
<?php
error_reporting(0);
$fs = fsockopen('tux.isa-geek.org', 7090, $errno, $errstr, 30);
if(!$fs){
echo "<br><p> Images not available </p>";
echo "<iframe id=\"myFrameL\" align=\"center\" src=\"/webcam/testcard2.png\" height=\"256\" width=\"338\">Sorry your browser dosen't do iframes</iframe>";
echo "<br><p> Images not available </p>";
}
else {
echo "<br><p> LiveCam </p>";
echo "<iframe style=\"background-color: black;\" id=\"myFrameL\" align=\"center\" src=\"http://tux.isa-geek.org:7090/\" height=\"256\" width=\"338\">Sorry your browser dosen't do iframes</iframe>";
echo "<br><p> LiveCam </p>";
}
?>
</td>
</code>
Which works fine, but now I need to check for a url
"http://tux.isa-geek.org:8000/idjc.m3u"
does anyone know haw to change my code for this? I know when I'm not stream it generates a 404 error, in winamp (on windows)
thanks in advance.
|