That will teach me to try stuff out before suggesting things... I knew it worked for the other buttons, but the progress bar is a bit different. It needs to work out where you clicked on it in relation to the its placement on the page... And thinking about it now, I bet that the internal code is only looking at the first one it finds. As in, it compares your click on the 2nd progress bar in the footer with the placement of the 1st progress bar in the side stripe.
That will be a problem inside jPlayer itself and not easy to correct externally. Well, unless you do everything externally and bypass the simplified user interface association.
Current code:
seekBar: function(e) { // Handles clicks on the seekBar
if(this.css.jq.seekBar) {
var offset = this.css.jq.seekBar.offset();
var x = e.pageX - offset.left;
var w = this.css.jq.seekBar.width();
var p = 100*x/w;
this.playHead(p);
}
},
I'll need to look into that... Maybe using $(this) to get the offset of the item clicked or getting the info from the event param.
My first guess is the following
(This code is wrong btw, see discussion below.):
var offset = $(this).offset();
Which would normally return the offset of the item clicked... But erm we are already in a wrapper and
this is the jPlayer instance object in that context.
This bit of code is the wrapper:
var handler = function(e) {
self[fn](e);
$(this).blur();
return false;
};
We just need to get the event target of the event object, which is being passed through... And consider that the play bar may be the item clicked instead... Which should have the same offsets as the seek-bar... But no sensible way to distinguish which was clicked... But the playBar function could edit the event object passed to the seekbar method.
playBar: function(e) { // Handles clicks on the playBar
this.seekBar(e);
},
Sorry... I'm just thinking stuff up as I'm going along. I'm not expecting you to do any of this. I might implement it myself and this will help explain the process.
The event.target looks like the correct property:
http://api.jquery.com/event.target/So my second guess will be:
var offset = $(e.target).offset();
You can patch the change into jPlayer through the prototype. So put this into you page before you instance jPlayer.
$.jPlayer.prototype.seekBar = function(e) { // Handles clicks on the seekBar
if(this.css.jq.seekBar) {
var offset = $(e.target).offset();
var x = e.pageX - offset.left;
var w = $(e.target).width();
var p = 100*x/w;
this.playHead(p);
}
};
$.jPlayer.prototype.playBar: function(e) { // Handles clicks on the playBar
e.target = $(e.target).parent().get(0);
this.seekBar(e);
};
This does assume that the play bar is the first child of the seek bar, but I think that is pretty standard. It is in our skins at least.