TinyPortal

Development => Block Codes => Topic started by: softtouch_ph on February 18, 2007, 11:12:48 AM

Title: Streaming Radio
Post by: softtouch_ph on February 18, 2007, 11:12:48 AM
This phpblock displays a combobox with multiple radio stations.
The user can select the station and click the "Play" button.
It popup a small window with the player.

Create a folder in your forum path, like "radio" (as used in the code below)
Create in this folder for each station a small html file as seen below.
The embedded source is the radio stream (.asx).

<HTML>
<BODY>
<TITLE>Station 1</TITLE>
<EMBED SRC="http://globe-ss.dagupan.com:8080/jam883.asx"  HEIGHT="42" WIDTH="100%" AUTOSTART="TRUE">
</BODY>



Next, paste the code below into a phpblock and adjust the path.
The first path ( <center><img src="'.$boardurl.'/radio/radio.gif" align="absmiddle"> ) should point top the attached gif file, inside your radio folder.
The 2nd. path ( <option value="'.$boardurl.'/radio/station1.htm">Station 1</option> ) is the path to the created html file.
You can add as many stations as you like, just create for each the html file and add the <option entry


global $boardurl;

echo '

<html>
<head>
<title></title>
<script language="JavaScript" type="text/javascript"><!--

var windowDoPop;
function go(whichURL)
{
    windowDoPop=window.open(whichURL[whichURL.selectedIndex].value,\'doPop\',\'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=200,height=75\');
    windowDoPop.focus();
}
//--></script>

</head>
<body>

<FORM>
<center><img src="'.$boardurl.'/radio/radio.gif" align="absmiddle">
<br /><br />
<SELECT NAME="SelectURL" size="1">
<option value="'.$boardurl.'/radio/station1.htm">Station 1</option>
</SELECT><br />
<INPUT TYPE="button" VALUE="Listen Radio" onClick="go(this.form.SelectURL.options)"><br />
<font size="1">(Radio stations may not broadcast all the time.)</font>
</FORM>
</center>
</body>
</html>
';


Just google for radio station which provide an .asx stream.
Title: Re: Streaming Radio
Post by: Crip on February 18, 2007, 11:21:24 AM
Got a demo?
Title: Re: Streaming Radio
Post by: softtouch_ph on February 18, 2007, 11:31:37 AM
On my site at http://www.cebucityforum.com, on the right side, near bottom. But only for registered user. I won't create a test account, we had spammer problems and I do not want to have this all over again...
Title: Re: Streaming Radio
Post by: cubsfanbudmn on February 19, 2007, 05:36:59 AM
Here is a new package that was just redone its a great radio mod. I got all my stations right of my winamp player made it nice and easy. i havent seen this posted yet at smf so i thought i would post it here. I had to get it straight from the authors site. And its in spanish  i thought i would save you all the trouble. 
Title: Re: Streaming Radio
Post by: softtouch_ph on February 19, 2007, 05:38:31 AM
Quote from: cubsfanbudmn on February 19, 2007, 05:36:59 AM
Here is a new package that was just redone its a great radio mod. I got all my stations right of my winamp player made it nice and easy. i havent seen this posted yet at smf so i thought i would post it here. I had to get it straight from the authors site. And its in spanish  i thought i would save you all the trouble. 

It depends on winamp?
Title: Re: Streaming Radio
Post by: cubsfanbudmn on February 19, 2007, 06:19:50 AM
No not at all i just use winamp as a place to find the stations. You just browse winamp find a station you like open it then veiw the file info for the http string you need for the station. Pretty easy beats searching the net for stations.
Title: Re: Streaming Radio
Post by: ianus on February 19, 2007, 08:26:29 PM
Greetings

I have tried this nice snipp.
You can see the result at my testing board.
Thats important - testing! So everything (and all the nothing) looks not nice at all.

I will delete this board in the near future and will offer the new link when its all done.
Until look at
link outdated & deleted
for a small Demo.
Title: Re: Streaming Radio
Post by: getslamed on February 27, 2007, 08:28:50 PM
This is a great snipp. Did a little changing to the source htlms to accommodate my shoutcast stream and am running some cool players. WMP player are still available but added a now playing window.  *two thumbs up*  :up: :up:

Title: Re: Streaming Radio
Post by: Zetan on February 27, 2007, 08:40:38 PM
looks great :) though the Now Playing seems to be in a strange position.. just kinda floating over the login area.

I might look at this. I bought Wimpy Player, the full version after being led to believe that it would work with my shoutcast streams.

Well, it only works through a proxy. Money wasted!


ZTN
Title: Re: Streaming Radio
Post by: getslamed on February 27, 2007, 09:22:42 PM
I"m having to redo the full players cuz some reason having 2 TP blocks was causing it to read the larger pop-up window only and I didn't double check it before I posted.

Sorry bout the wimpy player.  The palyer I'm using is a java player and I know a lot of people don't like the memory intensity of java but once its loaded it only runs the shoutcast stream and draw no more. I'm just lovin the heck out of it. 
Title: Re: Streaming Radio
Post by: getslamed on February 27, 2007, 09:25:09 PM
add: just want too add its a free player and no proxy.
Title: Re: Streaming Radio
Post by: Zetan on February 27, 2007, 09:33:05 PM
Check out Amptracker:
http://www.amptracker.com/

Has album art ;)

You can see it working on my site.
Title: Re: Streaming Radio
Post by: getslamed on February 28, 2007, 09:56:46 PM
K heres the page for the players I used. Would have posted it soon but had to fix my site.

jlGui mp3 player (http://www.javazoom.net/applets/jlguiapplet/jlguiapplet.html) from javazoom.

If you need help laying out the files just hit me up.  :uglystupid2:
Title: Re: Streaming Radio
Post by: Neobane on April 02, 2007, 06:17:25 AM
This is an extremely nice snippet and about what I'm looking for.

Loudmouths (http://www.loudmouths.org) are a social discussion group that met on a community radio site called ShoutOk.com.  The site is buggy, poorly written, and barely functioning.  But it is the source for a Talk News Radio station so we had to use it.  We got fed up with it last week and built this site (Thanks to TP, SMF, Tufat, and others) for under $20 total cost.

The only thing we did not have when I discovered your post was a way to stream the station and a user blog.  The User Blog won't happen soon, but I am so thankful for your snippet.  It will allow us to prove that you can get a quality community for a bare minimum (if that) budget.

Now, I have some requests of you geniuses.  I would like to present my users with the option of selecting the player and to also have the option of running the player as part of the page as well as the popup it currently provides.

While I'm at it, does anyone know if there is any legal problems that may occur from streaming radio stations through a player embedded in another site?  We are concerned because our site once it streams the radio, will cause a mass exodus...that is how bad the site is.  I hate to hijack people from a site, but when the site is completely disfunctional, we feel it's our only option.