videojs-hotkeys
Advanced tools
Comparing version 0.2.16 to 0.2.17
@@ -1,3 +0,3 @@ | ||
/* videojs-hotkeys v0.2.16 - https://github.com/ctd1500/videojs-hotkeys */ | ||
!function(a,b){"function"==typeof define&&define.amd?define([],b.bind(this,a,a.videojs)):"undefined"!=typeof module&&module.exports?module.exports=b(a,a.videojs):b(a,a.videojs)}(window,function(a,b){"use strict";a.videojs_hotkeys={version:"0.2.16"};var c=function(c){function d(a){return 32===a.which||179===a.which}function e(a){return 37===a.which||177===a.which}function f(a){return 39===a.which||176===a.which}function g(a){return 38===a.which}function h(a){return 40===a.which}function i(a){return 77===a.which}function j(a){return 70===a.which}var k=this,l=k.el(),m=document,n={volumeStep:.1,seekStep:5,enableMute:!0,enableVolumeScroll:!0,enableFullscreen:!0,enableNumbers:!0,enableJogStyle:!1,alwaysCaptureHotkeys:!1,enableModifiersForNumbers:!0,playPauseKey:d,rewindKey:e,forwardKey:f,volumeUpKey:g,volumeDownKey:h,muteKey:i,fullscreenKey:j,customKeys:{}},o=1,p=2,q=3,r=4,s=5,t=6,u=7,v=b.mergeOptions||b.util.mergeOptions;c=v(n,c||{});var w=c.volumeStep,x=c.seekStep,y=c.enableMute,z=c.enableVolumeScroll,A=c.enableFullscreen,B=c.enableNumbers,C=c.enableJogStyle,D=c.alwaysCaptureHotkeys,E=c.enableModifiersForNumbers;l.hasAttribute("tabIndex")||l.setAttribute("tabIndex","-1"),l.style.outline="none",!D&&k.autoplay()||k.one("play",function(){l.focus()}),k.on("userinactive",function(){var a=function(){clearTimeout(b)},b=setTimeout(function(){k.off("useractive",a),m.activeElement.parentElement==l.querySelector(".vjs-control-bar")&&l.focus()},10);k.one("useractive",a)}),k.on("play",function(){var a=l.querySelector(".iframeblocker");a&&""===a.style.display&&(a.style.display="block",a.style.bottom="39px")});var F=function(a){var b,d=a.which,e=a.preventDefault;if(k.controls()){var f=m.activeElement;if(D||f==l||f==l.querySelector(".vjs-tech")||f==l.querySelector(".vjs-control-bar")||f==l.querySelector(".iframeblocker"))switch(I(a,k)){case o:e(),D&&a.stopPropagation(),k.paused()?k.play():k.pause();break;case p:e(),b=k.currentTime()-x,k.currentTime()<=x&&(b=0),k.currentTime(b);break;case q:e(),k.currentTime(k.currentTime()+x);break;case s:e(),C?(b=k.currentTime()-1,k.currentTime()<=1&&(b=0),k.currentTime(b)):k.volume(k.volume()-w);break;case r:e(),C?k.currentTime(k.currentTime()+1):k.volume(k.volume()+w);break;case t:y&&k.muted(!k.muted());break;case u:A&&(k.isFullscreen()?k.exitFullscreen():k.requestFullscreen());break;default:if((d>47&&d<59||d>95&&d<106)&&(E||!(a.metaKey||a.ctrlKey||a.altKey))&&B){var g=48;d>95&&(g=96);var h=d-g;e(),k.currentTime(k.duration()*h*.1)}for(var i in c.customKeys){var j=c.customKeys[i];j&&j.key&&j.handler&&j.key(a)&&(e(),j.handler(k,c))}}}},G=function(a){if(k.controls()){var b=a.relatedTarget||a.toElement||m.activeElement;b!=l&&b!=l.querySelector(".vjs-tech")&&b!=l.querySelector(".iframeblocker")||A&&(k.isFullscreen()?k.exitFullscreen():k.requestFullscreen())}},H=function(b){if(k.controls()){var c=b.relatedTarget||b.toElement||m.activeElement;if((D||c==l||c==l.querySelector(".vjs-tech")||c==l.querySelector(".iframeblocker")||c==l.querySelector(".vjs-control-bar"))&&z){b=a.event||b;var d=Math.max(-1,Math.min(1,b.wheelDelta||-b.detail));b.preventDefault(),1==d?k.volume(k.volume()+w):d==-1&&k.volume(k.volume()-w)}}},I=function(a,b){return c.playPauseKey(a,b)?o:c.rewindKey(a,b)?p:c.forwardKey(a,b)?q:c.volumeUpKey(a,b)?r:c.volumeDownKey(a,b)?s:c.muteKey(a,b)?t:c.fullscreenKey(a,b)?u:void 0};return k.on("keydown",F),k.on("dblclick",G),k.on("mousewheel",H),k.on("DOMMouseScroll",H),this};b.plugin("hotkeys",c)}); | ||
/* videojs-hotkeys v0.2.17 - https://github.com/ctd1500/videojs-hotkeys */ | ||
!function(a,b){"function"==typeof define&&define.amd?define([],b.bind(this,a,a.videojs)):"undefined"!=typeof module&&module.exports?module.exports=b(a,a.videojs):b(a,a.videojs)}(window,function(a,b){"use strict";a.videojs_hotkeys={version:"0.2.17"};var c=function(c){function d(a){return 32===a.which||179===a.which}function e(a){return 37===a.which||177===a.which}function f(a){return 39===a.which||176===a.which}function g(a){return 38===a.which}function h(a){return 40===a.which}function i(a){return 77===a.which}function j(a){return 70===a.which}var k=this,l=k.el(),m=document,n={volumeStep:.1,seekStep:5,enableMute:!0,enableVolumeScroll:!0,enableFullscreen:!0,enableNumbers:!0,enableJogStyle:!1,alwaysCaptureHotkeys:!1,enableModifiersForNumbers:!0,playPauseKey:d,rewindKey:e,forwardKey:f,volumeUpKey:g,volumeDownKey:h,muteKey:i,fullscreenKey:j,customKeys:{}},o=1,p=2,q=3,r=4,s=5,t=6,u=7,v=b.mergeOptions||b.util.mergeOptions;c=v(n,c||{});var w=c.volumeStep,x=c.seekStep,y=c.enableMute,z=c.enableVolumeScroll,A=c.enableFullscreen,B=c.enableNumbers,C=c.enableJogStyle,D=c.alwaysCaptureHotkeys,E=c.enableModifiersForNumbers;l.hasAttribute("tabIndex")||l.setAttribute("tabIndex","-1"),l.style.outline="none",!D&&k.autoplay()||k.one("play",function(){l.focus()}),k.on("userinactive",function(){var a=function(){clearTimeout(b)},b=setTimeout(function(){k.off("useractive",a),m.activeElement.parentElement==l.querySelector(".vjs-control-bar")&&l.focus()},10);k.one("useractive",a)}),k.on("play",function(){var a=l.querySelector(".iframeblocker");a&&""===a.style.display&&(a.style.display="block",a.style.bottom="39px")});var F=function(a){var b,d=a.which,e=a.preventDefault;if(k.controls()){var f=m.activeElement;if(D||f==l||f==l.querySelector(".vjs-tech")||f==l.querySelector(".vjs-control-bar")||f==l.querySelector(".iframeblocker"))switch(I(a,k)){case o:e(),D&&a.stopPropagation(),k.paused()?k.play():k.pause();break;case p:e(),b=k.currentTime()-x,k.currentTime()<=x&&(b=0),k.currentTime(b);break;case q:e(),k.currentTime(k.currentTime()+x);break;case s:e(),C?(b=k.currentTime()-1,k.currentTime()<=1&&(b=0),k.currentTime(b)):k.volume(k.volume()-w);break;case r:e(),C?k.currentTime(k.currentTime()+1):k.volume(k.volume()+w);break;case t:y&&k.muted(!k.muted());break;case u:A&&(k.isFullscreen()?k.exitFullscreen():k.requestFullscreen());break;default:if((d>47&&d<59||d>95&&d<106)&&(E||!(a.metaKey||a.ctrlKey||a.altKey))&&B){var g=48;d>95&&(g=96);var h=d-g;e(),k.currentTime(k.duration()*h*.1)}for(var i in c.customKeys){var j=c.customKeys[i];j&&j.key&&j.handler&&j.key(a)&&(e(),j.handler(k,c,a))}}}},G=function(a){if(k.controls()){var b=a.relatedTarget||a.toElement||m.activeElement;b!=l&&b!=l.querySelector(".vjs-tech")&&b!=l.querySelector(".iframeblocker")||A&&(k.isFullscreen()?k.exitFullscreen():k.requestFullscreen())}},H=function(b){if(k.controls()){var c=b.relatedTarget||b.toElement||m.activeElement;if((D||c==l||c==l.querySelector(".vjs-tech")||c==l.querySelector(".iframeblocker")||c==l.querySelector(".vjs-control-bar"))&&z){b=a.event||b;var d=Math.max(-1,Math.min(1,b.wheelDelta||-b.detail));b.preventDefault(),1==d?k.volume(k.volume()+w):d==-1&&k.volume(k.volume()-w)}}},I=function(a,b){return c.playPauseKey(a,b)?o:c.rewindKey(a,b)?p:c.forwardKey(a,b)?q:c.volumeUpKey(a,b)?r:c.volumeDownKey(a,b)?s:c.muteKey(a,b)?t:c.fullscreenKey(a,b)?u:void 0};return k.on("keydown",F),k.on("dblclick",G),k.on("mousewheel",H),k.on("DOMMouseScroll",H),this};b.plugin("hotkeys",c)}); | ||
//# sourceMappingURL=videojs.hotkeys.min.js.map |
{ | ||
"name": "videojs-hotkeys", | ||
"version": "0.2.16", | ||
"version": "0.2.17", | ||
"description": "Adds more hotkey support to video.js", | ||
@@ -5,0 +5,0 @@ "main": "videojs.hotkeys.min.js", |
@@ -65,3 +65,4 @@ videojs-hotkeys | ||
volumeStep: 0.1, | ||
seekStep: 5 | ||
seekStep: 5, | ||
enableModifiersForNumbers: false | ||
}); | ||
@@ -79,2 +80,3 @@ }); | ||
- `enableNumbers` (boolean): Enables seeking the video by pressing the number keys (default `true`) | ||
- `enableModifiersForNumbers` (boolean): Enables the use of Ctrl/Alt/Cmd + Number keys for skipping around in the video, instead of switching browser tabs. This is enabled by default due to backwards compatibility [PR #35](https://github.com/ctd1500/videojs-hotkeys/pull/35) (default: `true`) | ||
- `alwaysCaptureHotkeys` (boolean): Forces the capture of hotkeys, even when control elements are focused. | ||
@@ -135,7 +137,7 @@ The **Enter**/**Return** key may be used instead to activate the control elements (default: `false`) | ||
ctrldKey: { | ||
key: function(e) { | ||
key: function(event) { | ||
// Toggle something with CTRL + D Key | ||
return (e.ctrlKey && e.which === 68); | ||
return (event.ctrlKey && event.which === 68); | ||
}, | ||
handler: function(player, options) { | ||
handler: function(player, options, event) { | ||
// Using mute as an example | ||
@@ -142,0 +144,0 @@ if (options.enableMute) { |
@@ -20,3 +20,3 @@ /* | ||
"use strict"; | ||
window['videojs_hotkeys'] = { version: "0.2.16" }; | ||
window['videojs_hotkeys'] = { version: "0.2.17" }; | ||
@@ -218,3 +218,3 @@ var hotkeys = function(options) { | ||
ePreventDefault(); | ||
customHotkey.handler(player, options); | ||
customHotkey.handler(player, options, event); | ||
} | ||
@@ -221,0 +221,0 @@ } |
@@ -1,2 +0,2 @@ | ||
/* videojs-hotkeys v0.2.16 - https://github.com/ctd1500/videojs-hotkeys */ | ||
!function(a,b){"function"==typeof define&&define.amd?define([],b.bind(this,a,a.videojs)):"undefined"!=typeof module&&module.exports?module.exports=b(a,a.videojs):b(a,a.videojs)}(window,function(a,b){"use strict";a.videojs_hotkeys={version:"0.2.16"};var c=function(c){function d(a){return 32===a.which||179===a.which}function e(a){return 37===a.which||177===a.which}function f(a){return 39===a.which||176===a.which}function g(a){return 38===a.which}function h(a){return 40===a.which}function i(a){return 77===a.which}function j(a){return 70===a.which}var k=this,l=k.el(),m=document,n={volumeStep:.1,seekStep:5,enableMute:!0,enableVolumeScroll:!0,enableFullscreen:!0,enableNumbers:!0,enableJogStyle:!1,alwaysCaptureHotkeys:!1,enableModifiersForNumbers:!0,playPauseKey:d,rewindKey:e,forwardKey:f,volumeUpKey:g,volumeDownKey:h,muteKey:i,fullscreenKey:j,customKeys:{}},o=1,p=2,q=3,r=4,s=5,t=6,u=7,v=b.mergeOptions||b.util.mergeOptions;c=v(n,c||{});var w=c.volumeStep,x=c.seekStep,y=c.enableMute,z=c.enableVolumeScroll,A=c.enableFullscreen,B=c.enableNumbers,C=c.enableJogStyle,D=c.alwaysCaptureHotkeys,E=c.enableModifiersForNumbers;l.hasAttribute("tabIndex")||l.setAttribute("tabIndex","-1"),l.style.outline="none",!D&&k.autoplay()||k.one("play",function(){l.focus()}),k.on("userinactive",function(){var a=function(){clearTimeout(b)},b=setTimeout(function(){k.off("useractive",a),m.activeElement.parentElement==l.querySelector(".vjs-control-bar")&&l.focus()},10);k.one("useractive",a)}),k.on("play",function(){var a=l.querySelector(".iframeblocker");a&&""===a.style.display&&(a.style.display="block",a.style.bottom="39px")});var F=function(a){var b,d=a.which,e=a.preventDefault;if(k.controls()){var f=m.activeElement;if(D||f==l||f==l.querySelector(".vjs-tech")||f==l.querySelector(".vjs-control-bar")||f==l.querySelector(".iframeblocker"))switch(I(a,k)){case o:e(),D&&a.stopPropagation(),k.paused()?k.play():k.pause();break;case p:e(),b=k.currentTime()-x,k.currentTime()<=x&&(b=0),k.currentTime(b);break;case q:e(),k.currentTime(k.currentTime()+x);break;case s:e(),C?(b=k.currentTime()-1,k.currentTime()<=1&&(b=0),k.currentTime(b)):k.volume(k.volume()-w);break;case r:e(),C?k.currentTime(k.currentTime()+1):k.volume(k.volume()+w);break;case t:y&&k.muted(!k.muted());break;case u:A&&(k.isFullscreen()?k.exitFullscreen():k.requestFullscreen());break;default:if((d>47&&d<59||d>95&&d<106)&&(E||!(a.metaKey||a.ctrlKey||a.altKey))&&B){var g=48;d>95&&(g=96);var h=d-g;e(),k.currentTime(k.duration()*h*.1)}for(var i in c.customKeys){var j=c.customKeys[i];j&&j.key&&j.handler&&j.key(a)&&(e(),j.handler(k,c))}}}},G=function(a){if(k.controls()){var b=a.relatedTarget||a.toElement||m.activeElement;b!=l&&b!=l.querySelector(".vjs-tech")&&b!=l.querySelector(".iframeblocker")||A&&(k.isFullscreen()?k.exitFullscreen():k.requestFullscreen())}},H=function(b){if(k.controls()){var c=b.relatedTarget||b.toElement||m.activeElement;if((D||c==l||c==l.querySelector(".vjs-tech")||c==l.querySelector(".iframeblocker")||c==l.querySelector(".vjs-control-bar"))&&z){b=a.event||b;var d=Math.max(-1,Math.min(1,b.wheelDelta||-b.detail));b.preventDefault(),1==d?k.volume(k.volume()+w):d==-1&&k.volume(k.volume()-w)}}},I=function(a,b){return c.playPauseKey(a,b)?o:c.rewindKey(a,b)?p:c.forwardKey(a,b)?q:c.volumeUpKey(a,b)?r:c.volumeDownKey(a,b)?s:c.muteKey(a,b)?t:c.fullscreenKey(a,b)?u:void 0};return k.on("keydown",F),k.on("dblclick",G),k.on("mousewheel",H),k.on("DOMMouseScroll",H),this};b.plugin("hotkeys",c)}); | ||
/* videojs-hotkeys v0.2.17 - https://github.com/ctd1500/videojs-hotkeys */ | ||
!function(a,b){"function"==typeof define&&define.amd?define([],b.bind(this,a,a.videojs)):"undefined"!=typeof module&&module.exports?module.exports=b(a,a.videojs):b(a,a.videojs)}(window,function(a,b){"use strict";a.videojs_hotkeys={version:"0.2.17"};var c=function(c){function d(a){return 32===a.which||179===a.which}function e(a){return 37===a.which||177===a.which}function f(a){return 39===a.which||176===a.which}function g(a){return 38===a.which}function h(a){return 40===a.which}function i(a){return 77===a.which}function j(a){return 70===a.which}var k=this,l=k.el(),m=document,n={volumeStep:.1,seekStep:5,enableMute:!0,enableVolumeScroll:!0,enableFullscreen:!0,enableNumbers:!0,enableJogStyle:!1,alwaysCaptureHotkeys:!1,enableModifiersForNumbers:!0,playPauseKey:d,rewindKey:e,forwardKey:f,volumeUpKey:g,volumeDownKey:h,muteKey:i,fullscreenKey:j,customKeys:{}},o=1,p=2,q=3,r=4,s=5,t=6,u=7,v=b.mergeOptions||b.util.mergeOptions;c=v(n,c||{});var w=c.volumeStep,x=c.seekStep,y=c.enableMute,z=c.enableVolumeScroll,A=c.enableFullscreen,B=c.enableNumbers,C=c.enableJogStyle,D=c.alwaysCaptureHotkeys,E=c.enableModifiersForNumbers;l.hasAttribute("tabIndex")||l.setAttribute("tabIndex","-1"),l.style.outline="none",!D&&k.autoplay()||k.one("play",function(){l.focus()}),k.on("userinactive",function(){var a=function(){clearTimeout(b)},b=setTimeout(function(){k.off("useractive",a),m.activeElement.parentElement==l.querySelector(".vjs-control-bar")&&l.focus()},10);k.one("useractive",a)}),k.on("play",function(){var a=l.querySelector(".iframeblocker");a&&""===a.style.display&&(a.style.display="block",a.style.bottom="39px")});var F=function(a){var b,d=a.which,e=a.preventDefault;if(k.controls()){var f=m.activeElement;if(D||f==l||f==l.querySelector(".vjs-tech")||f==l.querySelector(".vjs-control-bar")||f==l.querySelector(".iframeblocker"))switch(I(a,k)){case o:e(),D&&a.stopPropagation(),k.paused()?k.play():k.pause();break;case p:e(),b=k.currentTime()-x,k.currentTime()<=x&&(b=0),k.currentTime(b);break;case q:e(),k.currentTime(k.currentTime()+x);break;case s:e(),C?(b=k.currentTime()-1,k.currentTime()<=1&&(b=0),k.currentTime(b)):k.volume(k.volume()-w);break;case r:e(),C?k.currentTime(k.currentTime()+1):k.volume(k.volume()+w);break;case t:y&&k.muted(!k.muted());break;case u:A&&(k.isFullscreen()?k.exitFullscreen():k.requestFullscreen());break;default:if((d>47&&d<59||d>95&&d<106)&&(E||!(a.metaKey||a.ctrlKey||a.altKey))&&B){var g=48;d>95&&(g=96);var h=d-g;e(),k.currentTime(k.duration()*h*.1)}for(var i in c.customKeys){var j=c.customKeys[i];j&&j.key&&j.handler&&j.key(a)&&(e(),j.handler(k,c,a))}}}},G=function(a){if(k.controls()){var b=a.relatedTarget||a.toElement||m.activeElement;b!=l&&b!=l.querySelector(".vjs-tech")&&b!=l.querySelector(".iframeblocker")||A&&(k.isFullscreen()?k.exitFullscreen():k.requestFullscreen())}},H=function(b){if(k.controls()){var c=b.relatedTarget||b.toElement||m.activeElement;if((D||c==l||c==l.querySelector(".vjs-tech")||c==l.querySelector(".iframeblocker")||c==l.querySelector(".vjs-control-bar"))&&z){b=a.event||b;var d=Math.max(-1,Math.min(1,b.wheelDelta||-b.detail));b.preventDefault(),1==d?k.volume(k.volume()+w):d==-1&&k.volume(k.volume()-w)}}},I=function(a,b){return c.playPauseKey(a,b)?o:c.rewindKey(a,b)?p:c.forwardKey(a,b)?q:c.volumeUpKey(a,b)?r:c.volumeDownKey(a,b)?s:c.muteKey(a,b)?t:c.fullscreenKey(a,b)?u:void 0};return k.on("keydown",F),k.on("dblclick",G),k.on("mousewheel",H),k.on("DOMMouseScroll",H),this};b.plugin("hotkeys",c)}); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
46073
151