Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jPlayer and Shoutcast Configuration

I am trying to set up JPlayer plugin and Shoutcast. According to their website this is possible to do.

How do I get jPlayer to play a SHOUTCast stream? You need to setMedia to the stream URL. For example, SHOUTcast server: http://mp3-vr-128.as34763.net/ MP3 stream URL: http://mp3-vr-128.as34763.net/;stream/1

I have tried to do this

<script type="text/javascript">
//<![CDATA[
$(document).ready(function(){

    $("#jquery_jplayer_1").jPlayer({
        ready: function (event) {
            $(this).jPlayer("setMedia", {
                m4a:"http://77.68.106.224:8018;stream/1",
                oga:"http://77.68.106.224:8018"
            }).jPlayer("play");
        },


        swfPath: "js",
        supplied: "m4a, oga, mp3", 
        wmode: "window"
    });
});
//]]>
</script>

I do not get any output with my settings. Is anyone using JPlayer for a shoutcast Stream, or can anyone suggest a player that doesn't need php.

like image 561
Benjamin Avatar asked Jan 09 '12 09:01

Benjamin


1 Answers

sweet vibes on this station!

You're almost there, see this fiddle to see your stream working in jPlayer.. Shoutcast outputs audio in MP3 format, not M4a or OGG.. you need constructor code more like that below..

One important thing to know is that the Flash plugin when using IE8 sometimes spends minutes buffering the audio.. You click play, think it isn't working then suddenly find your audio starts playing after three minutes.. The good news is that Chrome, Safari and Firefox play the stream almost immediately.

<script type="text/javascript">
//<![CDATA[
$(document).ready(function(){

    $("#jquery_jplayer_1").jPlayer({
        ready: function (event) {
            $(this).jPlayer("setMedia", {
                mp3:"http://77.68.106.224:8018;stream/1"
            }).jPlayer("play");
        },


        swfPath: "js",
        supplied: "mp3", 
        wmode: "window"
    });
});
//]]>
</script>
like image 153
Lloyd Avatar answered Oct 18 '22 12:10

Lloyd