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
@@ -288,7 +288,7 @@ settings:
|
|
288
288
|
|
289
289
|
muted: false
|
290
290
|
preload: true
|
291
|
-
# videoStart: ["00:00:30", "00:01:30"]
|
291
|
+
# videoStart: ["00:00:30", "00:01:30"] # start time (hh:mm:ss) for [video1, video2]
|
292
292
|
|
293
293
|
controls: true
|
294
294
|
controlBar:
|
@@ -299,11 +299,19 @@ settings:
|
|
299
299
|
volumePanel:
|
300
300
|
inline: false
|
301
301
|
|
302
|
-
|
302
|
+
hotKeysPlugin:
|
303
303
|
enabled: true
|
304
304
|
options:
|
305
305
|
volumeStep: 0.2
|
306
306
|
|
307
|
+
skipButtonsPlugin:
|
308
|
+
enabled: true
|
309
|
+
options:
|
310
|
+
forward: 5
|
311
|
+
backward: 5
|
312
|
+
backwardIndex: 0
|
313
|
+
forwardIndex: 1
|
314
|
+
|
307
315
|
zoomPlugin:
|
308
316
|
enabled: true
|
309
317
|
options:
|
@@ -898,18 +906,26 @@ settings:
|
|
898
906
|
volumePanel:
|
899
907
|
inline: false
|
900
908
|
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
909
|
+
# hotKeysPlugin:
|
910
|
+
# enabled: true
|
911
|
+
# options:
|
912
|
+
# volumeStep: 0.2
|
913
|
+
#
|
914
|
+
# skipButtonsPlugin:
|
915
|
+
# enabled: true
|
916
|
+
# options:
|
917
|
+
# forward: 5
|
918
|
+
# backward: 5
|
919
|
+
# backwardIndex: 0
|
920
|
+
# forwardIndex: 1
|
921
|
+
#
|
922
|
+
# zoomPlugin:
|
923
|
+
# enabled: true
|
924
|
+
# options:
|
925
|
+
# moveX: 0
|
926
|
+
# moveY: 0
|
927
|
+
# rotate: 0
|
928
|
+
# zoom: 1
|
913
929
|
|
914
930
|
# ------------------------------------------------------------------------
|
915
931
|
# CSS filter options
|
@@ -557,6 +557,8 @@ settings:
|
|
557
557
|
player:
|
558
558
|
enabled: true
|
559
559
|
|
560
|
+
# VideoJS
|
561
|
+
# --------------------------------------------------------------------
|
560
562
|
videojsPlayer:
|
561
563
|
enabled: true
|
562
564
|
|
@@ -580,6 +582,12 @@ settings:
|
|
580
582
|
options:
|
581
583
|
volumeStep: 0.2
|
582
584
|
|
585
|
+
skipButtonsPlugin:
|
586
|
+
enabled: true
|
587
|
+
options:
|
588
|
+
forward: 15
|
589
|
+
backward: 15
|
590
|
+
|
583
591
|
zoomPlugin:
|
584
592
|
enabled: true
|
585
593
|
options:
|
@@ -588,6 +596,8 @@ settings:
|
|
588
596
|
rotate: 0
|
589
597
|
zoom: 1
|
590
598
|
|
599
|
+
# Vimeo
|
600
|
+
# --------------------------------------------------------------------
|
591
601
|
vimeoPlayer:
|
592
602
|
enabled: true
|
593
603
|
options:
|
@@ -597,6 +607,9 @@ settings:
|
|
597
607
|
# portrait: 0
|
598
608
|
# color: var(--md-gray-100)
|
599
609
|
|
610
|
+
|
611
|
+
# Wistia
|
612
|
+
# --------------------------------------------------------------------
|
600
613
|
wistiaPlayer:
|
601
614
|
enabled: true
|
602
615
|
options:
|
@@ -605,6 +618,8 @@ settings:
|
|
605
618
|
muted: false
|
606
619
|
qualityControl: false
|
607
620
|
|
621
|
+
# Youtube
|
622
|
+
# --------------------------------------------------------------------
|
608
623
|
youTubePlayer:
|
609
624
|
enabled: true
|
610
625
|
options:
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# ------------------------------------------------------------------------------
|
2
|
+
# ~/_data/modules/videojs.yml
|
3
|
+
# User configuration settings for J1 VideoJS module
|
4
|
+
#
|
5
|
+
# Product/Info:
|
6
|
+
# https://jekyll.one
|
7
|
+
#
|
8
|
+
# Copyright (C) 2023, 2024 Juergen Adams
|
9
|
+
#
|
10
|
+
# J1 Template is licensed under the MIT License.
|
11
|
+
# See: https://github.com/jekyll-one-org/j1-template/blob/main/LICENSE
|
12
|
+
# -----------------------------------------------------------------------------
|
13
|
+
|
14
|
+
# ------------------------------------------------------------------------------
|
15
|
+
# Description
|
16
|
+
#
|
17
|
+
description:
|
18
|
+
title: J1 VideoJS
|
19
|
+
scope: User settings
|
20
|
+
location: _data/modules/videojs.yml
|
21
|
+
|
22
|
+
# ------------------------------------------------------------------------------
|
23
|
+
# User configuration settings
|
24
|
+
#
|
25
|
+
settings:
|
26
|
+
|
27
|
+
# ----------------------------------------------------------------------------
|
28
|
+
# VideoJS settings
|
29
|
+
# ----------------------------------------------------------------------------
|
30
|
+
playbackRates:
|
31
|
+
enabled: true
|
32
|
+
|
33
|
+
# ----------------------------------------------------------------------------
|
34
|
+
# VideoJS Plugin settings
|
35
|
+
# ----------------------------------------------------------------------------
|
36
|
+
plugins:
|
37
|
+
|
38
|
+
hotKeys:
|
39
|
+
enabled: true
|
40
|
+
|
41
|
+
# Plugin options
|
42
|
+
# ------------------------------------------------------------------------
|
43
|
+
enableInactiveFocus: false # mutiple players on same page: reassign focus to the player when the control bar fades out
|
44
|
+
# hotkeysFocusElementFilter: 'e => e.tagName.toLowerCase() === "body"'
|
45
|
+
|
46
|
+
skipButtons:
|
47
|
+
enabled: true
|
48
|
+
|
49
|
+
# Plugin options
|
50
|
+
# ------------------------------------------------------------------------
|
51
|
+
surroundPlayButton: true # surround buttons side-by-side the play button
|
52
|
+
|
53
|
+
zoomButtons:
|
54
|
+
enabled: true
|
55
|
+
|
56
|
+
# ------------------------------------------------------------------------------
|
57
|
+
# END config
|
@@ -356,8 +356,9 @@ resources:
|
|
356
356
|
data:
|
357
357
|
css: [
|
358
358
|
core/css/themes/unolight/bootstrap,
|
359
|
-
core/css/icon-fonts/mdib,
|
360
359
|
core/css/icon-fonts/fontawesome,
|
360
|
+
core/css/icon-fonts/mdib,
|
361
|
+
|
361
362
|
core/css/vendor
|
362
363
|
]
|
363
364
|
files: [ adapter/js/j1.js ]
|
@@ -1320,6 +1321,7 @@ resources:
|
|
1320
1321
|
data:
|
1321
1322
|
css: [
|
1322
1323
|
modules/videojs/css/videojs,
|
1324
|
+
modules/videojs/css/plugins/controls/skipbuttons,
|
1323
1325
|
modules/videojs/css/plugins/controls/zoom,
|
1324
1326
|
modules/videojs/css/themes/city,
|
1325
1327
|
modules/videojs/css/themes/fantasy,
|
@@ -1327,18 +1329,19 @@ resources:
|
|
1327
1329
|
modules/videojs/css/themes/sea,
|
1328
1330
|
modules/videojs/css/themes/uno
|
1329
1331
|
]
|
1330
|
-
files: []
|
1332
|
+
files: [ adapter/js/videojs.js ]
|
1331
1333
|
js: [
|
1332
1334
|
modules/videojs/js/video,
|
1335
|
+
modules/videojs/js/plugins/controls/autocaption/autocaption,
|
1333
1336
|
modules/videojs/js/plugins/controls/hotkeys/hotkeys,
|
1337
|
+
modules/videojs/js/plugins/controls/skipbuttons/skipbuttons,
|
1334
1338
|
modules/videojs/js/plugins/controls/zoom/zoom,
|
1335
1339
|
modules/videojs/js/plugins/players/dm/dailymotion,
|
1340
|
+
modules/videojs/js/plugins/players/wt/wistia,
|
1336
1341
|
modules/videojs/js/plugins/players/vm/vimeo,
|
1337
1342
|
modules/videojs/js/plugins/players/yt/youtube
|
1338
|
-
|
1339
|
-
|
1340
1343
|
]
|
1341
|
-
init_function: []
|
1344
|
+
init_function: [ j1.adapter.videojs.init]
|
1342
1345
|
|
1343
1346
|
# ----------------------------------------------------------------------------
|
1344
1347
|
# TikToc Player, Version v1.0.11
|
@@ -1918,26 +1921,5 @@ resources:
|
|
1918
1921
|
js: [ modules/amplitudejs/js/amplitude ]
|
1919
1922
|
init_function: [ j1.adapter.amplitude.init ]
|
1920
1923
|
|
1921
|
-
# ----------------------------------------------------------------------------
|
1922
|
-
# jqueryScrollbar
|
1923
|
-
#
|
1924
|
-
- name: J1 jqueryScrollbar
|
1925
|
-
resource:
|
1926
|
-
enabled: false
|
1927
|
-
|
1928
|
-
id: scrollbars
|
1929
|
-
comment: Module jqueryScrollbar
|
1930
|
-
region: body-footer
|
1931
|
-
layout: [ home, page, post ]
|
1932
|
-
required: always
|
1933
|
-
script_load: defer
|
1934
|
-
pass_init_data: false
|
1935
|
-
|
1936
|
-
data:
|
1937
|
-
css: [ modules/jqueryScrollbar/css/scrollbar ]
|
1938
|
-
files: []
|
1939
|
-
js: [ modules/jqueryScrollbar/js/scrollbar ]
|
1940
|
-
init_function: []
|
1941
|
-
|
1942
1924
|
# ------------------------------------------------------------------------------
|
1943
|
-
# END config
|
1925
|
+
# END config
|
@@ -57,7 +57,7 @@
|
|
57
57
|
<id>{{ page.url | absolute_url | xml_escape }}</id>
|
58
58
|
<post_limited>{{ limit_posts }}</post_limited>
|
59
59
|
<template_name>J1 Theme</template_name>
|
60
|
-
<template_version>2024.3.
|
60
|
+
<template_version>2024.3.16</template_version>
|
61
61
|
|
62
62
|
{% assign title = site.title | default: site.name %}
|
63
63
|
{% if page.collection != "posts" %}
|
@@ -47,7 +47,7 @@ Asciidoctor::Extensions.register do
|
|
47
47
|
chars = [('a'..'z'), ('A'..'Z'), ('0'..'9')].map(&:to_a).flatten
|
48
48
|
video_id = (0...11).map { chars[rand(chars.length)] }.join
|
49
49
|
|
50
|
-
title_html = (attributes.has_key? 'title') ? %(<div class="video-title"> <i class="mdib mdib-
|
50
|
+
title_html = (attributes.has_key? 'title') ? %(<div class="video-title"> <i class="mdib mdib-video mdib-24px mr-2"></i> #{attributes['title']} </div>\n) : nil
|
51
51
|
poster_image = (poster = attributes['poster']) ? %(#{poster}) : nil
|
52
52
|
theme_name = (theme = attributes['theme']) ? %(#{theme}) : nil
|
53
53
|
caption_enabled = (caption = attributes['caption']) ? true : false
|
@@ -121,6 +121,9 @@ Asciidoctor::Extensions.register do
|
|
121
121
|
var vjs_player = document.getElementById("#{video_id}");
|
122
122
|
|
123
123
|
vjs_player.addEventListener('click', function(event) {
|
124
|
+
event.preventDefault();
|
125
|
+
event.stopPropagation();
|
126
|
+
|
124
127
|
var scrollOffset = (window.innerWidth >= 720) ? -130 : -110;
|
125
128
|
|
126
129
|
// scroll player to top position
|
@@ -47,10 +47,30 @@ Asciidoctor::Extensions.register do
|
|
47
47
|
|
48
48
|
def process parent, target, attributes
|
49
49
|
|
50
|
+
# ========================================================================
|
51
|
+
# load VideoJS configuration data (as NOT available in the website)
|
52
|
+
# ------------------------------------------------------------------------
|
53
|
+
#
|
54
|
+
current_path = File.expand_path(Dir.getwd)
|
55
|
+
default_config_path = File.join(current_path, '/_data/modules/defaults')
|
56
|
+
user_config_path = File.join(current_path, '/_data/modules')
|
57
|
+
|
58
|
+
videojs_config_file_name = 'videojs.yml'
|
59
|
+
videojs_default_config_file = File.join(default_config_path, videojs_config_file_name)
|
60
|
+
videojs_user_config_file = File.join(user_config_path, videojs_config_file_name)
|
61
|
+
|
62
|
+
videojsDefaultSettings = YAML::load(File.open(videojs_default_config_file))
|
63
|
+
videojsUserSettings = YAML::load(File.open(videojs_user_config_file))
|
64
|
+
videojsDefaultSettingsJson = videojsDefaultSettings.to_json;
|
65
|
+
videojsUserSettingsJson = videojsUserSettings.to_json;
|
66
|
+
|
67
|
+
# ========================================================================
|
68
|
+
# set plugin specific data
|
69
|
+
# ------------------------------------------------------------------------
|
50
70
|
chars = [('a'..'z'), ('A'..'Z'), ('0'..'9')].map(&:to_a).flatten
|
51
71
|
video_id = (0...11).map { chars[rand(chars.length)] }.join
|
52
72
|
|
53
|
-
title_html = (attributes.has_key? 'title') ? %(<div class="video-title"> <i class="mdib mdib-
|
73
|
+
title_html = (attributes.has_key? 'title') ? %(<div class="video-title"> <i class="mdib mdib-video mdib-24px mr-2"></i> #{attributes['title']} </div>\n) : nil
|
54
74
|
poster_image = (poster = attributes['poster']) ? %(#{poster}) : nil
|
55
75
|
theme_name = (theme = attributes['theme']) ? %(#{theme}) : nil
|
56
76
|
caption_enabled = (caption = attributes['caption']) ? true : false
|
@@ -74,6 +94,10 @@ Asciidoctor::Extensions.register do
|
|
74
94
|
}],
|
75
95
|
"controlBar": {
|
76
96
|
"pictureInPictureToggle": false,
|
97
|
+
"skipButtons": {
|
98
|
+
"backward": 15,
|
99
|
+
"forward": 15
|
100
|
+
},
|
77
101
|
"volumePanel": {
|
78
102
|
"inline": false
|
79
103
|
}
|
@@ -85,6 +109,36 @@ Asciidoctor::Extensions.register do
|
|
85
109
|
<script>
|
86
110
|
$(function() {
|
87
111
|
|
112
|
+
// =================================================================
|
113
|
+
// take over VideoJS configuration data (JSON data from Ruby)
|
114
|
+
// -----------------------------------------------------------------
|
115
|
+
var videojsDefaultConfigJson = '#{videojsDefaultSettingsJson}';
|
116
|
+
var videojsUserConfigJson = '#{videojsUserSettingsJson}';
|
117
|
+
|
118
|
+
// create config objects from JSON data
|
119
|
+
var videojsDefaultSettings = JSON.parse(videojsDefaultConfigJson);
|
120
|
+
var videojsUserSettings = JSON.parse(videojsUserConfigJson);
|
121
|
+
|
122
|
+
// merge config objects (jQuery)
|
123
|
+
var videojsConfig = $.extend(true, {}, videojsDefaultSettings.defaults, videojsUserSettings.settings);
|
124
|
+
|
125
|
+
// =================================================================
|
126
|
+
// VideoJS player settings
|
127
|
+
// -----------------------------------------------------------------
|
128
|
+
const vjsPlayerType = 'native';
|
129
|
+
const vjsPlaybackRates = videojsConfig.playbackRates.values;
|
130
|
+
|
131
|
+
// =================================================================
|
132
|
+
// VideoJS plugin settings
|
133
|
+
// -----------------------------------------------------------------
|
134
|
+
const piAutoCaption = videojsConfig.plugins.autoCaption;
|
135
|
+
const piHotKeys = videojsConfig.plugins.hotKeys;
|
136
|
+
const piSkipButtons = videojsConfig.plugins.skipButtons;
|
137
|
+
const piZoomButtons = videojsConfig.plugins.zoomButtons;
|
138
|
+
|
139
|
+
// =================================================================
|
140
|
+
// helper functions
|
141
|
+
// -----------------------------------------------------------------
|
88
142
|
function addCaptionAfterImage(imageSrc) {
|
89
143
|
const image = document.querySelector(`img[src="${imageSrc}"]`);
|
90
144
|
|
@@ -101,59 +155,126 @@ Asciidoctor::Extensions.register do
|
|
101
155
|
}
|
102
156
|
}
|
103
157
|
|
158
|
+
// =================================================================
|
159
|
+
// initialize the VideoJS player (on page ready)
|
160
|
+
// -----------------------------------------------------------------
|
104
161
|
var dependencies_met_page_ready = setInterval (function (options) {
|
105
162
|
var pageState = $('#content').css("display");
|
106
163
|
var pageVisible = (pageState == 'block') ? true : false;
|
107
164
|
var j1CoreFinished = (j1.getState() === 'finished') ? true : false;
|
108
165
|
|
109
166
|
if (j1CoreFinished && pageVisible) {
|
167
|
+
var vjs_player = document.getElementById("#{video_id}");
|
168
|
+
var appliedOnce = false;
|
110
169
|
|
170
|
+
// add|skip captions (on poster image)
|
111
171
|
if ('#{caption_enabled}' === 'true') {
|
112
172
|
addCaptionAfterImage('#{poster_image}');
|
113
173
|
}
|
114
174
|
|
115
|
-
|
175
|
+
// set VideoJS player settings
|
116
176
|
videojs("#{video_id}").ready(function() {
|
117
|
-
var
|
177
|
+
var vjsPlayer = this;
|
118
178
|
|
119
|
-
// add playbackRates
|
120
|
-
|
179
|
+
// add|skip playbackRates
|
180
|
+
//
|
181
|
+
if (videojsConfig.playbackRates.enabled) {
|
182
|
+
vjsPlayer.playbackRates(vjsPlaybackRates);
|
183
|
+
}
|
121
184
|
|
122
|
-
// add
|
123
|
-
|
124
|
-
|
125
|
-
|
185
|
+
// add|skip hotKeys plugin
|
186
|
+
//
|
187
|
+
if (piHotKeys.enabled) {
|
188
|
+
vjsPlayer.hotKeys({
|
189
|
+
volumeStep: piHotKeys.volumeStep,
|
190
|
+
seekStep: piHotKeys.seekStep,
|
191
|
+
enableMute: piHotKeys.enableMute,
|
192
|
+
enableFullscreen: piHotKeys.enableFullscreen,
|
193
|
+
enableNumbers: piHotKeys.enableNumbers,
|
194
|
+
enableVolumeScroll: piHotKeys.enableVolumeScroll,
|
195
|
+
enableHoverScroll: piHotKeys.enableHoverScroll,
|
196
|
+
alwaysCaptureHotkeys: piHotKeys.alwaysCaptureHotkeys,
|
197
|
+
captureDocumentHotkeys: piHotKeys.captureDocumentHotkeys,
|
198
|
+
documentHotkeysFocusElementFilter: e => e.tagName.toLowerCase() === "body",
|
126
199
|
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
200
|
+
// Mimic VLC seek behavior (default to: 15)
|
201
|
+
seekStep: function(e) {
|
202
|
+
if (e.ctrlKey && e.altKey) {
|
203
|
+
return 5*60;
|
204
|
+
} else if (e.ctrlKey) {
|
205
|
+
return 60;
|
206
|
+
} else if (e.altKey) {
|
207
|
+
return 10;
|
208
|
+
} else {
|
209
|
+
return 15;
|
210
|
+
}
|
211
|
+
},
|
134
212
|
|
135
|
-
|
213
|
+
// Enhance existing simple hotkey by complex hotkeys
|
214
|
+
fullscreenKey: function(e) {
|
215
|
+
// fullscreen with the F key or Ctrl+Enter
|
216
|
+
return ((e.which === 70) || (e.ctrlKey && e.which === 13));
|
217
|
+
},
|
218
|
+
|
219
|
+
});
|
220
|
+
}
|
221
|
+
|
222
|
+
// add|skip skipButtons plugin
|
223
|
+
if (piSkipButtons.enabled) {
|
224
|
+
var backwardIndex = piSkipButtons.backward;
|
225
|
+
var forwardIndex = piSkipButtons.forwardIndex;
|
226
|
+
|
227
|
+
// property 'surroundPlayButton' takes precendence
|
228
|
+
//
|
229
|
+
if (piSkipButtons.surroundPlayButton) {
|
230
|
+
var backwardIndex = 0;
|
231
|
+
var forwardIndex = 1;
|
232
|
+
}
|
233
|
+
|
234
|
+
vjsPlayer.skipButtons({
|
235
|
+
backwardIndex: backwardIndex,
|
236
|
+
forwardIndex: forwardIndex,
|
237
|
+
backward: piSkipButtons.backward,
|
238
|
+
forward: piSkipButtons.forward,
|
239
|
+
});
|
240
|
+
}
|
241
|
+
|
242
|
+
// add|skip zoomButtons plugin
|
243
|
+
//
|
244
|
+
if (piZoomButtons.enabled && vjsPlayerType === 'native') {
|
245
|
+
vjsPlayer.zoomButtons({
|
246
|
+
moveX: piZoomButtons.moveX,
|
247
|
+
moveY: piZoomButtons.moveY,
|
248
|
+
rotate: piZoomButtons.rotate,
|
249
|
+
zoom: piZoomButtons.zoom
|
250
|
+
});
|
251
|
+
}
|
252
|
+
|
253
|
+
// set start position of current video (on play)
|
136
254
|
// -----------------------------------------------------------
|
137
|
-
|
255
|
+
vjsPlayer.on("play", function() {
|
138
256
|
var startFromSecond = new Date('1970-01-01T' + "#{attributes['start']}" + 'Z').getTime() / 1000;
|
139
257
|
if (!appliedOnce) {
|
140
|
-
|
258
|
+
vjsPlayer.currentTime(startFromSecond);
|
141
259
|
appliedOnce = true;
|
142
260
|
}
|
143
261
|
});
|
262
|
+
|
144
263
|
});
|
145
264
|
|
146
|
-
// scroll to player top position
|
265
|
+
// scroll page to player top position
|
147
266
|
// -------------------------------------------------------------
|
148
267
|
var vjs_player = document.getElementById("#{video_id}");
|
149
268
|
|
150
269
|
vjs_player.addEventListener('click', function(event) {
|
151
|
-
var scrollOffset = (window.innerWidth >= 720) ? -130 : -110;
|
152
|
-
|
153
|
-
// scroll player to top position
|
154
270
|
const targetDiv = document.getElementById("#{video_id}");
|
155
|
-
const targetDivPosition = targetDiv.offsetTop;
|
271
|
+
const targetDivPosition = targetDiv.offsetTop;
|
272
|
+
var scrollOffset = (window.innerWidth >= 720) ? -130 : -110;
|
273
|
+
|
274
|
+
// scroll page to the players top position
|
275
|
+
// -------------------------------------------------------------
|
156
276
|
window.scrollTo(0, targetDivPosition + scrollOffset);
|
277
|
+
|
157
278
|
}); // END EventListener 'click'
|
158
279
|
|
159
280
|
clearInterval(dependencies_met_page_ready);
|
@@ -48,7 +48,7 @@ Asciidoctor::Extensions.register do
|
|
48
48
|
chars = [('a'..'z'), ('A'..'Z'), ('0'..'9')].map(&:to_a).flatten
|
49
49
|
video_id = (0...11).map {chars[rand(chars.length)]}.join
|
50
50
|
|
51
|
-
title_html = (attributes.has_key? 'title') ? %(<div class="video-title"> <i class="mdib mdib-
|
51
|
+
title_html = (attributes.has_key? 'title') ? %(<div class="video-title"> <i class="mdib mdib-video mdib-24px mr-2"></i> #{attributes['title']} </div>\n) : nil
|
52
52
|
poster_image = (poster = attributes['poster']) ? %(#{poster}) : nil
|
53
53
|
theme_name = (theme = attributes['theme']) ? %(#{theme}) : nil
|
54
54
|
caption_enabled = (caption = attributes['caption']) ? true : false
|
@@ -121,6 +121,9 @@ Asciidoctor::Extensions.register do
|
|
121
121
|
var vjs_player = document.getElementById("#{video_id}");
|
122
122
|
|
123
123
|
vjs_player.addEventListener('click', function(event) {
|
124
|
+
event.preventDefault();
|
125
|
+
event.stopPropagation();
|
126
|
+
|
124
127
|
var scrollOffset = (window.innerWidth >= 720) ? -130 : -110;
|
125
128
|
|
126
129
|
// scroll player to top position
|