j1-template 2024.3.15 → 2024.3.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets/data/amplitude.html +7 -7
- data/assets/data/panel.html +4 -3
- data/assets/theme/j1/adapter/js/amplitude.js +100 -81
- data/assets/theme/j1/adapter/js/masonry.js +2 -2
- data/assets/theme/j1/adapter/js/videojs.js +212 -0
- data/assets/theme/j1/core/css/themes/unolight/bootstrap.css +7 -4
- data/assets/theme/j1/core/css/themes/unolight/bootstrap.css.map +1 -1
- data/assets/theme/j1/core/css/themes/unolight/bootstrap.min.css +1 -1
- data/assets/theme/j1/core/css/themes/unolight/bootstrap.min.css.map +1 -1
- data/assets/theme/j1/core/js/template.js +4 -0
- data/assets/theme/j1/core/js/template.min.js +2 -2
- data/assets/theme/j1/core/js/template.min.js.map +1 -1
- data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/amplitude.css +81 -1
- data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/amplitude.min.css +1 -1
- data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/player/compact.css +3 -2
- data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/player/compact.min.css +1 -1
- data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/player/large.css +19 -4
- data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/player/large.min.css +1 -1
- data/assets/theme/j1/modules/amplitudejs/icons/player/dark/artist.svg +78 -0
- data/assets/theme/j1/modules/amplitudejs/icons/player/dark/mute.svg +52 -20
- data/assets/theme/j1/modules/amplitudejs/icons/player/dark/next.svg +20 -39
- data/assets/theme/j1/modules/amplitudejs/icons/player/dark/now-playing.svg +24 -38
- data/assets/theme/j1/modules/amplitudejs/icons/player/dark/playlist-hide.svg +85 -0
- data/assets/theme/j1/modules/amplitudejs/icons/player/dark/playlist-music.svg +85 -0
- data/assets/theme/j1/modules/amplitudejs/icons/player/dark/playlist-show.svg +85 -0
- data/assets/theme/j1/modules/amplitudejs/icons/player/dark/playlist.svg +85 -0
- data/assets/theme/j1/modules/amplitudejs/icons/player/dark/previous.svg +18 -37
- data/assets/theme/j1/modules/amplitudejs/icons/player/dark/skip-backward.svg +33 -30
- data/assets/theme/j1/modules/amplitudejs/icons/player/dark/skip-forward.svg +33 -29
- data/assets/theme/j1/modules/amplitudejs/icons/player/dark/small/next.svg +55 -14
- data/assets/theme/j1/modules/amplitudejs/icons/player/dark/small/previous.svg +56 -14
- data/assets/theme/j1/modules/amplitudejs/icons/player/dark/volume.svg +38 -21
- data/assets/theme/j1/modules/amplitudejs/js/amplitude.map +20 -20
- data/assets/theme/j1/modules/amplitudejs/js/tech/youtube_example.js +211 -0
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-video.js +206 -122
- data/assets/theme/j1/modules/videojs/assets/icons/custom-icons/next.svg +82 -0
- data/assets/theme/j1/modules/videojs/css/font/README.md +151 -0
- data/assets/theme/j1/modules/videojs/css/font/VideoJS.svg +150 -0
- data/assets/theme/j1/modules/videojs/css/font/video-js-cdn.css +2012 -0
- data/assets/theme/j1/modules/videojs/css/plugins/controls/skipbuttons.0.css +32 -0
- data/assets/theme/j1/modules/videojs/css/plugins/controls/skipbuttons.1.css +31 -0
- data/assets/theme/j1/modules/videojs/css/plugins/controls/skipbuttons.css +31 -0
- data/assets/theme/j1/modules/videojs/css/plugins/controls/skipbuttons.min.css +21 -0
- data/assets/theme/j1/modules/videojs/css/themes/uno.css +14 -3
- data/assets/theme/j1/modules/videojs/css/themes/uno.min.css +1 -1
- data/assets/theme/j1/modules/videojs/css/videojs.css +1 -0
- data/assets/theme/j1/modules/videojs/js/plugins/controls/autocaption/LICENSE +13 -0
- data/assets/theme/j1/modules/videojs/js/plugins/controls/autocaption/README.md +75 -0
- data/assets/theme/j1/modules/videojs/js/plugins/controls/autocaption/autocaption.js +149 -0
- data/assets/theme/j1/modules/videojs/js/plugins/controls/autocaption/autocaption.min.js +21 -0
- data/assets/theme/j1/modules/videojs/js/plugins/controls/hotkeys/README.md +76 -30
- data/assets/theme/j1/modules/videojs/js/plugins/controls/hotkeys/hotkeys.js +64 -53
- data/assets/theme/j1/modules/videojs/js/plugins/controls/hotkeys/hotkeys.min.js +1 -1
- data/assets/theme/j1/modules/videojs/js/plugins/controls/skipbuttons/README.md +133 -0
- data/assets/theme/j1/modules/videojs/js/plugins/controls/skipbuttons/skipbuttons.js +137 -0
- data/assets/theme/j1/modules/videojs/js/plugins/controls/skipbuttons/skipbuttons.min.js +21 -0
- data/assets/theme/j1/modules/videojs/js/plugins/controls/zoom/zoom.js +15 -12
- data/assets/theme/j1/modules/videojs/js/plugins/players/yt/youtube.js +43 -16
- data/lib/j1/patches/rubygems/eventmachine-1.2.7-x64-mingw32/lib/3.3/fastfilereaderext.so +0 -0
- data/lib/j1/patches/rubygems/eventmachine-1.2.7-x64-mingw32/lib/3.3/rubyeventmachine.so +0 -0
- data/lib/j1/patches/rubygems/eventmachine-1.2.7-x64-mingw32/lib/3.4/fastfilereaderext.so +0 -0
- data/lib/j1/patches/rubygems/eventmachine-1.2.7-x64-mingw32/lib/3.4/rubyeventmachine.so +0 -0
- data/lib/j1/version.rb +1 -1
- data/lib/j1_app/j1_auth_manager/config.rb +0 -4
- data/lib/starter_web/Gemfile +45 -22
- data/lib/starter_web/README.md +5 -5
- data/lib/starter_web/_config.yml +4 -6
- data/lib/starter_web/_data/modules/amplitude.yml +9 -399
- data/lib/starter_web/_data/modules/defaults/gallery.yml +42 -0
- data/lib/starter_web/_data/modules/defaults/videojs.yml +107 -0
- data/lib/starter_web/_data/modules/gallery.yml +30 -14
- data/lib/starter_web/_data/modules/masonry.yml +15 -0
- data/lib/starter_web/_data/modules/videojs.yml +57 -0
- data/lib/starter_web/_data/resources.yml +9 -27
- data/lib/starter_web/_data/templates/feed.xml +1 -1
- data/lib/starter_web/_includes/tables/jekyll_variables.asciidoc +1 -0
- data/lib/starter_web/_plugins/asciidoctor/dailymotion-block.rb +4 -1
- data/lib/starter_web/_plugins/asciidoctor/videojs-block.rb +145 -24
- data/lib/starter_web/_plugins/asciidoctor/vimeo-block.rb +4 -1
- data/lib/starter_web/_plugins/asciidoctor/wistia-block.rb +313 -0
- data/lib/starter_web/_plugins/asciidoctor/youtube-block.rb +192 -17
- data/lib/starter_web/_plugins/index/lunr.rb +1 -1
- data/lib/starter_web/package.json +1 -1
- data/lib/starter_web/pages/public/amplitude_yt_tester.adoc +20 -7
- data/lib/starter_web/pages/public/manuals/integrations/amplitudejs/amplitudejs-api.adoc +1 -1
- data/lib/starter_web/pages/public/manuals/integrations/videojs/youtube-api.adoc +1638 -0
- data/lib/starter_web/pages/public/tools/previewer/preview_bootstrap_theme.adoc +5 -6
- data/lib/starter_web/pages/public/tools/previewer/preview_videojs.adoc +203 -0
- data/lib/starter_web/pages/{tour → public/tour}/play_audio.adoc +3 -10
- data/lib/starter_web/pages/{tour → public/tour}/play_video.adoc +49 -40
- metadata +61 -41
- data/assets/theme/j1/modules/amplitudejs/icons/player/dark/_pause.svg +0 -19
- data/assets/theme/j1/modules/amplitudejs/icons/player/dark/_play.svg +0 -18
- data/assets/theme/j1/modules/amplitudejs/icons/player/dark/show-playlist.svg +0 -15
- data/assets/theme/j1/modules/jqueryScrollbar/LICENSE +0 -20
- data/assets/theme/j1/modules/jqueryScrollbar/README.md +0 -28
- data/assets/theme/j1/modules/jqueryScrollbar/css/scrollbar.css +0 -939
- data/assets/theme/j1/modules/jqueryScrollbar/css/scrollbar.min.css +0 -20
- data/assets/theme/j1/modules/jqueryScrollbar/js/scrollbar.js +0 -851
- data/assets/theme/j1/modules/jqueryScrollbar/js/scrollbar.min.js +0 -36
- data/assets/theme/j1/modules/jqueryScrollbar/sass/scrollbar.scss +0 -806
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-video.0.js +0 -794
- /data/lib/starter_web/pages/{tour → public/tour}/_includes/attributes.asciidoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/100_gistblock.asciidoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/410_bottom_info.asciidoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/410_bottom_left_warning.asciidoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/410_bottom_right_danger.asciidoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/410_central_success.asciidoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/410_full_height_left_info.asciidoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/410_full_height_right_success.asciidoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/410_table_bs_modal_examples.asciidoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/410_top_info.asciidoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/410_top_left_info.asciidoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/410_top_right_success.asciidoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/419_advanced_modals_demo.asciidoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/tables/bs_modal_examples.asciidoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/themes_bootstrap.asciidoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/_includes/documents/themes_rouge.asciidoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/asciidoc_extensions.adoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/bootstrap_themes.adoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/highlghter_rouge.adoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/icon_fonts.adoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/modal_extentions.adoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/present_images.adoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/quicksearch.adoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/responsive_tables.adoc +0 -0
- /data/lib/starter_web/pages/{tour → public/tour}/typography.adoc +0 -0
@@ -38,69 +38,76 @@
|
|
38
38
|
module.exports = factory(videojs.default || videojs);
|
39
39
|
}
|
40
40
|
}(this, function (videojs) {
|
41
|
-
|
41
|
+
'use strict';
|
42
|
+
|
43
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
44
|
+
|
45
|
+
var videojs__default = /*#__PURE__*/_interopDefaultLegacy(videojs);
|
46
|
+
|
42
47
|
if (typeof window !== 'undefined') {
|
43
48
|
window['videojs_hotkeys'] = { version: "0.2.28" };
|
44
49
|
}
|
45
50
|
|
46
|
-
var
|
47
|
-
var player
|
48
|
-
var pEl
|
49
|
-
var doc
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
51
|
+
var hotKeys = function(options) {
|
52
|
+
var player = this;
|
53
|
+
var pEl = player.el();
|
54
|
+
var doc = document;
|
55
|
+
|
56
|
+
var default_settings = {
|
57
|
+
enabled: false,
|
58
|
+
seekStep: 5,
|
59
|
+
volumeStep: 0.1,
|
60
|
+
enableMute: true,
|
61
|
+
enableVolumeScroll: true,
|
62
|
+
enableHoverScroll: false,
|
63
|
+
enableFullscreen: true,
|
64
|
+
enableNumbers: true,
|
65
|
+
enableJogStyle: false,
|
66
|
+
alwaysCaptureHotkeys: false,
|
67
|
+
captureDocumentHotkeys: false,
|
68
|
+
hotkeysFocusElementFilter: function () { return false },
|
69
|
+
enableModifiersForNumbers: false,
|
70
|
+
enableInactiveFocus: true,
|
71
|
+
skipInitialFocus: false,
|
72
|
+
playPauseKey: playPauseKey,
|
73
|
+
rewindKey: rewindKey,
|
74
|
+
forwardKey: forwardKey,
|
75
|
+
volumeUpKey: volumeUpKey,
|
76
|
+
volumeDownKey: volumeDownKey,
|
77
|
+
muteKey: muteKey,
|
78
|
+
fullscreenKey: fullscreenKey,
|
79
|
+
customKeys: {}
|
73
80
|
};
|
74
81
|
|
75
|
-
var cPlay
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
+
var cPlay = 1,
|
83
|
+
cRewind = 2,
|
84
|
+
cForward = 3,
|
85
|
+
cVolumeUp = 4,
|
86
|
+
cVolumeDown = 5,
|
87
|
+
cMute = 6,
|
88
|
+
cFullscreen = 7;
|
82
89
|
|
83
90
|
// Use built-in merge function from Video.js v5.0+ or v4.4.0+
|
84
91
|
// videojs.mergeOptions is deprecated in V8 and will be removed in V9
|
85
92
|
// var mergeOptions = videojs.mergeOptions || videojs.obj.merge;
|
86
93
|
var mergeOptions = (videojs.VERSION <= "7.10.0") ? videojs.mergeOptions : videojs.obj.merge;
|
87
94
|
|
88
|
-
options = mergeOptions(
|
89
|
-
|
90
|
-
var volumeStep
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
95
|
+
options = mergeOptions(default_settings, options || {});
|
96
|
+
|
97
|
+
var volumeStep = options.volumeStep,
|
98
|
+
seekStep = options.seekStep,
|
99
|
+
enableMute = options.enableMute,
|
100
|
+
enableVolumeScroll = options.enableVolumeScroll,
|
101
|
+
enableHoverScroll = options.enableHoverScroll,
|
102
|
+
enableFull = options.enableFullscreen,
|
103
|
+
enableNumbers = options.enableNumbers,
|
104
|
+
enableJogStyle = options.enableJogStyle,
|
105
|
+
alwaysCaptureHotkeys = options.alwaysCaptureHotkeys,
|
106
|
+
captureDocumentHotkeys = options.captureDocumentHotkeys,
|
107
|
+
hotkeysFocusElementFilter = options.hotkeysFocusElementFilter,
|
108
|
+
enableModifiersForNumbers = options.enableModifiersForNumbers,
|
109
|
+
enableInactiveFocus = options.enableInactiveFocus,
|
110
|
+
skipInitialFocus = options.skipInitialFocus;
|
104
111
|
|
105
112
|
// var videojsVer = videojs.VERSION;
|
106
113
|
|
@@ -159,7 +166,7 @@
|
|
159
166
|
var activeEl = doc.activeElement;
|
160
167
|
if (
|
161
168
|
alwaysCaptureHotkeys ||
|
162
|
-
(captureDocumentHotkeys &&
|
169
|
+
(captureDocumentHotkeys && hotkeysFocusElementFilter(activeEl)) ||
|
163
170
|
|
164
171
|
activeEl == pEl ||
|
165
172
|
activeEl == pEl.querySelector('.vjs-tech') ||
|
@@ -464,5 +471,9 @@
|
|
464
471
|
};
|
465
472
|
|
466
473
|
var registerPlugin = videojs.registerPlugin || videojs.plugin;
|
467
|
-
|
474
|
+
|
475
|
+
// register plugin
|
476
|
+
//
|
477
|
+
registerPlugin('hotKeys', hotKeys);
|
478
|
+
|
468
479
|
}));
|
@@ -26,4 +26,4 @@
|
|
26
26
|
* Licensed under the Apache-2.0 license.
|
27
27
|
*/
|
28
28
|
|
29
|
-
!function(e,n){if("undefined"!=typeof window&&window.videojs)n(window.videojs);else if("function"==typeof define&&define.amd)define("videojs-hotkeys",["video.js"],
|
29
|
+
!function(e,n){if("undefined"!=typeof window&&window.videojs)n(window.videojs);else if("function"==typeof define&&define.amd)define("videojs-hotkeys",["video.js"],function(e){return n(e.default||e)});else if("undefined"!=typeof module&&module.exports){var t=require("video.js");module.exports=n(t.default||t)}}(0,function(e){"use strict";"undefined"!=typeof window&&(window.videojs_hotkeys={version:"0.2.28"});(e.registerPlugin||e.plugin)("hotKeys",function(n){var t=this,o=t.el(),r=document,u={enabled:!1,volumeStep:.1,seekStep:5,enableMute:!0,enableVolumeScroll:!0,enableHoverScroll:!1,enableFullscreen:!0,enableNumbers:!0,enableJogStyle:!1,alwaysCaptureHotkeys:!1,captureDocumentHotkeys:!1,documentHotkeysFocusElementFilter:function(){return!1},enableModifiersForNumbers:!1,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:{}},l=e.VERSION<="7.10.0"?e.mergeOptions:e.obj.merge,i=(n=l(u,n||{})).volumeStep,c=n.seekStep,a=n.enableMute,s=n.enableVolumeScroll,m=n.enableHoverScroll,f=n.enableFullscreen,y=n.enableNumbers,v=n.enableJogStyle,d=n.alwaysCaptureHotkeys,p=n.captureDocumentHotkeys,b=n.documentHotkeysFocusElementFilter,h=n.enableModifiersForNumbers,w=n.enableInactiveFocus,k=n.skipInitialFocus;o.hasAttribute("tabIndex")||o.setAttribute("tabIndex","-1"),o.style.outline="none",!d&&t.autoplay()||k||t.one("play",function(){o.focus()}),w&&t.on("userinactive",function(){var e=function(){clearTimeout(n)},n=setTimeout(function(){t.off("useractive",e);var n=r.activeElement,u=o.querySelector(".vjs-control-bar");n&&n.parentElement==u&&o.focus()},10);t.one("useractive",e)}),t.on("play",function(){var e=o.querySelector(".iframeblocker");e&&""===e.style.display&&(e.style.display="block",e.style.bottom="39px")});var S=function(e){var u,l,c=e.which,s=e.preventDefault.bind(e),m=t.duration();if(t.controls()){var w=r.activeElement;if(d||p&&b(w)||w==o||w==o.querySelector(".vjs-tech")||w==o.querySelector(".vjs-control-bar")||w==o.querySelector(".iframeblocker"))switch(q(e,t)){case 1:s(),(d||p)&&e.stopPropagation(),t.paused()?T(t.play()):t.pause();break;case 2:u=!t.paused(),s(),u&&t.pause(),(l=t.currentTime()-E(e))<=0&&(l=0),t.currentTime(l),u&&T(t.play());break;case 3:u=!t.paused(),s(),u&&t.pause(),(l=t.currentTime()+E(e))>=m&&(l=u?m-.001:m),t.currentTime(l),u&&T(t.play());break;case 5:s(),v?(l=t.currentTime()-1,t.currentTime()<=1&&(l=0),t.currentTime(l)):t.volume(t.volume()-i);break;case 4:s(),v?((l=t.currentTime()+1)>=m&&(l=m),t.currentTime(l)):t.volume(t.volume()+i);break;case 6:a&&t.muted(!t.muted());break;case 7:f&&(t.isFullscreen()?t.exitFullscreen():t.requestFullscreen());break;default:if((c>47&&c<59||c>95&&c<106)&&(h||!(e.metaKey||e.ctrlKey||e.altKey))&&y){var k=48;c>95&&(k=96);var S=c-k;s(),t.currentTime(t.duration()*S*.1)}for(var K in n.customKeys){var F=n.customKeys[K];F&&F.key&&F.handler&&F.key(e)&&(s(),F.handler(t,n,e))}}}},K=!1,F=o.querySelector(".vjs-volume-menu-button")||o.querySelector(".vjs-volume-panel");null!=F&&(F.onmouseover=function(){K=!0},F.onmouseout=function(){K=!1});var j=function(e){if(m)var n=0;else n=r.activeElement;if(t.controls()&&(d||n==o||n==o.querySelector(".vjs-tech")||n==o.querySelector(".iframeblocker")||n==o.querySelector(".vjs-control-bar")||K)&&s){e=window.event||e;var u=Math.max(-1,Math.min(1,e.wheelDelta||-e.detail));e.preventDefault(),1==u?t.volume(t.volume()+i):-1==u&&t.volume(t.volume()-i)}},q=function(e,t){return n.playPauseKey(e,t)?1:n.rewindKey(e,t)?2:n.forwardKey(e,t)?3:n.volumeUpKey(e,t)?4:n.volumeDownKey(e,t)?5:n.muteKey(e,t)?6:n.fullscreenKey(e,t)?7:void 0};function E(e){return"function"==typeof c?c(e):c}function T(e){null!=e&&"function"==typeof e.then&&e.then(null,function(e){})}if(p){var g=function(e){S(e)};document.addEventListener("keydown",g),this.dispose=function(){document.removeEventListener("keydown",g)}}else t.on("keydown",S);return t.on("dblclick",function(n){if(null!=e.VERSION&&e.VERSION<="7.1.0"&&t.controls()){var u=n.relatedTarget||n.toElement||r.activeElement;u!=o&&u!=o.querySelector(".vjs-tech")&&u!=o.querySelector(".iframeblocker")||f&&(t.isFullscreen()?t.exitFullscreen():t.requestFullscreen())}}),t.on("mousewheel",j),t.on("DOMMouseScroll",j),this})});
|
@@ -0,0 +1,133 @@
|
|
1
|
+
# videojs-seek-buttons
|
2
|
+
|
3
|
+
Plugin for video.js to add seek buttons to the control bar. These buttons allow the user to skip forward or back by a configured number of seconds.
|
4
|
+
|
5
|
+
## Table of Contents
|
6
|
+
|
7
|
+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
8
|
+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
9
|
+
|
10
|
+
|
11
|
+
- [Installation](#installation)
|
12
|
+
- [Options](#options)
|
13
|
+
- [Control position](#control-position)
|
14
|
+
- [Usage](#usage)
|
15
|
+
- [`<script>` Tag](#script-tag)
|
16
|
+
- [Browserify/CommonJS](#browserifycommonjs)
|
17
|
+
- [RequireJS/AMD](#requirejsamd)
|
18
|
+
- [License](#license)
|
19
|
+
|
20
|
+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
21
|
+
## Installation
|
22
|
+
|
23
|
+
Version 3.x requires video.js version 6.x or 7.x to be installed as a peer dependency (latest v7 is recommended).
|
24
|
+
|
25
|
+
```sh
|
26
|
+
npm install videojs-seek-buttons@latest7
|
27
|
+
```
|
28
|
+
|
29
|
+
Version 4.x requires video.js version 8.x to be installed as a peer dependency. Earlier versions of Video.js are not supported.
|
30
|
+
|
31
|
+
```sh
|
32
|
+
npm install videojs-seek-buttons@latest8
|
33
|
+
```
|
34
|
+
|
35
|
+
However Video.js 8.2.0 + has a [built-in seek buttons functionality](https://videojs.com/guides/options/#skipbuttons). Consider using that instead of this plugin.
|
36
|
+
|
37
|
+
## Options
|
38
|
+
|
39
|
+
- `forward` - if a number greater than 0, a seek forward button will be added which seeks that number of seconds
|
40
|
+
- `back` - if a number greater than 0, a seek back button will be added which seeks that number of seconds
|
41
|
+
- `forwardIndex` - the position in the control bar to insert the button. Defaults to `1`. See note below.
|
42
|
+
- `backIndex` - the position in the control bar to insert the button. Defaults to `1`. See note below.
|
43
|
+
|
44
|
+
### Control position
|
45
|
+
|
46
|
+
`forwardIndex` and `backIndex` set the posiiton of the button in the control bar. Note if both a back and forward button are used, the forward button is inserted first.
|
47
|
+
|
48
|
+
Assuming the standard control bar, the play button is at index `0`. With the default index of `1` for both, the forward button is inserted after the play button, then the back button is inserted after the play button and before the forward button. Setting `backIndex` to `0` would place the back button before the play button instead, so they surround the play button.
|
49
|
+
|
50
|
+
## Usage
|
51
|
+
|
52
|
+
To include videojs-seek-buttons on your website or web application, use any of the following methods to include the script.
|
53
|
+
|
54
|
+
You also need to include the plugin's CSS.
|
55
|
+
|
56
|
+
### `<script>` Tag
|
57
|
+
|
58
|
+
This is the simplest case. Get the script in whatever way you prefer and include the plugin _after_ you include [video.js][videojs], so that the `videojs` global is available.
|
59
|
+
|
60
|
+
```html
|
61
|
+
<link rel="stylesheet" href="//path/to/video-js.css">
|
62
|
+
<link rel="stylesheet" href="//path/to/videojs-seek-buttons.css">
|
63
|
+
<script src="//path/to/video.min.js"></script>
|
64
|
+
<script src="//path/to/videojs-seek-buttons.min.js"></script>
|
65
|
+
<script>
|
66
|
+
var player = videojs('my-video');
|
67
|
+
|
68
|
+
player.seekButtons({
|
69
|
+
forward: 30,
|
70
|
+
back: 10
|
71
|
+
});
|
72
|
+
|
73
|
+
|
74
|
+
// You could alternatively include the plugin in the setup options, e.g.
|
75
|
+
// var player = videojs('my-video', {
|
76
|
+
// plugins: {
|
77
|
+
// seekButtons: {
|
78
|
+
// forward: 30,
|
79
|
+
// back: 10
|
80
|
+
// }
|
81
|
+
// }
|
82
|
+
// });
|
83
|
+
|
84
|
+
</script>
|
85
|
+
```
|
86
|
+
|
87
|
+
The dist versions will be available from services which host npm packages such as jsdelivr:
|
88
|
+
|
89
|
+
* https://cdn.jsdelivr.net/npm/videojs-seek-buttons/dist/videojs-seek-buttons.min.js
|
90
|
+
* https://cdn.jsdelivr.net/npm/videojs-seek-buttons/dist/videojs-seek-buttons.css
|
91
|
+
|
92
|
+
### Browserify/CommonJS
|
93
|
+
|
94
|
+
When using with Browserify, install videojs-seek-buttons via npm and `require` the plugin as you would any other module.
|
95
|
+
Make sure if using React to also `include "videojs-seek-buttons/dist/videojs-seek-buttons.css"`, otherwise the icons will not appear in the control bar.
|
96
|
+
|
97
|
+
```js
|
98
|
+
var videojs = require('video.js');
|
99
|
+
|
100
|
+
// The actual plugin function is exported by this module, but it is also
|
101
|
+
// attached to the `Player.prototype`; so, there is no need to assign it
|
102
|
+
// to a variable.
|
103
|
+
require('videojs-seek-buttons');
|
104
|
+
|
105
|
+
var player = videojs('my-video');
|
106
|
+
|
107
|
+
player.seekButtons({
|
108
|
+
forward: 30,
|
109
|
+
back: 10
|
110
|
+
});
|
111
|
+
```
|
112
|
+
|
113
|
+
### RequireJS/AMD
|
114
|
+
|
115
|
+
When using with RequireJS (or another AMD library), get the script in whatever way you prefer and `require` the plugin as you normally would:
|
116
|
+
|
117
|
+
```js
|
118
|
+
require(['video.js', 'videojs-seek-buttons'], function(videojs) {
|
119
|
+
var player = videojs('my-video');
|
120
|
+
|
121
|
+
player.seekButtons({
|
122
|
+
forward: 30,
|
123
|
+
back: 10
|
124
|
+
});
|
125
|
+
});
|
126
|
+
```
|
127
|
+
|
128
|
+
## License
|
129
|
+
|
130
|
+
Apache-2.0. Copyright (c) mister-ben <git@misterben.me>
|
131
|
+
|
132
|
+
|
133
|
+
[videojs]: http://videojs.com/
|
@@ -0,0 +1,137 @@
|
|
1
|
+
/*
|
2
|
+
# -----------------------------------------------------------------------------
|
3
|
+
# ~/assets/theme/j1/modules/videojs/js/plugins/controls/skipbuttons/skipbuttons.js
|
4
|
+
# Provides the skipbuttons plugin for Video.js V8 and newer
|
5
|
+
# See: https://github.com/mister-ben/videojs-seek-buttons/edit/master/README.md
|
6
|
+
#
|
7
|
+
# Product/Info:
|
8
|
+
# https://github.com/mister-ben/videojs-seek-buttons
|
9
|
+
# http://jekyll.one
|
10
|
+
#
|
11
|
+
# Copyright (C) 2023 mister-ben
|
12
|
+
# Copyright (C) 2023, 2024 Juergen Adams
|
13
|
+
#
|
14
|
+
# skipbuttons is licensed under the Apache License 2.0.
|
15
|
+
# See: https://github.com/mister-ben/videojs-seek-buttons/blob/master/LICENSE
|
16
|
+
# J1 Theme is licensed under MIT License.
|
17
|
+
# See: https://github.com/jekyll-one-org/j1-template/blob/main/LICENSE
|
18
|
+
# -----------------------------------------------------------------------------
|
19
|
+
*/
|
20
|
+
|
21
|
+
(function (global, factory) {
|
22
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('video.js')) :
|
23
|
+
typeof define === 'function' && define.amd ? define(['video.js'], factory) :
|
24
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.videojsskipButtons = factory(global.videojs));
|
25
|
+
})(this, (function (videojs) {
|
26
|
+
|
27
|
+
'use strict';
|
28
|
+
|
29
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
30
|
+
|
31
|
+
var videojs__default = /*#__PURE__*/_interopDefaultLegacy(videojs);
|
32
|
+
var version = "4.0.2";
|
33
|
+
|
34
|
+
const Button = videojs__default["default"].getComponent('Button'); // Default options for the plugin.
|
35
|
+
|
36
|
+
const defaults = {
|
37
|
+
forwardIndex: 1,
|
38
|
+
backwardIndex: 1
|
39
|
+
};
|
40
|
+
|
41
|
+
// Set up buttons when the player is ready
|
42
|
+
//
|
43
|
+
const onPlayerReady = (player, options) => {
|
44
|
+
player.addClass('vjs-seek-buttons');
|
45
|
+
|
46
|
+
if (options.forward && options.forward > 0) {
|
47
|
+
player.controlBar.seekForward = player.controlBar.addChild('seekButton', {
|
48
|
+
direction: 'forward',
|
49
|
+
seconds: options.forward
|
50
|
+
}, options.forwardIndex);
|
51
|
+
}
|
52
|
+
|
53
|
+
if (options.backward && options.backward > 0) {
|
54
|
+
player.controlBar.seekBack = player.controlBar.addChild('seekButton', {
|
55
|
+
direction: 'backward',
|
56
|
+
seconds: options.backward
|
57
|
+
}, options.backwardIndex);
|
58
|
+
}
|
59
|
+
};
|
60
|
+
|
61
|
+
// Plugin init if ready or on ready
|
62
|
+
// An object of options left to the plugin author to define.
|
63
|
+
//
|
64
|
+
const skipButtons = function (options) {
|
65
|
+
this.ready(() => {
|
66
|
+
onPlayerReady(this, videojs__default["default"].obj.merge(defaults, options));
|
67
|
+
});
|
68
|
+
};
|
69
|
+
|
70
|
+
// Set version number
|
71
|
+
//
|
72
|
+
skipButtons.VERSION = version;
|
73
|
+
|
74
|
+
// Button to seek forward/backward
|
75
|
+
//
|
76
|
+
class SeekButton extends Button {
|
77
|
+
|
78
|
+
// Constructor for class
|
79
|
+
//
|
80
|
+
// @param {Player|Object} player The player
|
81
|
+
// @param {Object=} options Button options
|
82
|
+
// @param {string} options.direction back or forward
|
83
|
+
// @param {Int} options.seconds number of seconds to seek
|
84
|
+
//
|
85
|
+
constructor(player, options) {
|
86
|
+
super(player, options);
|
87
|
+
this.$('.vjs-icon-placeholder').classList.add('vjs-icon-replay');
|
88
|
+
// this.$('.vjs-icon-placeholder').classList.add('vjs-icon-next-item');
|
89
|
+
|
90
|
+
if (this.options_.direction === 'forward') {
|
91
|
+
this.controlText(this.localize('Seek forward {{seconds}} seconds').replace('{{seconds}}', this.options_.seconds));
|
92
|
+
} else if (this.options_.direction === 'backward') {
|
93
|
+
this.controlText(this.localize('Seek backward {{seconds}} seconds').replace('{{seconds}}', this.options_.seconds));
|
94
|
+
}
|
95
|
+
}
|
96
|
+
|
97
|
+
// Return button class names which include the seek amount
|
98
|
+
//
|
99
|
+
buildCSSClass() {
|
100
|
+
/* Each button will have the classes:
|
101
|
+
`vjs-seek-button`
|
102
|
+
`skip-forward` or `skip-backward`
|
103
|
+
`skip-n` where `n` is the number of seconds
|
104
|
+
So you could have a generic icon for "skip backward" and a more
|
105
|
+
specific one for "skip back 30 seconds"
|
106
|
+
*/
|
107
|
+
return `vjs-seek-button skip-${this.options_.direction} ` + `skip-${this.options_.seconds} ${super.buildCSSClass()}`;
|
108
|
+
}
|
109
|
+
|
110
|
+
// Seek with the button's configured offset
|
111
|
+
//
|
112
|
+
handleClick() {
|
113
|
+
const now = this.player_.currentTime();
|
114
|
+
|
115
|
+
if (this.options_.direction === 'forward') {
|
116
|
+
let duration = this.player_.duration();
|
117
|
+
|
118
|
+
if (this.player_.liveTracker && this.player_.liveTracker.isLive()) {
|
119
|
+
duration = this.player_.liveTracker.seekableEnd();
|
120
|
+
}
|
121
|
+
|
122
|
+
this.player_.currentTime(Math.min(now + this.options_.seconds, duration));
|
123
|
+
} else if (this.options_.direction === 'backward') {
|
124
|
+
this.player_.currentTime(Math.max(0, now - this.options_.seconds));
|
125
|
+
}
|
126
|
+
}
|
127
|
+
|
128
|
+
}
|
129
|
+
|
130
|
+
// register components|plugin
|
131
|
+
//
|
132
|
+
videojs__default["default"].registerComponent('SeekButton', SeekButton);
|
133
|
+
videojs__default["default"].registerPlugin('skipButtons', skipButtons);
|
134
|
+
|
135
|
+
return skipButtons;
|
136
|
+
|
137
|
+
}));
|
@@ -0,0 +1,21 @@
|
|
1
|
+
/*
|
2
|
+
# -----------------------------------------------------------------------------
|
3
|
+
# ~/assets/theme/j1/modules/videojs/js/plugins/controls/skipbuttons/skipbuttons.min.js
|
4
|
+
# Provides the skipbuttons plugin for Video.js V8 and newer
|
5
|
+
# See: https://github.com/mister-ben/videojs-seek-buttons/edit/master/README.md
|
6
|
+
#
|
7
|
+
# Product/Info:
|
8
|
+
# https://github.com/mister-ben/videojs-seek-buttons
|
9
|
+
# http://jekyll.one
|
10
|
+
#
|
11
|
+
# Copyright (C) 2023 mister-ben
|
12
|
+
# Copyright (C) 2023, 2024 Juergen Adams
|
13
|
+
#
|
14
|
+
# skipbuttons is licensed under the Apache License 2.0.
|
15
|
+
# See: https://github.com/mister-ben/videojs-seek-buttons/blob/master/LICENSE
|
16
|
+
# J1 Theme is licensed under MIT License.
|
17
|
+
# See: https://github.com/jekyll-one-org/j1-template/blob/main/LICENSE
|
18
|
+
# -----------------------------------------------------------------------------
|
19
|
+
*/
|
20
|
+
|
21
|
+
!function(e,s){"object"==typeof exports&&"undefined"!=typeof module?module.exports=s(require("video.js")):"function"==typeof define&&define.amd?define(["video.js"],s):(e="undefined"!=typeof globalThis?globalThis:e||self).videojsskipButtons=s(e.videojs)}(this,function(e){"use strict";var s=function(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}(e);const t=s.default.getComponent("Button"),o={forwardIndex:1,backwardIndex:1},i=function(e){this.ready(()=>{((e,s)=>{e.addClass("vjs-seek-buttons"),s.forward&&s.forward>0&&(e.controlBar.seekForward=e.controlBar.addChild("seekButton",{direction:"forward",seconds:s.forward},s.forwardIndex)),s.backward&&s.backward>0&&(e.controlBar.seekBack=e.controlBar.addChild("seekButton",{direction:"backward",seconds:s.backward},s.backwardIndex))})(this,s.default.obj.merge(o,e))})};i.VERSION="4.0.2";return s.default.registerComponent("SeekButton",class extends t{constructor(e,s){super(e,s),this.$(".vjs-icon-placeholder").classList.add("vjs-icon-replay"),"forward"===this.options_.direction?this.controlText(this.localize("Seek forward {{seconds}} seconds").replace("{{seconds}}",this.options_.seconds)):"backward"===this.options_.direction&&this.controlText(this.localize("Seek backward {{seconds}} seconds").replace("{{seconds}}",this.options_.seconds))}buildCSSClass(){return`vjs-seek-button skip-${this.options_.direction} `+`skip-${this.options_.seconds} ${super.buildCSSClass()}`}handleClick(){const e=this.player_.currentTime();if("forward"===this.options_.direction){let s=this.player_.duration();this.player_.liveTracker&&this.player_.liveTracker.isLive()&&(s=this.player_.liveTracker.seekableEnd()),this.player_.currentTime(Math.min(e+this.options_.seconds,s))}else"backward"===this.options_.direction&&this.player_.currentTime(Math.max(0,e-this.options_.seconds))}}),s.default.registerPlugin("skipButtons",i),i});
|
@@ -25,20 +25,23 @@
|
|
25
25
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global["@theonlyducks/videojs-zoom"] = factory(global.videojs));
|
26
26
|
})(this, (function (videojs) { 'use strict'
|
27
27
|
|
28
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
29
|
+
|
30
|
+
var videojs__default = /*#__PURE__*/_interopDefaultLegacy(videojs);
|
31
|
+
|
28
32
|
const Button = videojs.getComponent('Button');
|
29
33
|
const Plugin = videojs.getPlugin('plugin');
|
30
34
|
const Component = videojs.getComponent('Component');
|
31
35
|
|
32
36
|
const version = '1.2.0';
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
};
|
37
|
+
const ZOOM_SALT = 0.2;
|
38
|
+
const DEFAULT_OPTIONS = {
|
39
|
+
zoom: 1,
|
40
|
+
moveX: 0,
|
41
|
+
moveY: 0,
|
42
|
+
flip: "+",
|
43
|
+
rotate: 0
|
44
|
+
};
|
42
45
|
|
43
46
|
class Observer {
|
44
47
|
static _instance = null;
|
@@ -310,7 +313,7 @@
|
|
310
313
|
}
|
311
314
|
}
|
312
315
|
|
313
|
-
class
|
316
|
+
class zoomButtons extends Plugin {
|
314
317
|
constructor(player) {
|
315
318
|
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
316
319
|
super(player, options);
|
@@ -397,7 +400,7 @@
|
|
397
400
|
//
|
398
401
|
videojs.registerComponent('ZoomModal', ZoomModal);
|
399
402
|
videojs.registerComponent('ZoomButton', ZoomButton);
|
400
|
-
videojs.registerPlugin('
|
403
|
+
videojs.registerPlugin('zoomButtons', zoomButtons);
|
401
404
|
|
402
|
-
return
|
405
|
+
return zoomButtons;
|
403
406
|
}));
|