Skip to content

Commit

Permalink
Fixed volume to be more accurate.
Browse files Browse the repository at this point in the history
  • Loading branch information
heff committed Jun 14, 2010
1 parent 159a509 commit d68a142
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions video-js.css
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ img.vjs-poster { display: block; position: absolute; left: 0px; top: 0px; width:

/* Volume */
.vjs-volume-control { width: 50px !important; cursor: pointer !important; }
.vjs-volume-control ul { display: block; margin: 0; padding: 4px 0 0 5px; list-style: none; }
.vjs-volume-control ul li { float: left; margin: 0; padding: 0; list-style: none; width: 5px; margin-right: 2px; height: 0px; border-bottom: 18px solid #555; }
.vjs-volume-control ul { display: block; margin: 0 5px 0 5px; padding: 4px 0 0 0; list-style: none; }
.vjs-volume-control ul li { float: left; margin: 0 2px 0 0; padding: 0; list-style: none; width: 5px; height: 0px; border-bottom: 18px solid #555; }
.vjs-volume-control ul li:last-child { margin-right: 0; }
.vjs-volume-control ul li:nth-child(1) { border-bottom-width: 2px; height: 16px; }
.vjs-volume-control ul li:nth-child(2) { border-bottom-width: 4px; height: 14px; }
.vjs-volume-control ul li:nth-child(3) { border-bottom-width: 7px; height: 11px; }
Expand Down
4 changes: 2 additions & 2 deletions video.js
Original file line number Diff line number Diff line change
Expand Up @@ -537,14 +537,14 @@ var VideoJS = Class.extend({
},

setVolumeWithEvent: function(event){
var newVol = this.getRelativePosition(event.pageX, this.volumeControl);
var newVol = this.getRelativePosition(event.pageX, this.volumeControl.children[0]);
this.setVolume(newVol);
},

// Update the volume control display
// Unique to these default controls. Uses borders to create the look of bars.
updateVolumeDisplay: function(){
var volNum = Math.floor(this.video.volume * 6);
var volNum = Math.ceil(this.video.volume * 6);
for(var i=0; i<6; i++) {
if (i < volNum) {
this.volumeDisplay.children[i].style.borderColor = "#fff";
Expand Down

0 comments on commit d68a142

Please sign in to comment.