/* videojs-hotkeys v0.2.14 - 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.14"};var c=function(c){function d(a){return 32===a.which}function e(a){return 37===a.which}function f(a){return 39===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,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;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 E=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(H(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&&59>d||d>95&&106>d)&&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))}}}},F=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())}},G=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):-1==d&&k.volume(k.volume()-w)}}},H=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",E),k.on("dblclick",F),k.on("mousewheel",G),k.on("DOMMouseScroll",G),this};b.plugin("hotkeys",c)});
//# sourceMappingURL=videojs.hotkeys.min.js.map