videojs-hotkeys
Advanced tools
Comparing version 0.2.14 to 0.2.15
@@ -16,2 +16,3 @@ { | ||
"videojs", | ||
"videojs-plugin", | ||
"hotkeys", | ||
@@ -18,0 +19,0 @@ "video" |
@@ -1,3 +0,3 @@ | ||
/* 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)}); | ||
/* videojs-hotkeys v0.2.15 - 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.15"};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,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&&d<59||d>95&&d<106)&&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):d==-1&&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 |
module.exports = function(grunt) { | ||
require('time-grunt')(grunt); | ||
var baseName = 'videojs.hotkeys'; | ||
@@ -65,2 +66,19 @@ var pkg = grunt.file.readJSON('package.json'); | ||
} | ||
}, | ||
'github-release': { | ||
options: { | ||
repository: 'ctd1500/videojs-hotkeys', | ||
auth: { | ||
user: 'ctd1500', | ||
password: process.env.GITHUB_TERM | ||
}, | ||
release: { | ||
tag_name: 'v<%= pkg.version %>', | ||
name: 'Release <%= pkg.version %>', | ||
draft: true | ||
} | ||
}, | ||
files: { | ||
src: ['dist/<%= pkg.name %>-<%= pkg.version %>.zip'] | ||
} | ||
} | ||
@@ -73,2 +91,3 @@ }); | ||
grunt.loadNpmTasks('grunt-zip'); | ||
grunt.loadNpmTasks('grunt-github-releaser'); | ||
@@ -88,2 +107,5 @@ // Default task. | ||
grunt.registerTask('release', 'Create a release on github and upload zip file.', | ||
['clean', 'buildver', 'copy:build', 'uglify:dist', 'dist', 'github-release']); | ||
grunt.registerTask('cdn-link', 'Updates the CDN link in the Readme', function() { | ||
@@ -90,0 +112,0 @@ var rm = grunt.file.read('README.md'); |
{ | ||
"name": "videojs-hotkeys", | ||
"version": "0.2.14", | ||
"version": "0.2.15", | ||
"description": "Adds more hotkey support to video.js", | ||
@@ -16,2 +16,7 @@ "main": "videojs.hotkeys.min.js", | ||
"homepage": "https://github.com/ctd1500/videojs-hotkeys", | ||
"keywords": [ | ||
"videojs", | ||
"videojs-plugin", | ||
"hotkeys" | ||
], | ||
"devDependencies": { | ||
@@ -22,4 +27,6 @@ "grunt": "^0.4.5", | ||
"grunt-contrib-uglify": "^0.11.0", | ||
"grunt-zip": "^0.17.0" | ||
"grunt-github-releaser": "^0.1.18", | ||
"grunt-zip": "^0.17.0", | ||
"time-grunt": "^1.3.0" | ||
} | ||
} |
@@ -20,3 +20,3 @@ /* | ||
"use strict"; | ||
window['videojs_hotkeys'] = { version: "0.2.14" }; | ||
window['videojs_hotkeys'] = { version: "0.2.15" }; | ||
@@ -120,3 +120,2 @@ var hotkeys = function(options) { | ||
switch (checkKeys(event, player)) { | ||
// Spacebar toggles play/pause | ||
@@ -310,14 +309,14 @@ case cPlay: | ||
function playPauseKey(e) { | ||
// Space bar | ||
return (e.which === 32); | ||
// Space bar or MediaPlayPause | ||
return (e.which === 32 || e.which === 179); | ||
} | ||
function rewindKey(e) { | ||
// Left Arrow | ||
return (e.which === 37); | ||
// Left Arrow or MediaRewind | ||
return (e.which === 37 || e.which === 177); | ||
} | ||
function forwardKey(e) { | ||
// Right Arrow | ||
return (e.which === 39); | ||
// Right Arrow or MediaForward | ||
return (e.which === 39 || e.which === 176); | ||
} | ||
@@ -324,0 +323,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* 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)}); | ||
/* videojs-hotkeys v0.2.15 - 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.15"};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,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&&d<59||d>95&&d<106)&&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):d==-1&&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)}); |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
44210
456
7
1