LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-20-2010, 11:14 AM   #1
johnh10000
Member
 
Registered: Nov 2008
Distribution: Ubuntu Lucid Lynx
Posts: 541

Rep: Reputation: 33
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.
 
Old 04-20-2010, 01:00 PM   #2
johnh10000
Member
 
Registered: Nov 2008
Distribution: Ubuntu Lucid Lynx
Posts: 541

Original Poster
Rep: Reputation: 33
got this far

But when I turn off the stream and don't put error_reporting(0) in it errors saying ...file not found error 404, fine. put it in and print $tags allways says 'Array()', and $fp is always true. what am i doing wrong?

<CODE>
<?php
error_reporting(0);
$h = fsockopen('tux.isa-geek.org',8000);
if($h) {
$fp = file_get_contents('http://tux.isa-geek.org:8000/idjc.m3u');
if($fp) {
$tags = get_meta_tags('http://tux.isa-geek.org:8000/idjc.m3u');
print_r($tags);
echo "<a href=\"http://tux.isa-geek.org:8000/idjc.m3u\">Live Stream On air<br></a>";
}
else
{
echo "Live stream not on air";
}
}
?>
</CODE>
 
Old 01-26-2011, 04:12 PM   #3
playtform
LQ Newbie
 
Registered: Jan 2011
Posts: 1

Rep: Reputation: 0
You can use Playtform for that:

playtform.com/webServices/isStreamActive
 
Old 01-26-2011, 07:09 PM   #4
johnh10000
Member
 
Registered: Nov 2008
Distribution: Ubuntu Lucid Lynx
Posts: 541

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by playtform View Post
You can use Playtform for that:

playtform.com/webServices/isStreamActive

wow, I have been using ezstream , will check out playform.

thanks, will report.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Icecast stream a stream R03L Linux - Software 1 07-17-2009 06:37 PM
LXer: How to mirror an internet audio stream (using Icecast) LXer Syndicated Linux News 0 03-23-2009 12:30 PM
Howto transcode & relay a MPEG stream to a WMV stream?? crazyivan Linux - Software 0 06-15-2007 03:18 AM
Using icecast to boadcast an incoming stream cshot Linux - Enterprise 0 04-12-2006 11:24 PM
Windows Media Playlist for Icecast stream funkatron General 0 04-11-2005 05:46 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration