Make Autoplay on of jQuery Circle Player

3,068 views
Skip to first unread message

Sanjeev

unread,
Jan 3, 2012, 2:45:27 AM1/3/12
to jPlayer: HTML5 Audio & Video for jQuery
The Javascript function

<script type="text/javascript">

$(document).ready(function() {
var myCirclePlayer = new CirclePlayer("#jquery_jplayer_1",
{
mp3:"mp3/brobob.mp3"

}, {
cssSelectorAncestor: "#cp_container_1",
swfPath: "js/",
wmode: "window",
solution: "html,flash"

});
});
</script>


Change following line in circle.player.js

//supplied: "m4a, oga",
to
supplied: "mp3",

and go to following function in circle.player.js and change to

CirclePlayer.prototype = {
_createHtml: function() {
},
_initPlayer: function() {
var self = this;
this.player.jPlayer(this.options);

this.player.bind($.jPlayer.event.ready + this.eventNamespace,
function(event) {
if(event.jPlayer.html.used && event.jPlayer.html.audio.available) {
self.audio = $(this).data("jPlayer").htmlElement.audio;
}
//$(this).jPlayer("setMedia", self.media); // Makes Player
Autoplay off -
$(this).jPlayer("setMedia", self.media).jPlayer('play'); // To
make Autoplay on -
self._initCircleControl();
});

also go to following function in circle.player.js and change to

setMedia: function(media) {
this.media = $.extend({}, media);
//this.player.jPlayer("setMedia", this.media); // Makes Player
Autoplay off -
this.player.jPlayer("setMedia", this.media).jPlayer('play'); // To
make Autoplay on -
},

After two days of hard work it worked on almost every
browser(IE,Chrome,Firefox)(safari not tested) for all types of audio
file, just change to supplied: "m4a, oga", according to your file
format. Good luck.

marvette

unread,
Feb 8, 2012, 1:50:07 PM2/8/12
to jpl...@googlegroups.com
Hi Guys,
 
I can't get AUTOPLAY it to work. Can anyone help me in the right direction?
 
<script type="text/javascript">
//<![CDATA[
$(document).ready(function(){
 $("#jquery_jplayer_1").jPlayer({
  ready: function () {
   $(this).jPlayer("setMedia", {
    mp3:"http://server-09.stream-server.nl:8532/;listen.pls"
   });
  },
  swfPath: "js",
  supplied: "mp3",
  wmode: "window"
 });
});
//]]>
</script>
 
 
Yvette

Dustin Blake

unread,
Feb 9, 2012, 8:53:50 AM2/9/12
to jpl...@googlegroups.com
<script type="text/javascript">
//<![CDATA[
$(document).ready(function(){
 $("#jquery_jplayer_1").jPlayer({
  ready: function () {
   $(this).jPlayer("setMedia", {
    mp3:"http://server-09.stream-server.nl:8532/;listen.pls"
   }).jPlayer("play");

Guillaume De Smedt

unread,
Apr 21, 2012, 12:05:50 PM4/21/12
to jpl...@googlegroups.com
Thanks Dustin, that works perfectly,

Now I need it to autoplay, AS WELL AS, loop the music. what is the code for that?

D8n

unread,
May 29, 2012, 7:47:18 AM5/29/12
to jpl...@googlegroups.com
I found the autoplay answer here: http://stackoverflow.com/questions/7808956/how-can-i-make-circle-jplayer-autoplay

BASICALLY you add the canplay function to your code as shown below:

$(document).ready(function(){                            
var myCirclePlayer = new CirclePlayer("#jquery_jplayer_1",
{

    m4a
: "http://www.jplayer.org/audio/m4a/Miaow-07-Bubble.m4a",
    oga
: "http://www.jplayer.org/audio/ogg/Miaow-07-Bubble.ogg"
}, {
    cssSelectorAncestor
: "#cp_container_1",
    canplay
: function() {
    $
("
#jquery_jplayer_1").jPlayer("play");
   
}

})  

});


Az Mandius

unread,
Apr 19, 2013, 8:03:22 AM4/19/13
to jpl...@googlegroups.com, sanjeev...@gmail.com
Thank you a lot friend, your solution worked for me.

вторник, 3 января 2012 г., 9:45:27 UTC+2 пользователь Sanjeev написал:
Reply all
Reply to author
Forward
0 new messages