mirror of
https://github.com/videojs/video.js.git
synced 2024-12-25 02:42:10 +02:00
Fixed volume to be more accurate.
This commit is contained in:
parent
159a509962
commit
d68a142abb
@ -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; }
|
||||
|
4
video.js
4
video.js
@ -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";
|
||||
|
Loading…
Reference in New Issue
Block a user