Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

videojs-hotkeys

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

videojs-hotkeys - npm Package Compare versions

Comparing version 0.2.18 to 0.2.19

4

build/videojs.hotkeys.min.js

@@ -1,3 +0,3 @@

/* videojs-hotkeys v0.2.18 - 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.18"};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,enableInactiveFocus:!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,F=c.enableInactiveFocus;l.hasAttribute("tabIndex")||l.setAttribute("tabIndex","-1"),l.style.outline="none",!D&&k.autoplay()||k.one("play",function(){l.focus()}),F&&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 G=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(J(a,k)){case o:e(),D&&a.stopPropagation(),k.paused()?k.play():k.pause();break;case p:var g=!k.paused();e(),g&&k.pause(),b=k.currentTime()-x,k.currentTime()<=x&&(b=0),k.currentTime(b),g&&k.play();break;case q:var g=!k.paused();e(),g&&k.pause(),k.currentTime(k.currentTime()+x),g&&k.play();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 h=48;d>95&&(h=96);var i=d-h;e(),k.currentTime(k.duration()*i*.1)}for(var j in c.customKeys){var n=c.customKeys[j];n&&n.key&&n.handler&&n.key(a)&&(e(),n.handler(k,c,a))}}}},H=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())}},I=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)}}},J=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",G),k.on("dblclick",H),k.on("mousewheel",I),k.on("DOMMouseScroll",I),this};b.plugin("hotkeys",c)});
/* videojs-hotkeys v0.2.19 - https://github.com/ctd1500/videojs-hotkeys */
!function(e,t){"function"==typeof define&&define.amd?define([],t.bind(this,e,e.videojs)):"undefined"!=typeof module&&module.exports?module.exports=t(e,e.videojs):t(e,e.videojs)}(window,function(e,t){"use strict";e.videojs_hotkeys={version:"0.2.19"};t.plugin("hotkeys",function(r){var n=this,o=n.el(),u=document,l={volumeStep:.1,seekStep:5,enableMute:!0,enableVolumeScroll:!0,enableFullscreen:!0,enableNumbers:!0,enableJogStyle:!1,alwaysCaptureHotkeys:!1,enableModifiersForNumbers:!0,enableInactiveFocus:!0,skipInitialFocus:!1,playPauseKey:function(e){return 32===e.which||179===e.which},rewindKey:function(e){return 37===e.which||177===e.which},forwardKey:function(e){return 39===e.which||176===e.which},volumeUpKey:function(e){return 38===e.which},volumeDownKey:function(e){return 40===e.which},muteKey:function(e){return 77===e.which},fullscreenKey:function(e){return 70===e.which},customKeys:{}},i=t.mergeOptions||t.util.mergeOptions,a=(r=i(l,r||{})).volumeStep,c=r.seekStep,s=r.enableMute,m=r.enableVolumeScroll,y=r.enableFullscreen,v=r.enableNumbers,f=r.enableJogStyle,d=r.alwaysCaptureHotkeys,b=r.enableModifiersForNumbers,p=r.enableInactiveFocus,h=r.skipInitialFocus;o.hasAttribute("tabIndex")||o.setAttribute("tabIndex","-1"),o.style.outline="none",!d&&n.autoplay()||h||n.one("play",function(){o.focus()}),p&&n.on("userinactive",function(){var e=function(){clearTimeout(t)},t=setTimeout(function(){n.off("useractive",e),u.activeElement.parentElement==o.querySelector(".vjs-control-bar")&&o.focus()},10);n.one("useractive",e)}),n.on("play",function(){var e=o.querySelector(".iframeblocker");e&&""===e.style.display&&(e.style.display="block",e.style.bottom="39px")});var w=function(t){if(n.controls()){var r=t.relatedTarget||t.toElement||u.activeElement;if((d||r==o||r==o.querySelector(".vjs-tech")||r==o.querySelector(".iframeblocker")||r==o.querySelector(".vjs-control-bar"))&&m){t=e.event||t;var l=Math.max(-1,Math.min(1,t.wheelDelta||-t.detail));t.preventDefault(),1==l?n.volume(n.volume()+a):-1==l&&n.volume(n.volume()-a)}}},k=function(e,t){return r.playPauseKey(e,t)?1:r.rewindKey(e,t)?2:r.forwardKey(e,t)?3:r.volumeUpKey(e,t)?4:r.volumeDownKey(e,t)?5:r.muteKey(e,t)?6:r.fullscreenKey(e,t)?7:void 0};return n.on("keydown",function(e){var t,l,i=e.which,m=e.preventDefault,p=n.duration();if(n.controls()){var h=u.activeElement;if(d||h==o||h==o.querySelector(".vjs-tech")||h==o.querySelector(".vjs-control-bar")||h==o.querySelector(".iframeblocker"))switch(k(e,n)){case 1:m(),d&&e.stopPropagation(),n.paused()?n.play():n.pause();break;case 2:t=!n.paused(),m(),t&&n.pause(),l=n.currentTime()-c,n.currentTime()<=c&&(l=0),n.currentTime(l),t&&n.play();break;case 3:t=!n.paused(),m(),t&&n.pause(),(l=n.currentTime()+c)>=p&&(l=p),n.currentTime(l),t&&n.play();break;case 5:m(),f?(l=n.currentTime()-1,n.currentTime()<=1&&(l=0),n.currentTime(l)):n.volume(n.volume()-a);break;case 4:m(),f?((l=n.currentTime()+1)>=p&&(l=p),n.currentTime(l)):n.volume(n.volume()+a);break;case 6:s&&n.muted(!n.muted());break;case 7:y&&(n.isFullscreen()?n.exitFullscreen():n.requestFullscreen());break;default:if((i>47&&i<59||i>95&&i<106)&&(b||!(e.metaKey||e.ctrlKey||e.altKey))&&v){var w=48;i>95&&(w=96);var K=i-w;m(),n.currentTime(n.duration()*K*.1)}for(var S in r.customKeys){var T=r.customKeys[S];T&&T.key&&T.handler&&T.key(e)&&(m(),T.handler(n,r,e))}}}}),n.on("dblclick",function(e){if(n.controls()){var t=e.relatedTarget||e.toElement||u.activeElement;t!=o&&t!=o.querySelector(".vjs-tech")&&t!=o.querySelector(".iframeblocker")||y&&(n.isFullscreen()?n.exitFullscreen():n.requestFullscreen())}}),n.on("mousewheel",w),n.on("DOMMouseScroll",w),this})});
//# sourceMappingURL=videojs.hotkeys.min.js.map

@@ -30,3 +30,3 @@ module.exports = function(grunt) {

options: {
banner: '/* <%= pkg.name %> v<%= pkg.version %> - <%= pkg.homepage %> */\n',
banner: '/* <%= pkg.name %> v<%= pkg.version %> - <%= pkg.homepage %> */',
mangle: true,

@@ -57,19 +57,21 @@ compress: true

},
zip: {
compress: {
dist: {
router: function(filepath) {
var path = require('path');
return path.relative('dist', filepath);
options: {
archive: 'dist/<%= pkg.name %>-<%= pkg.version %>.zip',
mode: 'zip',
level: 9
},
compression: 'DEFLATE',
src: ['dist/<%= pkg.name %>/*'],
dest: 'dist/<%= pkg.name %>-<%= pkg.version %>.zip'
expand: true,
cwd: 'dist/<%= pkg.name %>',
src: '**',
dest: '<%= pkg.name %>/'
}
},
'github-release': {
github_releaser2: {
options: {
repository: 'ctd1500/videojs-hotkeys',
auth: {
user: 'ctd1500',
password: process.env.GITHUB_TERM
authentication: {
type: 'token',
token: process.env.GITHUB_TERM
},

@@ -82,3 +84,3 @@ release: {

},
files: {
release: {
src: ['dist/<%= pkg.name %>-<%= pkg.version %>.zip']

@@ -92,4 +94,4 @@ }

grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-zip');
grunt.loadNpmTasks('grunt-github-releaser');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.loadNpmTasks('grunt-github-releaser2');

@@ -107,6 +109,6 @@ // Default task.

grunt.registerTask('dist', 'Creates distribution files', ['copy:dist', 'zip:dist']);
grunt.registerTask('dist', 'Creates distribution files', ['copy:dist', 'compress:dist']);
grunt.registerTask('release', 'Create a release on github and upload zip file.',
['clean', 'buildver', 'copy:build', 'uglify:dist', 'dist', 'github-release']);
['clean', 'buildver', 'copy:build', 'uglify:dist', 'dist', 'github_releaser2']);

@@ -113,0 +115,0 @@ grunt.registerTask('cdn-link', 'Updates the CDN link in the Readme', function() {

{
"name": "videojs-hotkeys",
"version": "0.2.18",
"version": "0.2.19",
"description": "Adds more hotkey support to video.js",

@@ -22,10 +22,10 @@ "main": "videojs.hotkeys.min.js",

"devDependencies": {
"grunt": "^0.4.5",
"grunt-contrib-clean": "^0.7.0",
"grunt-contrib-copy": "^0.8.0",
"grunt-contrib-uglify": "^0.11.0",
"grunt-github-releaser": "^0.1.18",
"grunt-zip": "^0.17.0",
"time-grunt": "^1.3.0"
"grunt": "^1.0.1",
"grunt-contrib-clean": "^1.1.0",
"grunt-contrib-compress": "^1.4.3",
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-uglify": "^3.0.1",
"grunt-github-releaser2": "^0.1.1",
"time-grunt": "^1.4.0"
}
}

@@ -83,2 +83,3 @@ videojs-hotkeys

- `enableInactiveFocus` (boolean): This reassigns focus to the player when the control bar fades out after a user has clicked a button on the control bar (default: `true`)
- `skipInitialFocus` (boolean): This stops focusing the player on initial Play under unique autoplay situations. More information in [Issue #44](https://github.com/ctd1500/videojs-hotkeys/issues/44) (default: `false`)
- `enableJogStyle` (boolean): Enables seeking the video in a broadcast-style jog by pressing the Up and Down Arrow keys.

@@ -85,0 +86,0 @@ `seekStep` will also need to be changed to get a proper broadcast-style jog.

@@ -20,3 +20,3 @@ /*

"use strict";
window['videojs_hotkeys'] = { version: "0.2.18" };
window['videojs_hotkeys'] = { version: "0.2.19" };

@@ -38,2 +38,3 @@ var hotkeys = function(options) {

enableInactiveFocus: true,
skipInitialFocus: false,
playPauseKey: playPauseKey,

@@ -70,3 +71,4 @@ rewindKey: rewindKey,

enableModifiersForNumbers = options.enableModifiersForNumbers,
enableInactiveFocus = options.enableInactiveFocus;
enableInactiveFocus = options.enableInactiveFocus,
skipInitialFocus = options.skipInitialFocus;

@@ -82,5 +84,7 @@ // Set default player tabindex to handle keydown and doubleclick events

if (alwaysCaptureHotkeys || !player.autoplay()) {
player.one('play', function() {
pEl.focus(); // Fixes the .vjs-big-play-button handing focus back to body instead of the player
});
if (!skipInitialFocus) {
player.one('play', function() {
pEl.focus(); // Fixes the .vjs-big-play-button handing focus back to body instead of the player
});
}
}

@@ -115,4 +119,5 @@

var keyDown = function keyDown(event) {
var ewhich = event.which, curTime;
var ewhich = event.which, wasPlaying, seekTime;
var ePreventDefault = event.preventDefault;
var duration = player.duration();
// When controls are disabled, hotkeys will be disabled as well

@@ -147,3 +152,3 @@ if (player.controls()) {

case cRewind: // Seek Backward
var wasPlaying = !player.paused();
wasPlaying = !player.paused();
ePreventDefault();

@@ -153,9 +158,9 @@ if (wasPlaying) {

}
curTime = player.currentTime() - seekStep;
seekTime = player.currentTime() - seekStep;
// The flash player tech will allow you to seek into negative
// numbers and break the seekbar, so try to prevent that.
if (player.currentTime() <= seekStep) {
curTime = 0;
seekTime = 0;
}
player.currentTime(curTime);
player.currentTime(seekTime);
if (wasPlaying) {

@@ -166,3 +171,3 @@ player.play();

case cForward: // Seek Forward
var wasPlaying = !player.paused();
wasPlaying = !player.paused();
ePreventDefault();

@@ -172,3 +177,9 @@ if (wasPlaying) {

}
player.currentTime(player.currentTime() + seekStep);
seekTime = player.currentTime() + seekStep;
// Fixes the player not sending the end event if you
// try to seek past the duration on the seekbar.
if (seekTime >= duration) {
seekTime = duration;
}
player.currentTime(seekTime);
if (wasPlaying) {

@@ -185,7 +196,7 @@ player.play();

} else {
curTime = player.currentTime() - 1;
seekTime = player.currentTime() - 1;
if (player.currentTime() <= 1) {
curTime = 0;
seekTime = 0;
}
player.currentTime(curTime);
player.currentTime(seekTime);
}

@@ -198,3 +209,7 @@ break;

} else {
player.currentTime(player.currentTime() + 1);
seekTime = player.currentTime() + 1;
if (seekTime >= duration) {
seekTime = duration;
}
player.currentTime(seekTime);
}

@@ -201,0 +216,0 @@ break;

@@ -1,2 +0,2 @@

/* videojs-hotkeys v0.2.18 - 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.18"};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,enableInactiveFocus:!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,F=c.enableInactiveFocus;l.hasAttribute("tabIndex")||l.setAttribute("tabIndex","-1"),l.style.outline="none",!D&&k.autoplay()||k.one("play",function(){l.focus()}),F&&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 G=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(J(a,k)){case o:e(),D&&a.stopPropagation(),k.paused()?k.play():k.pause();break;case p:var g=!k.paused();e(),g&&k.pause(),b=k.currentTime()-x,k.currentTime()<=x&&(b=0),k.currentTime(b),g&&k.play();break;case q:var g=!k.paused();e(),g&&k.pause(),k.currentTime(k.currentTime()+x),g&&k.play();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 h=48;d>95&&(h=96);var i=d-h;e(),k.currentTime(k.duration()*i*.1)}for(var j in c.customKeys){var n=c.customKeys[j];n&&n.key&&n.handler&&n.key(a)&&(e(),n.handler(k,c,a))}}}},H=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())}},I=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)}}},J=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",G),k.on("dblclick",H),k.on("mousewheel",I),k.on("DOMMouseScroll",I),this};b.plugin("hotkeys",c)});
/* videojs-hotkeys v0.2.19 - https://github.com/ctd1500/videojs-hotkeys */
!function(e,t){"function"==typeof define&&define.amd?define([],t.bind(this,e,e.videojs)):"undefined"!=typeof module&&module.exports?module.exports=t(e,e.videojs):t(e,e.videojs)}(window,function(e,t){"use strict";e.videojs_hotkeys={version:"0.2.19"};t.plugin("hotkeys",function(r){var n=this,o=n.el(),u=document,l={volumeStep:.1,seekStep:5,enableMute:!0,enableVolumeScroll:!0,enableFullscreen:!0,enableNumbers:!0,enableJogStyle:!1,alwaysCaptureHotkeys:!1,enableModifiersForNumbers:!0,enableInactiveFocus:!0,skipInitialFocus:!1,playPauseKey:function(e){return 32===e.which||179===e.which},rewindKey:function(e){return 37===e.which||177===e.which},forwardKey:function(e){return 39===e.which||176===e.which},volumeUpKey:function(e){return 38===e.which},volumeDownKey:function(e){return 40===e.which},muteKey:function(e){return 77===e.which},fullscreenKey:function(e){return 70===e.which},customKeys:{}},i=t.mergeOptions||t.util.mergeOptions,a=(r=i(l,r||{})).volumeStep,c=r.seekStep,s=r.enableMute,m=r.enableVolumeScroll,y=r.enableFullscreen,v=r.enableNumbers,f=r.enableJogStyle,d=r.alwaysCaptureHotkeys,b=r.enableModifiersForNumbers,p=r.enableInactiveFocus,h=r.skipInitialFocus;o.hasAttribute("tabIndex")||o.setAttribute("tabIndex","-1"),o.style.outline="none",!d&&n.autoplay()||h||n.one("play",function(){o.focus()}),p&&n.on("userinactive",function(){var e=function(){clearTimeout(t)},t=setTimeout(function(){n.off("useractive",e),u.activeElement.parentElement==o.querySelector(".vjs-control-bar")&&o.focus()},10);n.one("useractive",e)}),n.on("play",function(){var e=o.querySelector(".iframeblocker");e&&""===e.style.display&&(e.style.display="block",e.style.bottom="39px")});var w=function(t){if(n.controls()){var r=t.relatedTarget||t.toElement||u.activeElement;if((d||r==o||r==o.querySelector(".vjs-tech")||r==o.querySelector(".iframeblocker")||r==o.querySelector(".vjs-control-bar"))&&m){t=e.event||t;var l=Math.max(-1,Math.min(1,t.wheelDelta||-t.detail));t.preventDefault(),1==l?n.volume(n.volume()+a):-1==l&&n.volume(n.volume()-a)}}},k=function(e,t){return r.playPauseKey(e,t)?1:r.rewindKey(e,t)?2:r.forwardKey(e,t)?3:r.volumeUpKey(e,t)?4:r.volumeDownKey(e,t)?5:r.muteKey(e,t)?6:r.fullscreenKey(e,t)?7:void 0};return n.on("keydown",function(e){var t,l,i=e.which,m=e.preventDefault,p=n.duration();if(n.controls()){var h=u.activeElement;if(d||h==o||h==o.querySelector(".vjs-tech")||h==o.querySelector(".vjs-control-bar")||h==o.querySelector(".iframeblocker"))switch(k(e,n)){case 1:m(),d&&e.stopPropagation(),n.paused()?n.play():n.pause();break;case 2:t=!n.paused(),m(),t&&n.pause(),l=n.currentTime()-c,n.currentTime()<=c&&(l=0),n.currentTime(l),t&&n.play();break;case 3:t=!n.paused(),m(),t&&n.pause(),(l=n.currentTime()+c)>=p&&(l=p),n.currentTime(l),t&&n.play();break;case 5:m(),f?(l=n.currentTime()-1,n.currentTime()<=1&&(l=0),n.currentTime(l)):n.volume(n.volume()-a);break;case 4:m(),f?((l=n.currentTime()+1)>=p&&(l=p),n.currentTime(l)):n.volume(n.volume()+a);break;case 6:s&&n.muted(!n.muted());break;case 7:y&&(n.isFullscreen()?n.exitFullscreen():n.requestFullscreen());break;default:if((i>47&&i<59||i>95&&i<106)&&(b||!(e.metaKey||e.ctrlKey||e.altKey))&&v){var w=48;i>95&&(w=96);var K=i-w;m(),n.currentTime(n.duration()*K*.1)}for(var S in r.customKeys){var T=r.customKeys[S];T&&T.key&&T.handler&&T.key(e)&&(m(),T.handler(n,r,e))}}}}),n.on("dblclick",function(e){if(n.controls()){var t=e.relatedTarget||e.toElement||u.activeElement;t!=o&&t!=o.querySelector(".vjs-tech")&&t!=o.querySelector(".iframeblocker")||y&&(n.isFullscreen()?n.exitFullscreen():n.requestFullscreen())}}),n.on("mousewheel",w),n.on("DOMMouseScroll",w),this})});

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc