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

Problems playing m3u or pls in jwplayer


Hi there!

i have a new problem with my lovely jwplayer^^

i'm trying to get some online radios played in jwplayer.

so i read much articles from google and found this plugins for the jwplayer to support m3u and pls
http://www.pa-s.de/php/codeschnipsel-Extended-M3U-Plugin-for-Flash-MP3-Player-43.php

http://www.pa-s.de/php/codeschnipsel-PLS-Plugin-for-Flash-MP3-Player-50.php

So i took the plugin code, added the url into the array and set the player up like followed:(example with the m3u plugin).


[code]
function playRadio(){
jwplayer("footer_player").setup({

flashplayer: "player/player.swf",
skin: "player/fs40/fs40.xml",
file: 'em3uplugin.php?m3u=1',
type: 'sound',
height: '45',
width: '100%',
autostart: true,
controlbar: 'bottom'

});
[/code]

and in the plugin code i just changed the playlist array like followed:

[code]
$playlist = array(
'1' => 'http://www.radio21.de/cms/fileadmin/playlist/radio21.m3u'
);

[/code]

the rest of the plugin code is like in the link on top.

You can see the example page here:
http://betreutes-wohnen-am-sternplatz.de/play2/sender.php

when clicking on the "klick" link afther the "181.FM - The Eagler nr.1" in the webradio channel the player starts.
it really seems like it would play the radio (the pause button appears insted of the play button).

can anyone help me?

best regards from germany
simon

13 Community Answers

JW Player

User  
0 rated :

sorry for the wrong code tags. maybe a mod can change it.

JW Player

User  
0 rated :

I figured out the problem. The scripts were correct but the player throws the error with the "cross domain restrictions".

Is there any workaround to avoid the error and play those streams???

This would be great because i just found one radio which was working without the problem.

Ethan Feldman

JW Player Support Agent  
0 rated :

Glad you figured it out. Can you show were you are using the latest code that is generating this error message?

JW Player

User  
0 rated :

I just went over to take your setup wizard
http://www.longtailvideo.com/support/jw-player-setup-wizard
go to file properties and insert the url of the stream into the file input.

if it works there, it also works in my page. but mostly i get the declared message.

If you're using for example the URL of TOP FM (http://85.214.91.242:8000/stream_hq.mp3) it's working fine.
But all other stream url's i tried were occuring the error.

For example:
http://80.237.201.22:9650/listen.pls
http://www.rockantenne.de/webradio/channels/alternative.m3u

Ethan Feldman

JW Player Support Agent  
-1 rated :

Yes, because those are ShoutCast, which we don’t support. You can set the provider to sound, and the error will go away, but the player still won’t play them.

JW Player

User  
0 rated :

Oh no... that's very sadly.

Okay so i must look for another player for the radio.

That's not very good because on my site you can search for music and play it (searched from youtube and played in the jwplayer) and you should be able to listen some online radios and i don't wanted to use different players.

Ethan Feldman

JW Player Support Agent  
-1 rated :

Sorry, we don’t really support radio streams like that.

We only support these – http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/12539/supported-video-and-audio-formats

JW Player

User  
0 rated :

Hey Ethan - there must be another way.

Take a look at this site:
http://www.muziic.com/

it uses jwplayer4 for audiostreams to receive metadata and uses jwplayer3.8 to play shoutcast.

so was it possible in earlier versions like 3.8 and where can i get this?

the relevant js code of muziic.com is

bc.. $.getJSON("api/tuneIn?id="+id, function(data) {

var channel = data['result'][0]['channel'];

if (typeof pSUPERFLY != 'undefined' && currentChannelId != id) {
pSUPERFLY.virtualPage("/radio/"+id, channel['provider']+" - "+channel['name']);
}

currentStreamUrl = channel['streamUrl'];
currentChannelId = id;

$("#currentChannel").html(channel['provider']+" - "+channel['name']);

$("#currentGenre").html('<img width="32" src="genres/'+channel['genre']+'.png">');

if (getgenre == "true") {
getGenre(channel['genre'], "", "true");
}

// if it's an Ando stream, we want to use JW 4.0 which allows us to receive METADATA updates
if (channel['streamType'] == "andomedia") {
var so = new SWFObject('swf/jwplayer-4.swf','radioplayer',1,1,'9');
var type = "flv";
} else {
// if shoutcast, use JW 3.8 so it doesn't freeze
var so = new SWFObject('swf/jwplayer-3.swf','radioplayer',1,1,'9');
var type = "mp3";
}
// onto the rest of the JW config
so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');
so.addParam('flashvars','type='+type+'&autostart=true&enablejs=true&duration=-1&file='+channel['streamUrl']);
so.addVariable("enablejs","true");
so.addVariable("javascriptid","radioplayer");
so.write("player");

if (channel['streamType'] == "shoutcast") {
player = thisMovie('radioplayer');
}

$("#playpause").attr("src", "images/pause_btn.png");

// if shoutcast, begin polling for play data.
if (channel['streamType'] == "shoutcast") {
getNowPlaying(id);
nowplayingInterval = setInterval(function(){
if (currentState == "PLAYING") {
getNowPlaying(id);
}
}, 15000);
}

});

}


Ethan Feldman

JW Player Support Agent  
0 rated :

It depends on the type of ShoutCast streams. I find that NSV files mostly work with other player, but pls and m3u do not. Do you have a NSV stream?

JW Player

User  
0 rated :

no i sadly don't have.

where can i get jwplayer 3.8 to try it with this one?

best regards from germany ;)

Ethan Feldman

JW Player Support Agent  
0 rated :

You can download all of the old versions here – http://developer.longtailvideo.com/trac/browser/tags/

JW Player

User  
0 rated :

Thanks for the link Ethan!

btw: where is your cat?! :D

so - unfortunately - i don't get the 3.8 player to work. I don't know what to do with the fla file?

I miss the js file :D

I tried to set it up with javascript and with the embeder but i get a reference error with the SWFObject (while doing new SWFObject) because SWFObject is not defined.

Is there a example code for the old one?

cheers!

Ethan Feldman

JW Player Support Agent  
0 rated :

Np! I changed it up.

Hm, well you can always use swfobject 1.5 for the older player, using the older version of the Wizard – http://www.longtailvideo.com/support/jw-player-setup-wizard-4

This question has received the maximum number of answers.