0

I am currently trying to get a radio stream from ShoutCast to play with JPlayer with no success.

Ideally I would like a pls file such as this one http://yp.shoutcast.com/sbin/tunein-station.pls?id=1377246 to play with JPlayer.

Here is my current code:

<script type='text/javascript'>//<![CDATA[ 
$(function(){
$("#jquery_jplayer_1").jPlayer({
swfPath: "js/Jplayer.swf",
ready: function () {
    $(this).jPlayer("setMedia", { mp3: "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1377246" });
},
supplied: "mp3"
});


});//]]>  

</script>

Not sure whether this is possible or not but I would appreciate any support.

Thanks

Jonas
  • 121,568
  • 97
  • 310
  • 388
RyanDreggs
  • 196
  • 5
  • 16

1 Answers1

1

A .pls file is a playlist, not any kind of actual stream. Open that file up with your favorite text editor to see the URL of the actual stream.

You will have to parse this file prior to playing the audio it links to.

Brad
  • 159,648
  • 54
  • 349
  • 530
  • Thanks for the info. Do you know any easy way of getting the stream out in PHP. I feel I'm going to have to write regular expressions for this. – RyanDreggs Jun 11 '12 at 14:06
  • Just use `parse_ini_file()`... http://php.net/manual/en/function.parse-ini-file.php – Brad Jun 11 '12 at 14:18
  • how to work with .pls in android.How to parse and set data source to Media player in Android Please help me..... – Harsha Feb 12 '13 at 12:07
  • @Harsha, Please read what I have said in the answer. It's just a text file. Open it in your text editor and see. If you see cannot figure it out, post a new question. – Brad Feb 12 '13 at 14:20
  • @Hi Brad When i open the .pls file in text editor shown like this: [playlist] NumberOfEntries=1 File1=http://s7.voscast.com:7184/............like this help me – Harsha Feb 13 '13 at 09:43
  • @Harsha, Yes, that's the URL of the stream. – Brad Feb 13 '13 at 16:13