Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

MP3 stream served by Shoutcast


Hello,

I am trying to use JW Media Player to play an MP3 stream served on demand by Shoutcast. The stream is available at: http://winamp.streamnow.nl:8006/content/Linards1.pls
I can listen to it with VLC but with JW Meida Player it simply won't load, the code being:

bc.. <!-- Flash Player detection and embed -->
<script type="text/javascript" src="js/swfobject.js"></script>

<p id="player"><a href="http://www.macromedia.com/go/getflashplayer">Get Flash</a> to see this player.</p>
<script type="text/javascript">
var so = new SWFObject('flash/jw_media_player/mediaplayer.swf','mpl','175','88','8'); so.addVariable("file","http://winamp.streamnow.nl:8006/content/Linards1.pls");
so.addVariable("displayheight","0");
so.addVariable("height","88");
so.addVariable("displaywidth","175");
so.addVariable("width","175");
so.addVariable("shownavigation","true");
so.addVariable("backcolor","0x000000");
so.addVariable("frontcolor","0xFFFFFF");
so.addVariable("lightcolor","0xFF7FCF");
so.addVariable("autoscroll","false");
so.addVariable("showdigits","total");
so.addVariable("showeq","false");
so.addVariable("showvolume","true");
so.addVariable("thumbsinplaylist","false");
so.addVariable("autostart","false");
so.addVariable("bufferlength","3");
so.addVariable("repeat","false");
so.addVariable("shuffle","true");
so.addVariable("volume","80");
so.addVariable("enablejs","true");
so.addVariable("javascriptid","mpl");
so.addVariable("linkfromdisplay","false");
so.addVariable("useaudio","true");
so.addVariable("usecaptions","true");
so.addVariable("usefullscreen","true");;
so.addVariable("usekeys","true");
so.write('player');

</script>

41 Community Answers

JW Player

User  
0 rated :

Hello,

After having read the thread on MP3 stream from Shoutcast/Icecast http://www.jeroenwijering.com/?thread=5829#msg35647 and tried the code, I still can't get it to play. Below is the code.

The Player

bc.. <!-- Flash Player detection and embed -->
<script type="text/javascript" src="js/swfobject.js"></script>

<p id="player"><a href="http://www.macromedia.com/go/getflashplayer">Get Flash</a> to see this player.</p>
<script type="text/javascript">
var so = new SWFObject('flash/jw_media_player/mediaplayer.swf','mpl','175','88','8'); so.addVariable("file","flash/jw_media_player/playlist.xml");
so.addVariable("displayheight","0");
so.addVariable("height","88");
so.addVariable("displaywidth","175");
so.addVariable("width","175");
so.write('player');

</script>



The playlist:

bc.. <?xml version="1.0" encoding="utf-8"?>
<playlist version="1" xmlns="http://xspf.org/xspf-v0.html">
<trackList>

<track>
<title>Intro Tune</title>
<creator>Martinez Gonzales</creator>
<location>andradzubakatrina.mp3</location>
<image>img/Sharp.gif</image>
</track>

<track>
<title>http://winamp.streamnow.nl:8006/content/Linards1.pls</title>
<creator>Linards</creator>
<location>http://winamp.streamnow.nl:8006/content/Linards1.pls;stream.nsv</location>
<meta rel="type">mp3</meta>
</track>

</trackList>
</playlist>



The Shoutcast play list:

bc.. [playlist]
numberofentries=1
File1=http://winamp.streamnow.nl:8006/content/Linards1.mp3



If I understood correctly, the bit ";stream.nsv" needs to be in the URL of corresponding entry in the XML playlist. If I try to access the URL http://winamp.streamnow.nl:8006/content/Linards1.pls;stream.nsv the server returns "INVALID RESOURCE" whereas the same URL without ";stream.nsv" does return the playlist file that I can play with VLC.

Any ideas?

JW Player

User  
0 rated :

Hello andersen,

Yes, thanks for the reminder about the vars in the readme page. Please disregard the first test above, I was familiarizing myself with the variables. The second code example I posted (after your post) should be a step in the right direction, but still cannot see what is wrong with it.

Can you help please?

Regards,

Adal Fraile

JW Player

User  
0 rated :

i can only tell that the code it self looks fine!
unfortunately i have no experience with shoutcast, but a [url=http://www.jeroenwijering.com/?search=shoutcast]search[/url] might tell a solution?

JW Player

User  
0 rated :

I double checked the search results but could not find a solution. I would appreciate it if you could test the on-demand stream yourself with provided code to confirm it is not working at your end either.

Regards,

Adal Fraile

JW Player

User  
0 rated :

you are testing online?
have you made a regular file play, before getting into streaming?

JW Player

User  
0 rated :

Yes, I have tested a regular file play with the same MP3 file and it does work, then copied the the MP3 file to the host that provides the on-demand streaming service (it has just been set up today, so I am still testing) and followed the instructions to handle Shoutcast streams in JW Media Player but it won't play unless I use a desktop player.

JW Player

User  
0 rated :

I do not understand why http://winamp.streamnow.nl:8006/content/Linards1.pls
returns the correct Shoutcast playlist over HTTP, while attempting the following URLs return an INVALID RESOURCE message:

http://winamp.streamnow.nl:8006/content/Linards1.pls;stream.nsv or http://winamp.streamnow.nl:8006/content/Linards1.mp3;stream.nsv
http://winamp.streamnow.nl:8006/content/Linards1.mp3

(file Linards1.mp3 is there and the URL in the Shoutcast playlist is http://winamp.streamnow.nl:8006/content/Linards1.mp3)

Will try Shoutcast forums for now. Meanwhile, I would appreciate it if someone here with knowledge of Shoutcast could tell what it wrong.

Regards,

Adal Fraile

JW Player

User  
0 rated :

Tried the same stream with a self-signed MP3 Java applet (http://www.javazoom.net/applets/jlguiapplet/jlguiapplet.html) and it does play it...Would love to use this CC Flash player instead.

JW Player

User  
0 rated :

do you have the player online too?

JW Player

User  
0 rated :

Yes, see below.

Example 1: JW Media Player with XML playlist pointing to both regular MP3 file and same file served on-demand by Shoutcast from remote server via Shoutcast playlist:

http://affirma.nu/projects/fga/jw_media_player.html

Example 2: self-signed Java applet MP3 player playing same MP3 stream:

http://affirma.nu/projects/fga/java_applet.html

Regards,

Adal Fraile

JW Player

User  
0 rated :

i realize now that the applet loads a playlist...
so when you load the same into the player, you are referring to a playlist from a playlist - im not sure that is possible!
have you tried loading the shoutcast playlist directly into the player
or referring directly to the mp3 from the player playlist.xml?

JW Player

User  
0 rated :

Yes, I have in fact tried three different things:

- referring directly to the MP3 (http://winamp.streamnow.nl:8006/content/Linards1.mp3) in both the applet and the flash player (adding here the type var to force MP3 type). It worked only in the applet, flash player says: undefined;

- loading a Shoutcast playlist directly in both the applet and the flash player (no type var added so file is treated as playlist). It worked only in the applet, flash player hangs out while waiting for stream, also if adding ";stream.nsv" to URL in file var;

- referring to the MP3 file via a playlist that either player supports (m3u for the applet, XML for the flash player). It worked only in the applet, flash player says: undefined.

I am puzzled.

Regards,

Adal Fraile

JW Player

User  
0 rated :

howabout try without adding the type var to force MP3 type and play
http://winamp.streamnow.nl:8006/content/Linards1.mp3 directly
and from a playlist.xml...
maybe the : need to be escaped? please see this [url=http://www.jeroenwijering.com/?thread=6681]thread[/url]

JW Player

User  
0 rated :

Just tried that as well with no luck.

I also tried escaping the URL (both manually and magically via the escape() method)...same results.

Thank you for the suggestion anyway.

Regards,

Adal Fraile

JW Player

User  
0 rated :

have you already seen this [url=http://www.jeroenwijering.com/?thread=5689#msg24081]thread/posting[/url] ?

_"Seems it's actually very easy to use a Flash MP3 player to play ShoutCast streams in IE.
Just change this:
bc.. so.addVariable('file', 'http://tv13.stream-music.net:8008');

to this:
bc.. so.addVariable('file', 'http://tv13.stream-music.net:8008/;stream.nsv');


Note the addition of bc.. /;stream.nsv
after the port number."_

JW Player

User  
0 rated :

Hello andersen,

In the light of other threads/postings like the one you are referring to, I already tried adding bc.. /;stream.nsv
in many ways:
bc.. http://winamp.streamnow.nl:8006/;stream.nsv/content/Linards1.pls
http://winamp.streamnow.nl:8006;stream.nsv/content/Linards1.pls
http://winamp.streamnow.nl:8006/content/Linards1.pls/;stream.nsv
http://winamp.streamnow.nl:8006/content/Linards1.pls;stream.nsv
http://winamp.streamnow.nl:8006/;stream.nsv/content/Linards1.mp3
http://winamp.streamnow.nl:8006;stream.nsv/content/Linards1.mp3
http://winamp.streamnow.nl:8006/content/Linards1.mp3/;stream.nsv
http://winamp.streamnow.nl:8006/content/Linards1.mp3;stream.nsv


None of them works with the flash player, either directly via flash var or via playlist.

However, note the following. The streaming server is on a shared host and the provider requires the URL to be in the form of:

<protocol>://<domain>:<port>/<subdir>/<filename of Shoutcast playlist> e.g.:
bc.. http://winamp.streamnow.nl:8006/content/Linards1.pls



But there actually is no such file named Linards1.pls in the dir which I must upload the MP3 files to. There must be some sort of server-side mechanism that maps .pls file requests to the corresponding .mp3 files and returns a .pls file created on the fly.

Having said that I had also created and uploaded a Linards1.pls file to that dir containing the code below and re-tried in all possible ways we have mentioned in this thread.

bc.. [playlist]
numberofentries=1
File1=http://winamp.streamnow.nl:8006/content/Linards1.mp3



But no luck yet.

However, I am not certain as to whether the server is returning this .pls file I created myself or a .pls file created on the fly by the server. What's more, I can't see what the server is actually returning and the fact is some of the desktop players that Shoutcast recommends are having trouble with URL http://winamp.streamnow.nl:8006/content/Linards1.pls. iTunes (Win) for instance won't play it, unless the URL is http://winamp.streamnow.nl:8006/content/Linards1.mp3


Regards,

Adal Fraile


JW Player

User  
0 rated :

Winamp can't play URL http://winamp.streamnow.nl:8006/;stream.nsv/content/Linards1.pls

It returns:

ICY 404: Resource not found
Connection closed.

Instead, URL must be: http://winamp.streamnow.nl:8006/;stream.nsv/content/Linards1.mp3

VLC accepts URL http://winamp.streamnow.nl:8006/;stream.nsv/content/Linards1.pls

but the text printed on its 'status bar' suggests it is actually playing URL http://winamp.streamnow.nl:8006/;stream.nsv/content/Linards1.mp3

Let's see what the Support team from Shoutcast.com think of this.

Regards,

Adal Fraile


JW Player

User  
0 rated :

Hello andersen and everyone else,

I am all sorted now. Having contacted the streaming provider, I can successfully play the Shoutcast playlists in Winamp and iTunes. They also gave me an alternative URL to access the MP3 streams/files, e.g. http://stream8006.winamp.streamnow.nl/Linards1.mp3, which JW Media Player successfully plays.

Thank you very much for the great support.

PS: I am using JW Media Player for a non-commercial project run by a non-profit org so do not need a commercial license. Do you accept donations? AFAIK there is no donation system implemented in this site yet.

JW Player

User  
0 rated :

you are welcome, glad it worked out :)
- concerning donation, even you dont need, why not just get a [url=http://www.jeroenwijering.com/?order=form]licence[/url]? -

JW Player

User  
0 rated :

Hello

Great thread, got me a long way, but not there yet.
I have similar problem, so I wondered what is behind the address: http://stream8006.winamp.streamnow.nl/Linards1.mp3 wich is the address that works for your JW player.
Are there an SC playlist or is it directly to the mp3 file ?

http://mp3.2morrow.dk:8007/content/life.pls also opens VLC player and plays the file, but JW player seems like loading to 100% but keeps turning like there is no file....

http://mp3.2morrow.dk:8007/content/life.mp3 (with mp3 ending) in a browser says "Invalid resource" and SHOUTcast server in the title.

What is the magic trick ?

Thanks in advance

JW Player

User  
0 rated :

Add:
The ShoutCast app closes when I log off the server....

JW Player

User  
0 rated :

tyt

JW Player

User  
0 rated :

I run my own Shoutcast Server here is where I embed the player http://radio.erunix.com here is the code I use to make it work,

<script type="text/javascript">
var s1 = new SWFObject("mediaplayer.swf","mediaplayer","300","100","7");
s1.addParam("allowfullscreen","true");
s1.addVariable("width","300");
s1.addVariable("height","100");
s1.addParam('allowscriptaccess','always');
s1.addVariable('type', 'mp3');
s1.addVariable('file', 'http://radio.erunix.com:8000/;stream.nsv');
s1.addVariable("image","live_radio.gif");
s1.write("player");
</script>

Enjoy

JW Player

User  
0 rated :

Thanks for the stream link. Have you found that the excessive memory consumption has gone away with the Flash Player v9,0,115,0? Because I'm not seeing it anymore. Shoutcast/Icecast streams seem to run for hours without the browser gobbling up all available RAM and then crashing.

JW Player

User  
0 rated :

Yes it's strange adding /;stream.nsv after the port (example: http://shoutcast.omroep.nl:8104/;stream.nsv) does plays it in
flash (9.0.0.124/10.x) This is the ascode i'm using:

var s:Sound = new Sound();
s.load(new URLRequest("http://shoutcast.omroep.nl:8104/;stream.nsv"));
s.play();

The radio station you will be hearing is the Dutch Public Radio 3FM
Check the file here (you might want to refresh your browser a few times, for the sound to be streamed properly.
http://davewouters.com/shoutcast/emptyStream.html
OR
http://davewouters.com/shoutcast/shoutTest.html (this is with Security.allowDomain(""), ultimately not needed though)
I also made a small current-playing-song example file, from the same station here:
http://davewouters.com/shoutcast/

JW Player

User  
0 rated :

Dave, I checked out your stream and it seems to work perfectly but mine won't!

After 5-10 minutes playing the stream the audio becomes unreliable and starts to drop out and never gets playing again properly. Disabling 'Compress Movie' seemed to help a bit but it still happens. Any ideas?

Really unsure of why this could be but the only reason I can think of is they are on seperate servers.

JW Player

User  
0 rated :

Update: Seems to be fixed now I'm streaming from the same server! Really cool to finally have shoutcast working in flash player!
Thank you so much Dave!

Now comes the fun part getting currently playing, just played and up next track info in there!

JW Player

User  
0 rated :

Actually I want this ur " http://suruthifm.workisboring.com/suruthifm " have to work in my flash player any possiblities are there?

I am trying small project some of url like that emberded to my flashplayer.

Please if possible let me guide it will be helpfull for me .

thanks

JW Player

User  
0 rated :

@RADAN - http://suruthifm.workisboring.com/suruthifm - returns an asx playlist which i have not been able to play yet -
but then, there is much about streaming i dont know, so it is not ruled out that it is possible...

<ASX VERSION = "3.0" BANNERBAR = "FIXED">
<ABSTRACT>SuruthiFM.com</ABSTRACT>
<TITLE>SuruthiFM.com </TITLE>
<AUTHOR>SuruthiFM.com</AUTHOR>
<COPYRIGHT>Powered by SuruthiFM.com</COPYRIGHT>
<BASE HREF= "http://www.SuruthiFM.com/" />
<MOREINFO HREF = "http://www.SuruthiFM.com" />
<ENTRY>
<TITLE>Suruthifm.com </TITLE>
<AUTHOR>Bring the truth in NEWS to you!</AUTHOR>
<COPYRIGHT>By SurthiFM.Com</COPYRIGHT>
<MOREINFO HREF = "http://www.Suruthifm.Com"></MOREINFO>
<REF HREF = "http://91.121.136.197:9210" />

</ENTRY>
</ASX>

JW Player

User  
0 rated :


*http://91.121.136.197:9210* returns an Icecast stream with these headers:bc.. ICY 200 OK
icy-notice1:<BR>This stream requires <a href="http://www.winamp.com/">Winamp</a><BR>
icy-notice2:SHOUTcast Distributed Network Audio Server/Linux v1.9.8<BR>
icy-name:www.Suruthifm.com
icy-genre:Various
icy-url:http://www.Suruthifm.com
content-type:audio/mpeg
icy-pub:1
icy-br:56



I think you have to somehow shoehorn the media type into that ASX playlist.bc.. <param name="type" value="audio/mpeg" />

If it's yours, add the type to the code, if it's someone else's playlist, pass it through a proxy script on your server that adds the type.bc.. <asxversion="3.0"bannerbar="fixed">
<abstract>suruthifm.com</abstract>
<title>suruthifm.com</title>
<author>suruthifm.com</author>
<copyright>poweredbysuruthifm.com</copyright>
<basehref="http://www.suruthifm.com/"/>
<moreinfohref="http://www.suruthifm.com"/>
<entry>
<title>suruthifm.com</title>
<author>bringthetruthinnewstoyou!</author>
<copyright>bysurthifm.com</copyright>
<moreinfohref="http://www.suruthifm.com"></moreinfo>
<refhref="http://91.121.136.197:9210"/>
*<paramname="type"value="audio/mpeg"/>*
</entry>
</asx>



The stream URI is good and plays in the JW FLV Media Player once you give it a type.

JW Player

User  
0 rated :

@kLink - how do you catch those headers?

JW Player

User  
0 rated :

aha - ok, thank you ! - (this is all i know of wget yet) - *http://en.wikipedia.org/wiki/Wget*

JW Player

User  
0 rated :

wget is an incredibly useful tool for analyzing and downloading. Look at the docs a bit.

JW Player

User  
0 rated :


Please help me....
I am using fm radio streams in my flash player, whenever playing this fm radio streams , its filling in my system virtual memory. for Ex : I am using one off the streams
http://scfire-ntc-aa01.stream.aol.com:80/stream/1017

How to solve this problem please guide me

thanks

JW Player

User  
0 rated :

Some external streaming urls working from my server, some streams urls not working , what is the reason ?I am using as3 flash 9player. external urls like this http://38.96.174.38:9568 this is not working .

Please let me know.

thanks

JW Player

User  
0 rated :

This is a known issue with some Shoutcast/Icecast/Nicecast streams in some browsers using Flash-based players..

JW Player

User  
0 rated :

I am working with shoutcast listen.pls and acc format
not good results yet :(

JW Player

User  
0 rated :

Any progress? Same issue working with a listen.pls and the latest JWPlayer

JW Player

User  
0 rated :

Most Shoutcast/Icesact/Nicecast streams work well in the JW FLV Player *_the exception being AAC+/AAC(HE)_* which will probably never work because of the extra headers.

The JW FLV Player cannot utilize m3u/pls playlists.

See: *http://developer.longtailvideo.com/trac/wiki/FlashFormats#XMLPlaylists* for the supported Playlist formats.

JW Player

User  
0 rated :

from the [url=http://www.jeroenwijering.com/extras/readme.html]readme[/url]:

[i]*shownavigation *(true,false): Another flashvar *only* for the *rotator*. It enables/disables the navigation bar.

*displaywidth* (number of pixels): *Instead* of the "*displayheight*", you can set "displaywidth" to a size smaller that the SWF width to make the playlist appear at the *right side *of the display.

*linkfromdisplay* (true,false): You can set this flashvar to "*true*" to make a click on the image/video display to result in a jump to the "link" webpage. By *default*, a click on the display will *play/pause *the movie.

*useaudio* (true,false): Set this to false to force the *additional audiotrack* to mute by default.

*type* (*mp3,flv,rtmp,jpg,png,gif,swf,rbs,3gp,mp4,m4v*): The players determine the type of file to play based upon the last three characters of the "file" flashvar. This method doesn't work if you use database id's or mod_rewrite to retrieve the files. Therefore you can set this flashvar to *tell* the players of *which filetype *the file you want to play is. The type is also assigned to every item in a playlist. If no match is found, the player assumes it loads a playlist.

*usecaptions* (true,false): Set this to false to force the captions to hide by default.

*usefullscreen* (true,false): Set this flashvar to false if you don't want to use the flash9 *fullscreen* functionality. If you added a "fsbuttonlink" flashvar as well, this link will become the default action for the fullscreen page[/i]

JW Player

User  
0 rated :


@andersen,

wget -S "http://91.121.136.197:9210"

CTRL-C after a few seconds, then open the downloaded file in a text editor.

This question has received the maximum number of answers.