View previous topic :: View next topic |
Author |
Message |
jeffunk7 Guest
|
Posted: Fri Oct 07, 2005 7:47 am Post subject: Loading an ogg stream from a web page |
|
|
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
|
Posted: Fri Oct 07, 2005 3:22 pm Post subject: |
|
|
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
|
Posted: Tue Oct 11, 2005 5:33 am Post subject: Loading an ogg stream from a web page |
|
|
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.
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.
Yeah sorry I'm not more help, just kind of getting into this myself!
Good Luck! |
|
Back to top |
|
|
The Ice Master Guest
|
Posted: Wed Nov 23, 2005 8:31 pm Post subject: Having a similar problem |
|
|
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
|
Posted: Fri Jan 06, 2006 1:00 pm Post subject: |
|
|
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
Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Fri Jan 06, 2006 3:32 pm Post subject: |
|
|
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 |
|
|
|