forked from 0x2620/oxjs
make +/- volume keyboard shortcut work in video and timeline views
This commit is contained in:
parent
529184887a
commit
7d188d8621
5 changed files with 46 additions and 19 deletions
|
|
@ -191,7 +191,7 @@ Ox.VideoPlayer = function(options, self) {
|
|||
key_0: toggleMuted,
|
||||
key_1: toggleScale,
|
||||
key_equal: function() {
|
||||
changeVolumeBy(0.1);
|
||||
changeVolume(0.1);
|
||||
},
|
||||
key_escape: hideControlMenus,
|
||||
key_f: focusFind,
|
||||
|
|
@ -202,7 +202,7 @@ Ox.VideoPlayer = function(options, self) {
|
|||
setPosition(self.options.position - self.secondsPerFrame);
|
||||
},
|
||||
key_minus: function() {
|
||||
changeVolumeBy(-0.1);
|
||||
changeVolume(-0.1);
|
||||
},
|
||||
key_p: function() {
|
||||
playInToOut();
|
||||
|
|
@ -1091,7 +1091,7 @@ Ox.VideoPlayer = function(options, self) {
|
|||
self.$copyrightIcon[self.censored ? 'show' : 'hide']();
|
||||
}
|
||||
|
||||
function changeVolumeBy(num) {
|
||||
function changeVolume(num) {
|
||||
showVolume();
|
||||
self.options.volume = Ox.limit(self.options.volume + num, 0, 1);
|
||||
setVolume(self.options.volume);
|
||||
|
|
@ -2120,8 +2120,10 @@ Ox.VideoPlayer = function(options, self) {
|
|||
}
|
||||
|
||||
function showVolume() {
|
||||
!self.interfaceIsVisible && showControls();
|
||||
self.$volume && self.$volume.is(':hidden') && toggleVolume();
|
||||
if (self.$volume) {
|
||||
!self.interfaceIsVisible && showControls();
|
||||
self.$volume.is(':hidden') && toggleVolume();
|
||||
}
|
||||
}
|
||||
|
||||
function submitFindInput(value, hasPressedEnter) {
|
||||
|
|
@ -2371,6 +2373,11 @@ Ox.VideoPlayer = function(options, self) {
|
|||
}
|
||||
};
|
||||
|
||||
that.changeVolume = function(num) {
|
||||
changeVolume(num);
|
||||
return that;
|
||||
};
|
||||
|
||||
/*@
|
||||
playInToOut <f> play in to out
|
||||
() -> <o> play in to out
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue