Re: AutoPlay:true in jPlayerAudioPlaylists - help needed

1,650 views
Skip to first unread message

Mark Panaghiston

unread,
Jun 11, 2012, 8:47:38 AM6/11/12
to jpl...@googlegroups.com
Your options have the incorrect structure. They should look more like:

{
playlistOptions: {
autoPlay: true,
enableRemoveControls: true
},
swfPath: "/js",
supplied: "mp3, oga"
}

Reference:

http://www.jplayer.org/latest/demo-02-jPlayerPlaylist/

autoPlay : Boolean : Will auto-play when instanced on the page, and when a new playlist is given using setPlaylist(). Remember that mobile devices require a gesture before anything will play. Recommend leaving this as false initially... And change it later if you want when changing the playlist through a user gesture. eg., They clicked on a link to change the playlist and your click handler changes autoPlay to true before you setPlaylist().



On Monday, 11 June 2012 10:00:57 UTC+1, Markus Mairinger wrote:
Hi,

don't know if this group is still alive, but I managed to install an ajax powered audio player including the playlist feature into my dev system. The only thing which does not work out is
the autoPlay option for the playlist. Is this a known issue, or can someone give me an advice?

Here is the code I already have:

$(document).ready(function(){
    var fileID = getURLParameter('file');

    var cssSelector = {
        jPlayer: "#jquery_jplayer_1",
        cssSelectorAncestor: "#jp_container_1"
    };
   
    var playlist = []; // Empty playlist
    var options = {
        autoPlay: true,
        swfPath: "js",
        supplied: "mp3",
        wmode: "window",
        shuffleTime: "slow",
        addTime: "slow",
        removeTime: "slow",
    };
   
    var myPlaylist = new jPlayerPlaylist(cssSelector, playlist, options);
    $.getJSON("....the json delivering php file by handed over fileID ....", function(data){  // get the JSON array produced by my PHP
        $.each(data,function(index,value){
            myPlaylist.add(value); // add each element in data in myPlaylist
        })
    });
       $("#jquery_jplayer_1").jPlayer("play");
});


Anyone knows the trick?
Regards,
Markus

Reply all
Reply to author
Forward
0 new messages