Icecast Streaming Media Server Forum Index Icecast Streaming Media Server
Icecast is a Xiph Foundation Project
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Loading an ogg stream from a web page

 
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Listener Clients
View previous topic :: View next topic  
Author Message
jeffunk7
Guest





PostPosted: Fri Oct 07, 2005 7:47 am    Post subject: Loading an ogg stream from a web page Reply with quote

Hi,

I was having a bit of trouble getting an ogg stream to automatically load winamp on my website, so in case anyone else is having the same trouble here's what I did to make it work. This solution uses php so if you don't have that setup well... you'll have to do something else. This is really just a very minor revision on the code used in the icecast.org website written by oddsock I believe. Nothing original here.

In the webpage that will open the stream from use a line something like this.

<A HREF="http://www.yourwebsite.org/listen.php?pid=YOURMOUNT.ogg&file=listen.m3u">Your Mount</A>

where you replace "www.yourwebsite.org" with your domain name or IP address and "YOURMOUNT.ogg" with whatever mount you have specified in icecast.xml

make the following into listen.php and save into the same directory as the webpage you will start the stream from.

<?
$pid = $_GET["pid"];

header("Content-type: audio/x-mpegurl");
if (preg_match("/MSIE 5.5/", $HTTP_USER_AGENT)) {
header("Content-Disposition: filename=\"listen.m3u\"");
}
else {
header("Content-Disposition: inline; filename=\"listen.m3u\"");
}

$result = "http://".$_SERVER["SERVER_NAME"].":8000/".$pid;
print $result;

?>

Save it all and refresh the page and you should be ready to go.
If it doesn't work you may want to try replacing the http://".$_SERVER["SERVER_NAME"] with your domain name or IP address.

Good Luck!
You can see this script in action at http://jeffunk.yi.org
Back to top
laila
Guest





PostPosted: Fri Oct 07, 2005 3:22 pm    Post subject: Reply with quote

thanks for the info , i really needed that.
i tried your radio and u dont seem to have a latency problem. since im using winamp as a player can you please tell me what did u do to avoid thge latency ?
Back to top
jeffunk7
Guest





PostPosted: Tue Oct 11, 2005 5:33 am    Post subject: Loading an ogg stream from a web page Reply with quote

Hi Laila,

Not real sure If I 'll be able to help you with the latency problem. I have my stream being produced with ices2 which runs on linux, has no gui, or any fancy knobs and dials, so perhaps that is the reason or perhaps it is because ices2 and icecast are running on the same machine...

Although even as I write that I am using a second mount point for a friend and he is producing his stream with winamp. Exclamation

How fast a computer do you have doing the icecasting? I almost can't imagine that is the problem as the amount of cpu time used to icecast has been pretty small everytime I've checked on it. Razz

Yeah sorry I'm not more help, just kind of getting into this myself!
Good Luck!
Back to top
The Ice Master
Guest





PostPosted: Wed Nov 23, 2005 8:31 pm    Post subject: Having a similar problem Reply with quote

What is the format of a listen link to connect to an mp3 stream running on a mount point that's simply /? Do you follow the "/" with listen.m3u? If so, that isn't working on my site for some reason. Winamp brings up a dialog saying opening playlist and then just sits there.
Back to top
Guest






PostPosted: Fri Jan 06, 2006 1:00 pm    Post subject: Reply with quote

This is exactly what i was looking for. However, i have a few questions. My webserver is diffrent from the streaming server. Will this still work? or do i have to specify absolute URL of my streaming mount point?
Back to top
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Fri Jan 06, 2006 3:32 pm    Post subject: Reply with quote

icecast will handle m3u links given to it, 2.3 even checks to see if there is a file in its webroot that matches it as well.

eg to refer to the stream on http://icecast:8000/stream.ogg use

<a href="http://icecast:8000/stream.ogg.m3u">click here</a>

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Listener Clients All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group
subRebel style by ktauber