Skip to content

Commit dae863e

Browse files
committed
Bug fix: Multiple gui bars now function correctly.
1 parent 3d887dc commit dae863e

File tree

2 files changed

+20
-19
lines changed

2 files changed

+20
-19
lines changed

jquery.jplayer/jquery.jplayer.js

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* - http://www.gnu.org/copyleft/gpl.html
99
*
1010
* Author: Mark J Panaghiston
11-
* Version: 2.3.8
11+
* Version: 2.3.9
1212
* Date: 30th May 2013
1313
*/
1414

@@ -469,7 +469,7 @@
469469
$.jPlayer.prototype = {
470470
count: 0, // Static Variable: Change it via prototype.
471471
version: { // Static Object
472-
script: "2.3.8",
472+
script: "2.3.9",
473473
needFlash: "2.3.5",
474474
flash: "unknown"
475475
},
@@ -1836,12 +1836,13 @@
18361836
},
18371837
volumeBar: function(e) { // Handles clicks on the volumeBar
18381838
if(this.css.jq.volumeBar.length) {
1839-
var offset = this.css.jq.volumeBar.offset(),
1839+
// Using $(e.currentTarget) to enable multiple volume bars
1840+
var $bar = $(e.currentTarget),
1841+
offset = $bar.offset(),
18401842
x = e.pageX - offset.left,
1841-
w = this.css.jq.volumeBar.width(),
1842-
y = this.css.jq.volumeBar.height() - e.pageY + offset.top,
1843-
h = this.css.jq.volumeBar.height();
1844-
1843+
w = $bar.width(),
1844+
y = $bar.height() - e.pageY + offset.top,
1845+
h = $bar.height();
18451846
if(this.options.verticalVolume) {
18461847
this.volume(y/h);
18471848
} else {
@@ -1852,9 +1853,8 @@
18521853
this._muted(false);
18531854
}
18541855
},
1855-
volumeBarValue: function(e) { // Handles clicks on the volumeBarValue
1856-
e.stopPropagation(); // Avoids duplicate call by the volumeBar parent.
1857-
this.volumeBar(e);
1856+
volumeBarValue: function() { // Handles clicks on the volumeBarValue
1857+
// The volumeBar handles this event as the event propagates up the DOM.
18581858
},
18591859
_updateVolume: function(v) {
18601860
if(v === undefined) {
@@ -1967,17 +1967,18 @@
19671967
}
19681968
},
19691969
seekBar: function(e) { // Handles clicks on the seekBar
1970-
if(this.css.jq.seekBar) {
1971-
var offset = this.css.jq.seekBar.offset();
1972-
var x = e.pageX - offset.left;
1973-
var w = this.css.jq.seekBar.width();
1974-
var p = 100*x/w;
1970+
if(this.css.jq.seekBar.length) {
1971+
// Using $(e.currentTarget) to enable multiple seek bars
1972+
var $bar = $(e.currentTarget),
1973+
offset = $bar.offset(),
1974+
x = e.pageX - offset.left,
1975+
w = $bar.width(),
1976+
p = 100 * x / w;
19751977
this.playHead(p);
19761978
}
19771979
},
1978-
playBar: function(e) { // Handles clicks on the playBar
1979-
e.stopPropagation(); // Avoids duplicate call by the seekBar parent.
1980-
this.seekBar(e);
1980+
playBar: function() { // Handles clicks on the playBar
1981+
// The seekBar handles this event as the event propagates up the DOM.
19811982
},
19821983
repeat: function() { // Handle clicks on the repeat button
19831984
this._loop(true);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jplayer",
3-
"version": "2.3.8",
3+
"version": "2.3.9",
44
"description": "The jQuery HTML5 Audio / Video Library",
55
"homepage": "http://www.jplayer.org/",
66
"keywords": [

0 commit comments

Comments
 (0)