j1-template 2024.3.24 → 2024.3.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. checksums.yaml +4 -4
  2. data/assets/data/apps/amplitudehtml +1147 -0
  3. data/assets/data/apps/gallery.html +342 -0
  4. data/assets/data/{masonry.html → apps/masonry.html} +22 -9
  5. data/assets/data/apps/swiper.html +901 -0
  6. data/assets/data/masonry_app.html +521 -0
  7. data/assets/theme/j1/modules/lightGallery/css/theme/uno/uno.css +21 -13
  8. data/assets/theme/j1/modules/lightGallery/css/theme/uno/uno.min.css +1 -2
  9. data/assets/theme/j1/modules/lightGallery/js/lightgallery.js +14 -13
  10. data/assets/theme/j1/modules/lightGallery/js/lightgallery.min.js +1 -1
  11. data/assets/theme/j1/modules/lightGallery/js/plugins/lg-video.js +265 -226
  12. data/assets/theme/j1/modules/lightGallery/js/plugins/lg-video.min.js +1 -1
  13. data/assets/theme/j1/modules/videojs/css/themes/uno.css +12 -2
  14. data/assets/theme/j1/modules/videojs/css/videojs.css +2 -3
  15. data/assets/theme/j1/modules/videojs/css/videojs.min.css +1 -1
  16. data/assets/theme/j1/modules/videojs/plugins/controls/zoom/css/zoom.css +55 -55
  17. data/assets/theme/j1/modules/videojs/plugins/controls/zoom/css/zoom.min.css +2 -1
  18. data/assets/theme/j1/modules/videojs/plugins/controls/zoom/js/zoom.js +590 -382
  19. data/assets/theme/j1/modules/videojs/plugins/controls/zoom/js/zoom.min.js +1 -1
  20. data/assets/theme/j1/modules/videojs/plugins/j1_core/template.min.js +31 -0
  21. data/assets/theme/j1/modules/videojs/plugins/players/dm/!examples/{simple.html → index.html} +11 -10
  22. data/assets/theme/j1/modules/videojs/plugins/players/dm/js/dailymotion.0.js +647 -0
  23. data/assets/theme/j1/modules/videojs/plugins/players/dm/js/dailymotion.1.js +653 -0
  24. data/assets/theme/j1/modules/videojs/plugins/players/vm/!examples/{player → iframe_api}/index.html +3 -3
  25. data/assets/theme/j1/modules/videojs/plugins/players/vm/!examples/{index.html → videojs_api/index.html} +7 -3
  26. data/assets/theme/j1/modules/videojs/plugins/players/vm/api/js/v2.21.0/vimeo.js +3562 -0
  27. data/assets/theme/j1/modules/videojs/plugins/players/vm/api/js/v2.21.0/vimeo.min.js +36 -0
  28. data/assets/theme/j1/modules/videojs/plugins/players/vm/api/js/vimeo.js +451 -1849
  29. data/assets/theme/j1/modules/videojs/plugins/players/vm/api/js/vimeo.min.js +2 -14
  30. data/assets/theme/j1/modules/videojs/plugins/players/vm/js/LICENSE +21 -0
  31. data/assets/theme/j1/modules/videojs/plugins/players/vm/js/README.md +54 -0
  32. data/assets/theme/j1/modules/videojs/plugins/players/vm/js/old/vimeo.js +666 -0
  33. data/assets/theme/j1/modules/videojs/plugins/players/vm/js/old/vimeo.min.js +28 -0
  34. data/assets/theme/j1/modules/videojs/plugins/players/vm/js/vimeo.js +2318 -548
  35. data/assets/theme/j1/modules/videojs/plugins/players/vm/js/vimeo.min.js +12 -18
  36. data/assets/theme/j1/modules/videojs/plugins/players/yt/!examples/{simple.html → index.html} +15 -6
  37. data/assets/theme/j1/modules/videojs/plugins/players/yt/js/youtube.js +12 -5
  38. data/assets/theme/j1/modules/videojs/plugins/players/yt/js/youtube.min.js +1 -1
  39. data/lib/j1/version.rb +1 -1
  40. data/lib/starter_web/Gemfile +1 -1
  41. data/lib/starter_web/README.md +5 -5
  42. data/lib/starter_web/_config.yml +2 -2
  43. data/lib/starter_web/_data/blocks/banner.yml +1 -1
  44. data/lib/starter_web/_data/j1_config.yml +1 -1
  45. data/lib/starter_web/_data/layouts/home.yml +1 -1
  46. data/lib/starter_web/_data/modules/authentication.yml +1 -2
  47. data/lib/starter_web/_data/modules/defaults/masonry.yml +1 -1
  48. data/lib/starter_web/_data/modules/gallery.yml +35 -24
  49. data/lib/starter_web/_data/modules/log4javascript.yml +1 -1
  50. data/lib/starter_web/_data/modules/masonry.yml +30 -14
  51. data/lib/starter_web/_data/modules/navigator.yml +1 -1
  52. data/lib/starter_web/_data/modules/navigator_menu.yml +12 -8
  53. data/lib/starter_web/_data/templates/feed.xml +1 -1
  54. data/lib/starter_web/_plugins/asciidoctor/dailymotion-block.rb +206 -24
  55. data/lib/starter_web/_plugins/index/lunr.rb +1 -1
  56. data/lib/starter_web/assets/image/module/attic/1920x1280/admin-dashboard-bootstrap.jpg +0 -0
  57. data/lib/starter_web/assets/image/module/attic/1920x1280/alexander-redl.jpg +0 -0
  58. data/lib/starter_web/assets/image/module/attic/1920x1280/alexander-shatov.jpg +0 -0
  59. data/lib/starter_web/assets/image/module/attic/1920x1280/alexey-ruban.jpg +0 -0
  60. data/lib/starter_web/assets/image/module/attic/1920x1280/andrea-badino.jpg +0 -0
  61. data/lib/starter_web/assets/image/module/attic/1920x1280/bootstrap-modal.jpg +0 -0
  62. data/lib/starter_web/assets/image/module/attic/1920x1280/bp-miller.jpg +0 -0
  63. data/lib/starter_web/assets/image/module/attic/1920x1280/brad-neathery.jpg +0 -0
  64. data/lib/starter_web/assets/image/module/attic/1920x1280/brigitta-schneiter.jpg +0 -0
  65. data/lib/starter_web/assets/image/module/attic/1920x1280/build-with-gemini.jpg +0 -0
  66. data/lib/starter_web/assets/image/module/attic/1920x1280/clem-onojeghuo.jpg +0 -0
  67. data/lib/starter_web/assets/image/module/attic/1920x1280/eleni-afiontzi.jpg +0 -0
  68. data/lib/starter_web/assets/image/module/attic/1920x1280/fly-d.jpg +0 -0
  69. data/lib/starter_web/assets/image/module/attic/1920x1280/guillaume-bolduc.jpg +0 -0
  70. data/lib/starter_web/assets/image/module/attic/1920x1280/ideas-start-here-1920x1280.jpg +0 -0
  71. data/lib/starter_web/assets/image/module/attic/1920x1280/isaac-davis.jpg +0 -0
  72. data/lib/starter_web/assets/image/module/attic/1920x1280/j1-launch.jpg +0 -0
  73. data/lib/starter_web/assets/image/module/attic/1920x1280/j1-mockup.jpg +0 -0
  74. data/lib/starter_web/assets/image/module/attic/1920x1280/john-schnobrich-2.jpg +0 -0
  75. data/lib/starter_web/assets/image/module/attic/1920x1280/josep-martins.jpg +0 -0
  76. data/lib/starter_web/assets/image/module/attic/1920x1280/josh-liu.jpg +0 -0
  77. data/lib/starter_web/assets/image/module/attic/1920x1280/kelly-sikkemal.jpg +0 -0
  78. data/lib/starter_web/assets/image/module/attic/1920x1280/kira-auf-der-heide.jpg +0 -0
  79. data/lib/starter_web/assets/image/module/attic/1920x1280/kristopher-roller.jpg +0 -0
  80. data/lib/starter_web/assets/image/module/attic/1920x1280/markus-spiske.jpg +0 -0
  81. data/lib/starter_web/assets/image/module/attic/1920x1280/martin-sanchez.jpg +0 -0
  82. data/lib/starter_web/assets/image/module/attic/1920x1280/material_symbols.jpg +0 -0
  83. data/lib/starter_web/assets/image/module/attic/1920x1280/matthaeus.jpg +0 -0
  84. data/lib/starter_web/assets/image/module/attic/1920x1280/melanie-deziel.jpg +0 -0
  85. data/lib/starter_web/assets/image/module/attic/1920x1280/nasa.jpg +0 -0
  86. data/lib/starter_web/assets/image/module/attic/1920x1280/quino-al-2.jpg +0 -0
  87. data/lib/starter_web/assets/image/module/attic/1920x1280/stories-ink-tattoo-care.jpg +0 -0
  88. data/lib/starter_web/assets/image/module/attic/1920x1280/towfiqu-barbhuiya.jpg +0 -0
  89. data/lib/starter_web/collections/posts/public/featured/_posts/0000-00-00-welcome-to-j1.adoc.erb +1 -1
  90. data/lib/starter_web/collections/posts/public/featured/_posts/2022-02-01-about-j1.adoc +2 -2
  91. data/lib/starter_web/collections/posts/public/featured/_posts/2023-10-18-url-types.adoc +2 -2
  92. data/lib/starter_web/config.ru +1 -1
  93. data/lib/starter_web/dot.gitattributes +1 -1
  94. data/lib/starter_web/index.html +8 -8
  95. data/lib/starter_web/package.json +1 -1
  96. data/lib/starter_web/pages/public/about/features.adoc +5 -5
  97. data/lib/starter_web/pages/public/about/reporting_issues.adoc +5 -5
  98. data/lib/starter_web/pages/public/about/site.adoc +14 -10
  99. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/000_intro.adoc +1 -1
  100. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/100_converter.adoc +1 -1
  101. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/200_themes.adoc +1 -1
  102. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/documentation.adoc +1 -1
  103. data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/multi.adoc +1 -1
  104. data/lib/starter_web/pages/public/asciidoc_skeletons/simple-document/simple.adoc +1 -1
  105. data/lib/starter_web/pages/public/blog/navigator/archive/allview.html +1 -1
  106. data/lib/starter_web/pages/public/blog/navigator/archive/categoryview.html +1 -1
  107. data/lib/starter_web/pages/public/blog/navigator/archive/dateview.html +1 -1
  108. data/lib/starter_web/pages/public/blog/navigator/archive/tagview.html +1 -1
  109. data/lib/starter_web/pages/public/blog/navigator/index.html +1 -1
  110. data/lib/starter_web/pages/public/learn/bookshelf/article_previewer/viewer_biography.adoc +1 -1
  111. data/lib/starter_web/pages/public/learn/bookshelf/article_previewer/viewer_fantasy.adoc +1 -1
  112. data/lib/starter_web/pages/public/learn/bookshelf/article_previewer/viewer_romance.adoc +1 -1
  113. data/lib/starter_web/pages/public/learn/bookshelf/jekyll_collections.adoc +1 -1
  114. data/lib/starter_web/pages/public/learn/bookshelf/viewer_all_books.adoc +1 -1
  115. data/lib/starter_web/pages/public/learn/where_to_go.adoc +1 -1
  116. data/lib/starter_web/pages/public/legal/en/100_copyright.adoc +3 -3
  117. data/lib/starter_web/pages/public/legal/en/200_impress.adoc +3 -3
  118. data/lib/starter_web/pages/public/legal/en/300_privacy.adoc +3 -3
  119. data/lib/starter_web/pages/public/legal/en/400_comment_policy.adoc +3 -3
  120. data/lib/starter_web/pages/public/panels/intro_panel/panel.adoc +1 -4
  121. data/lib/starter_web/pages/public/plans/plans.adoc +1 -1
  122. data/lib/starter_web/pages/public/tools/previewer/preview_bootstrap_theme.adoc +1 -1
  123. data/lib/starter_web/pages/public/tools/tester/videojs_macro_tester.adoc +116 -43
  124. data/lib/starter_web/pages/public/tour/_includes/documents/419_advanced_modals_demo.asciidoc +1 -1
  125. data/lib/starter_web/pages/public/tour/video_data.adoc +28 -22
  126. metadata +25 -49
  127. data/assets/theme/j1/modules/videojs/plugins/players/dm/!examples/dailymotion-controls.html +0 -18
  128. data/assets/theme/j1/modules/videojs/plugins/players/dm/!examples/dailymotion-javascript.html +0 -28
  129. data/assets/theme/j1/modules/videojs/plugins/players/dm/!examples/dailymotion-playlist.html +0 -19
  130. data/assets/theme/j1/modules/videojs/plugins/players/dm/!examples/global-parameters.html +0 -30
  131. data/assets/theme/j1/modules/videojs/plugins/players/dm/!examples/switch.html +0 -39
  132. data/assets/theme/j1/modules/videojs/plugins/players/yt/!examples/global-parameters.html +0 -34
  133. data/assets/theme/j1/modules/videojs/plugins/players/yt/!examples/switch.html +0 -39
  134. data/assets/theme/j1/modules/videojs/plugins/players/yt/!examples/youtube-controls.html +0 -20
  135. data/assets/theme/j1/modules/videojs/plugins/players/yt/!examples/youtube-javascript.html +0 -29
  136. data/assets/theme/j1/modules/videojs/plugins/players/yt/!examples/youtube-list.html +0 -21
  137. data/assets/theme/j1/modules/videojs/plugins/players/yt/!examples/youtube-playlist.html +0 -21
  138. data/lib/starter_web/assets/image/module/attic/1920x1280/j1-content-mockup-2.jpg +0 -0
  139. data/lib/starter_web/assets/image/module/attic/1920x1280/j1-content-mockup-3.jpg +0 -0
  140. data/lib/starter_web/assets/image/module/attic/1920x1280/j1-starter-mockup-1.jpg +0 -0
  141. data/lib/starter_web/assets/image/module/attic/admin-dashboard-bootstrap-1280x600.jpg +0 -0
  142. data/lib/starter_web/assets/image/module/attic/alice-donovan-rouse-2.jpg +0 -0
  143. data/lib/starter_web/assets/image/module/attic/building-blocks-1920x1280.jpg +0 -0
  144. data/lib/starter_web/assets/image/module/attic/christina-1920x1280.jpg +0 -0
  145. data/lib/starter_web/assets/image/module/attic/franck-1920x1280.jpg +0 -0
  146. data/lib/starter_web/assets/image/module/attic/giammarco-boscaro-1920x1280.jpg +0 -0
  147. data/lib/starter_web/assets/image/module/attic/jessica-ruscello-1920x1280.jpg +0 -0
  148. data/lib/starter_web/assets/image/module/attic/joanna-kosinska-1920x1280.jpg +0 -0
  149. data/lib/starter_web/assets/image/module/attic/leon-1920x1280.jpg +0 -0
  150. data/lib/starter_web/assets/image/module/attic/lianhao-1920x1280.jpg +0 -0
  151. data/lib/starter_web/assets/image/module/attic/library-1920x1280.jpg +0 -0
  152. data/lib/starter_web/assets/image/module/attic/markus-krisetya-1920x1280.jpg +0 -0
  153. data/lib/starter_web/assets/image/module/attic/markus-spiske-1920x1280.jpg +0 -0
  154. data/lib/starter_web/assets/image/module/attic/markus-spiske4-1920x1280.jpg +0 -0
  155. data/lib/starter_web/assets/image/module/attic/matthaeus-1920x1280.jpg +0 -0
  156. data/lib/starter_web/assets/image/module/attic/matthew-dockery-1920x1280.jpg +0 -0
  157. data/lib/starter_web/assets/image/module/attic/no-time-1920x1280.jpg +0 -0
  158. data/lib/starter_web/assets/image/module/attic/rirri-1920x1280.jpg +0 -0
  159. data/lib/starter_web/assets/image/module/attic/shubham-dhage-1920x1280.jpg +0 -0
  160. data/lib/starter_web/assets/image/module/attic/shutterstock_sponsor-1920x1280.jpg +0 -0
  161. data/lib/starter_web/assets/image/module/attic/sigmund-1920x1280.jpg +0 -0
  162. data/lib/starter_web/assets/image/module/attic/szabo-viktor-1920x1280.jpg +0 -0
  163. data/lib/starter_web/assets/image/module/attic/themes-1920x1280-bw.jpg +0 -0
  164. data/lib/starter_web/assets/image/module/attic/tldr-1920x800.jpg +0 -0
  165. data/lib/starter_web/assets/image/module/attic/vladislav-klapin-1920x1280.jpg +0 -0
  166. data/lib/starter_web/assets/image/module/attic/yellow-cactus-1920x1280.jpg +0 -0
  167. /data/assets/theme/j1/modules/videojs/plugins/players/vm/{LICENSE → js/old/LICENSE} +0 -0
  168. /data/assets/theme/j1/modules/videojs/plugins/players/vm/{README.md → js/old/README.md} +0 -0
@@ -2,25 +2,26 @@
2
2
  <html>
3
3
  <head>
4
4
  <link type="text/css" rel="stylesheet" href="../../../../css/videojs.min.css" />
5
+ <!-- script src="../../j1_core/template.min.js"></script -->
6
+ <script src="../../../../../log4javascript/js/log4javascript.min.js"></script>
7
+ <script src="../../../../../jquery/js/jquery.min.js"></script>
5
8
  </head>
6
- <body>
9
+ <body id="content" style="display: block;">
7
10
  <video
8
- id="vid1"
11
+ id="vid_x887s09"
9
12
  class="video-js vjs-default-skin"
10
13
  controls
11
14
  autoplay
12
- width="640" height="264"
15
+ width="640"
16
+ height="264"
13
17
  data-setup='{
14
18
  "techOrder": [
15
- "dailymotion",
16
- "html5"
19
+ "dailymotion", "html5"
17
20
  ],
18
- "sources": [
19
- {
21
+ "sources": [{
20
22
  "type": "video/dailymotion",
21
- "src": "https://www.dailymotion.com/video/x7t3la2"
22
- }
23
- ]
23
+ "src": "//dai.ly/x887s09"
24
+ }]
24
25
  }'
25
26
  >
26
27
  </video>
@@ -0,0 +1,647 @@
1
+ /*
2
+ # -----------------------------------------------------------------------------
3
+ # ~/assets/theme/j1/modules/videojs/js/plugins/players/dm/dailymotion.js
4
+ # Provides Dailymotion Playback Technology (Tech) for Video.js V8 and newer
5
+ #
6
+ # Product/Info:
7
+ # http://jekyll.one
8
+ #
9
+ # Copyright (C) 2020 John Law
10
+ # Copyright (C) 2023-2025 Juergen Adams
11
+ #
12
+ # videojs-dailymotion is licensed under MIT License.
13
+ # See: https://github.com/lawchihon/videojs-dailymotion/blob/master/LICENSE
14
+ # J1 Theme is licensed under MIT License.
15
+ # See: https://github.com/jekyll-one-org/j1-template/blob/main/LICENSE
16
+ # -----------------------------------------------------------------------------
17
+ */
18
+
19
+ /* Version 1.0, updated version for videoJS V8 + J1 Template */
20
+
21
+ /*global define, DM*/
22
+ (function (root, factory) {
23
+ if (typeof exports==='object' && typeof module!=='undefined') {
24
+ var videojs = require('video.js');
25
+ module.exports = factory(videojs.default || videojs);
26
+ } else if (typeof define === 'function' && define.amd) {
27
+ define(['videojs'], function(videojs){
28
+ return (root.Dailymotion = factory(videojs));
29
+ });
30
+ } else {
31
+ root.Dailymotion = factory(root.videojs);
32
+ }
33
+ }(this, function(videojs) {
34
+ 'use strict';
35
+
36
+ const isDev = (j1.env === "development" || j1.env === "dev") ? true : false;
37
+
38
+ var logger = log4javascript.getLogger('videoJS.plugin.dailymotion');
39
+ var _isOnMobile = videojs.browser.IS_IOS || videojs.browser.IS_ANDROID;
40
+ var Tech = videojs.getTech('Tech');
41
+
42
+ var startTimeModule;
43
+ var endTimeModule;
44
+
45
+ class Dailymotion extends Tech {
46
+
47
+ constructor(options, ready) {
48
+ super(options, ready);
49
+
50
+ this.setPoster(options.poster);
51
+ this.setSrc(this.options_.source, true);
52
+
53
+ // set the vjs-dailymotion class to the player's parent node,
54
+ // when is not set, wait a tick
55
+ var vm = this;
56
+ setTimeout(function() {
57
+ if (this.el_) {
58
+ this.el_.parentNode.className += ' vjs-dailymotion';
59
+
60
+ if (_isOnMobile) {
61
+ this.el_.parentNode.className += ' vjs-dailymotion-mobile';
62
+ }
63
+
64
+ if (Dailymotion.isSdkReady) {
65
+ vm.initDMPlayer();
66
+ } else {
67
+ Dailymotion.sdkReadyQueue.push(vm);
68
+ }
69
+ }
70
+ }.bind(this));
71
+ } // END Constructor
72
+
73
+ getPlayerParams() {
74
+ var playerParams = {
75
+ autoplay: false,
76
+ mute: false,
77
+ controls: false,
78
+ 'queue-autoplay-next': false,
79
+ 'queue-enable': false
80
+ };
81
+
82
+ // Let the user set any Dailymotion parameter
83
+ // https://developer.dailymotion.com/player/#player-parameters
84
+ // To use Dailymotion controls, you must use dmControls instead
85
+ var params = [
86
+ 'api', 'autoplay', 'autoplay-mute', 'id', 'mute', 'origin',
87
+ 'quality', 'queue-autoplay-next', 'queue-enable', 'sharing-enable',
88
+ 'start', 'subtitles-default', 'syndication', 'ui-highlight',
89
+ 'ui-logo','ui-start-screen-info', 'ui-theme', 'apimode',
90
+ 'playlist'
91
+ ];
92
+ var options = this.options_;
93
+
94
+ params.forEach((param) => {
95
+ if (typeof options[param] === 'undefined') {
96
+ return;
97
+ }
98
+ playerParams[param] = options[param];
99
+ });
100
+
101
+ if (typeof this.options_.dmControls !== 'undefined') {
102
+ playerParams.controls = this.options_.dmControls;
103
+ }
104
+
105
+ // Overwriting playlist if it is included in url
106
+ if (this.url && typeof this.url.playlist !== 'undefined') {
107
+ playerParams.playlist = this.url.playlist;
108
+ }
109
+
110
+ // Allow undocumented options to be passed along via customVars
111
+ if (typeof this.options_.customVars !== 'undefined') {
112
+ var customVars = this.options_.customVars;
113
+ Object.keys(customVars).forEach((key) => {
114
+ playerParams[key] = customVars[key];
115
+ });
116
+ }
117
+
118
+ return playerParams;
119
+ } // END getPlayerParams
120
+
121
+ getPlayerConfig() {
122
+ var playerConfig = {
123
+ width: '100%',
124
+ height: '100%',
125
+ params: this.getPlayerParams()
126
+ };
127
+
128
+ if (this.url && typeof this.url.video !== 'undefined') {
129
+ playerConfig.video = this.url.video;
130
+ } else if (typeof this.options_.video !== 'undefined') {
131
+ playerConfig.video = this.options_.video;
132
+ }
133
+
134
+ return playerConfig;
135
+ } // END getPlayerConfig
136
+
137
+ initDMPlayer() {
138
+ if (this.dmPlayer) {
139
+
140
+ // jadams, 2024-06-26:
141
+ this.dmPlayer.dmPlayerState = {
142
+ ended: false,
143
+ playing: false,
144
+ muted: false,
145
+ volume: 0,
146
+ progress: {
147
+ seconds: 0,
148
+ percent: 0,
149
+ duration: 0
150
+ }
151
+ };
152
+
153
+ return;
154
+ }
155
+
156
+ this.dmPlayer = new DM.player(
157
+ document.getElementById(this.options_.techId),
158
+ this.getPlayerConfig()
159
+ );
160
+ var vm = this;
161
+ this.isApiReady = false;
162
+ this.dmPlayer.addEventListener('apiready', () => {
163
+ vm.triggerReady();
164
+ vm.isApiReady = true;
165
+ });
166
+ this.dmPlayer.addEventListener('durationchange', () => {
167
+ vm.trigger('durationchange');
168
+ });
169
+ this.dmPlayer.addEventListener('end', () => {
170
+ vm.trigger('ended');
171
+ });
172
+ this.dmPlayer.addEventListener('error', () => {
173
+ vm.trigger('error');
174
+ });
175
+ this.dmPlayer.addEventListener('loadedmetadata', () => {
176
+ vm.trigger('loadeddata');
177
+ vm.trigger('loadedmetadata');
178
+ });
179
+ this.dmPlayer.addEventListener('pause', () =>{
180
+ vm.trigger('pause');
181
+ });
182
+ this.dmPlayer.addEventListener('play', () => {
183
+ // jadams, 2024-06-26:
184
+ // this.dmPlayer.dmPlayerState.playing = true;
185
+
186
+ vm.trigger('loadStart');
187
+ vm.trigger('play');
188
+ vm.trigger('playing');
189
+ vm.trigger('waiting');
190
+ });
191
+ this.dmPlayer.addEventListener('playback_ready', () => {
192
+ vm.trigger('loadeddata');
193
+ });
194
+ this.dmPlayer.addEventListener('timeupdate', () => {
195
+ vm.trigger('timeupdate');
196
+ });
197
+ this.dmPlayer.addEventListener('volumechange', () => {
198
+ vm.trigger('volumechange');
199
+ });
200
+
201
+ this.triggerReady();
202
+ isDev && logger.debug('\n' + 'created ' + this.name_ + ' player on ID: ' + vm.dmPlayer.id);
203
+ } // END initDMPlayer
204
+
205
+ autoplay(autoplay) {
206
+ if (typeof autoplay !== 'undefined') {
207
+ return this.setAutoplay(autoplay);
208
+ }
209
+
210
+ return this.options_.autoplay;
211
+ } // END autoplay
212
+
213
+ setAutoplay(val) {
214
+ return this.options_.autoplay = val;
215
+ } // END setAutoplay
216
+
217
+ buffered() {
218
+ if(!this.dmPlayer || !this.dmPlayer.bufferedTime) {
219
+ return videojs.time.createTimeRanges();
220
+ }
221
+
222
+ return videojs.time.createTimeRanges(0, this.dmPlayer.bufferedTime);
223
+ } // END buffered
224
+
225
+ createEl() {
226
+ var div = document.createElement('div');
227
+ div.setAttribute('id', this.options_.techId);
228
+ div.setAttribute('style', 'cursor: default; width:100%; height:100%; top:0; left:0; position:absolute');
229
+ div.setAttribute('class', 'vjs-tech');
230
+
231
+ var divWrapper = document.createElement('div');
232
+ divWrapper.appendChild(div);
233
+
234
+ return divWrapper;
235
+ } // END createEl
236
+
237
+ currentSrc() {
238
+ return this.source && this.source.src;
239
+ } // END currentSrc
240
+
241
+ currentTime(seconds) {
242
+ if (typeof seconds !== 'undefined') {
243
+ return this.setCurrentTime(seconds);
244
+ }
245
+
246
+ return this.dmPlayer && this.dmPlayer.currentTime;
247
+ } // END currentTime
248
+
249
+ setCurrentTime(seconds) {
250
+ if (!this.dmPlayer || !this.dmPlayer.seek) {
251
+ return;
252
+ }
253
+
254
+ return this.dmPlayer.seek(seconds);
255
+ } // END setCurrentTime
256
+
257
+ dispose() {
258
+ if (DM && DM.destroy) {
259
+ //Destroy the Dailymotion Player
260
+ DM.destroy(this.options_.techId);
261
+ } else {
262
+ //Dailymotion API hasn't finished loading or the player is already disposed
263
+ var index = Dailymotion.sdkReadyQueue.indexOf(this);
264
+ if (index !== -1) {
265
+ Dailymotion.sdkReadyQueue.splice(index, 1);
266
+ }
267
+ }
268
+ this.dmPlayer = undefined;
269
+
270
+ this.el_.parentNode.className = this.el_.parentNode.className
271
+ .replace(' vjs-dailymotion', '')
272
+ .replace(' vjs-dailymotion-mobile', '');
273
+ this.el_.parentNode.removeChild(this.el_);
274
+
275
+ // Needs to be called after the Dailymotion player is destroyed,
276
+ // otherwise there will be a undefined reference exception
277
+ Tech.prototype.dispose.call(this);
278
+ } // END dispose
279
+
280
+ duration(seconds) {
281
+ if (typeof seconds !== 'undefined') {
282
+ return this.setDuration(seconds);
283
+ }
284
+
285
+ return this.dmPlayer ? this.dmPlayer.duration : 0;
286
+ } // END duration
287
+
288
+ setDuration(seconds) {
289
+ if (!this.dmPlayer || !this.dmPlayer.seek) {
290
+ return;
291
+ }
292
+
293
+ return this.dmPlayer.seek(seconds);
294
+ } // END setDuration
295
+
296
+ ended() {
297
+ return this.dmPlayer && this.dmPlayer.ended;
298
+ } // END ended
299
+
300
+ enterFullWindow() {
301
+ if (!this.dmPlayer || !this.dmPlayer.setFullscreen) {
302
+ return;
303
+ }
304
+
305
+ return this.dmPlayer.setFullscreen(true);
306
+ } // END enterFullWindow
307
+
308
+ error() {
309
+ return this.dmPlayer && this.dmPlayer.error;
310
+ } // END error
311
+
312
+ exitFullscreen() {
313
+ if (!this.dmPlayer || !this.dmPlayer.setFullscreen) {
314
+ return;
315
+ }
316
+
317
+ return this.dmPlayer.setFullscreen(false);
318
+ } // END exitFullscreen
319
+
320
+ isFullscreen() {
321
+ return this.dmPlayer && this.dmPlayer.fullscreen;
322
+ } // END isFullscreen
323
+
324
+ // not supported by Dailymotion
325
+ language() {
326
+ return undefined;
327
+ } // END language
328
+
329
+ // not supported by Dailymotion
330
+ languages() {
331
+ return undefined;
332
+ } // END languages
333
+
334
+ load() {
335
+ if (!this.dmPlayer || !this.dmPlayer.load) {
336
+ return;
337
+ }
338
+
339
+ return this.dmPlayer.load(this.getPlayerConfig());
340
+ } // END load
341
+
342
+ // not supported by Dailymotion
343
+ loop() {
344
+ return undefined;
345
+ } // END loop
346
+
347
+ muted(muted) {
348
+ if (typeof muted !== undefined) {
349
+ return this.setMuted(muted);
350
+ }
351
+
352
+ return this.dmPlayer && this.dmPlayer.mute;
353
+ } // END muted
354
+
355
+ setMuted(mute) {
356
+ if (typeof mute === 'undefined' || !this.dmPlayer || !this.dmPlayer.setMuted) {
357
+ return;
358
+ }
359
+
360
+ if (mute) {
361
+ this.volumeBeforeMute = this.volume();
362
+ this.setVolume(0);
363
+ } else {
364
+ this.setVolume(this.volumeBeforeMute);
365
+ }
366
+
367
+ this.dmPlayer.setMuted(mute);
368
+ } // END setMuted
369
+
370
+ networkState() {
371
+ if (!this.dmPlayer || this.dmPlayer.error) {
372
+ return 0; //NETWORK_EMPTY
373
+ }
374
+
375
+ if (this.dmPlayer.seeking) {
376
+ return 2; //NETWORK_LOADING
377
+ }
378
+ } // END networkState
379
+
380
+ pause() {
381
+ if (!this.dmPlayer || !this.dmPlayer.pause) {
382
+ return;
383
+ }
384
+
385
+ return this.dmPlayer.pause();
386
+ } // END pause
387
+
388
+ paused() {
389
+ return this.dmPlayer && this.dmPlayer.paused;
390
+ } // END paused
391
+
392
+ play() {
393
+ if (!this.isApiReady || !this.dmPlayer || !this.dmPlayer.play) {
394
+ return;
395
+ }
396
+
397
+ this.trigger('loadStart');
398
+ this.trigger('waiting');
399
+ return this.dmPlayer.play();
400
+ } // END play
401
+
402
+ // not supported by Dailymotion
403
+ playbackRate() {
404
+ return 1;
405
+ } // END playbackRate
406
+
407
+ // not supported by Dailymotion
408
+ poster() {
409
+ return undefined;
410
+ } // END poster
411
+
412
+ // not supported by Dailymotion
413
+ preload() {
414
+ return undefined;
415
+ } // END preload
416
+
417
+ readyState() {
418
+ if (!this.dmPlayer || this.dmPlayer.error) {
419
+ return 0; //NETWORK_EMPTY
420
+ }
421
+
422
+ if (this.dmPlayer.seeking) {
423
+ return 1; //HAVE_METADATA
424
+ }
425
+ return 4; //HAVE_ENOUGH_DATA
426
+ } // END readyState
427
+
428
+ remainingTime() {
429
+ return this.dmPlayer && (this.dmPlayer.duration - this.dmPlayer.currentTime);
430
+ } // END remainingTime
431
+
432
+ requestFullscreen() {
433
+ return this.enterFullWindow();
434
+ } // END requestFullscreen
435
+
436
+ enterFullScreen() {
437
+ return this.enterFullWindow();
438
+ } // END enterFullScreen
439
+
440
+ reset() {
441
+ this.load();
442
+ } // END reset
443
+
444
+ seekable() {
445
+ if(!this.ytPlayer) {
446
+ return videojs.time.createTimeRanges();
447
+ }
448
+
449
+ return videojs.time.createTimeRanges(0, this.ytPlayer.getDuration());
450
+ } // END seekable
451
+
452
+ seeking() {
453
+ return this.dmPlayer && this.dmPlayer.seeking;
454
+ } // END seeking
455
+
456
+ src(source) {
457
+ if (typeof source !== 'undefined') {
458
+ return this.setSrc(source);
459
+ }
460
+
461
+ return this.source;
462
+ } // END src
463
+
464
+ setSrc(source) {
465
+ if (typeof source === 'undefined') {
466
+ return;
467
+ }
468
+
469
+ this.source = source;
470
+ this.url = Dailymotion.parseUrl(source.src || source);
471
+
472
+ // Load the video if sdk is ready
473
+ if (Dailymotion.isSdkReady) {
474
+ this.load();
475
+ }
476
+ return this.source;
477
+ } // END setSrc
478
+
479
+ supportsFullScreen() {
480
+ return true;
481
+ } // END supportsFullScreen
482
+
483
+ volume() {
484
+ return this.dmPlayer ? this.dmPlayer.volume : 1;
485
+ } // END volume
486
+
487
+ // if (DMPlayerState.playing === true) {
488
+ // setVolume(percentAsDecimal) {
489
+ // if (!this.dmPlayer || !this.dmPlayer.setMuted || !this.dmPlayer.setVolume) {
490
+ // return;
491
+ // }
492
+ //
493
+ // this.dmPlayer.setMuted(false);
494
+ // this.dmPlayer.setVolume(percentAsDecimal);
495
+ // } // END setVolume
496
+ // }
497
+
498
+ setVolume(percentAsDecimal) {
499
+ if (!this.dmPlayer || !this.dmPlayer.setMuted || !this.dmPlayer.setVolume) {
500
+ return;
501
+ }
502
+
503
+ // jadams, 2024-06-26:
504
+ // if (this.dmPlayer.dmPlayerState.playing === true) {
505
+ if (this.dmPlayer.apiReady) {
506
+ this.dmPlayer.setMuted(false);
507
+ this.dmPlayer.setVolume(percentAsDecimal);
508
+ }
509
+
510
+ } // END setVolume
511
+
512
+ } // END class Dailymotion
513
+
514
+ Dailymotion.isSupported = () => {
515
+ return true;
516
+ };
517
+
518
+ Dailymotion.canPlaySource = (event) => {
519
+ return Dailymotion.canPlayType(event.type);
520
+ };
521
+
522
+ Dailymotion.canPlayType = (event) => {
523
+ return (event === 'video/dailymotion');
524
+ };
525
+
526
+ Dailymotion.parseUrl = (url) => {
527
+ var result = {};
528
+
529
+ var regex = /video\/[^?|^\/]*/;
530
+ var match = url.match(regex);
531
+
532
+ if (match && match[0]) {
533
+ result.video = match[0].replace('video/', '');
534
+ }
535
+
536
+ var regPlaylist = /playlist(=|\/)[^&]*/;
537
+ match = url.match(regPlaylist);
538
+
539
+ if(match && match[0]) {
540
+ result.playlist = match[0].replace(/playlist(=|\/)/, '');
541
+ }
542
+
543
+ return result;
544
+ };
545
+
546
+ function apiLoaded() {
547
+ isDev && logger.debug('\n' + 'API loaded successfully');
548
+
549
+ Dailymotion.isSdkReady = true;
550
+
551
+ for (var i = 0; i < Dailymotion.sdkReadyQueue.length; ++i) {
552
+ Dailymotion.sdkReadyQueue[i].initDMPlayer();
553
+ }
554
+ isDev && logger.debug('\n' + 'created all players from queue: #' + i);
555
+
556
+ endTimeModule = Date.now();
557
+ isDev && logger.debug('\n' + 'initializing plugin: finished');
558
+ isDev && logger.debug('\n' + 'plugin initializing time: ' + (endTimeModule-startTimeModule) + 'ms');
559
+ } // END apiLoaded
560
+
561
+ function loadScript(src, callback) {
562
+ var loaded = false;
563
+ var tag = document.createElement('script');
564
+ var firstScriptTag = document.getElementsByTagName('script')[0];
565
+
566
+ if (!firstScriptTag) {
567
+ // when loaded in jest without jsdom setup it doesn't get any element.
568
+ // In jest it doesn't really make sense to do anything, because no one is watching dailymotion in jest
569
+ return;
570
+ }
571
+
572
+ firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
573
+ tag.onload = () => {
574
+ if (!loaded) {
575
+ loaded = true;
576
+ callback();
577
+ }
578
+ };
579
+
580
+ tag.onreadystatechange = () => {
581
+ if (!loaded && (this.readyState === 'complete' || this.readyState === 'loaded')) {
582
+ loaded = true;
583
+ callback();
584
+ }
585
+ };
586
+
587
+ tag.src = src;
588
+ } // END loadScript
589
+
590
+ function injectCss() {
591
+
592
+ const css = `
593
+ .vjs-dailymotion .vjs-iframe-blocker { display: none; }
594
+ .vjs-dailymotion.vjs-user-inactive .vjs-iframe-blocker { display: block; }
595
+ .vjs-dailymotion .vjs-poster { background-size: cover; }
596
+ .vjs-dailymotion-mobile .vjs-big-play-button { display: none; }
597
+ `;
598
+
599
+ var head = document.head || document.getElementsByTagName('head')[0];
600
+
601
+ var style = document.createElement('style');
602
+ style.setAttribute('type', 'text/css');
603
+
604
+ if (style.styleSheet){
605
+ style.styleSheet.cssText = css;
606
+ } else {
607
+ style.appendChild(document.createTextNode(css));
608
+ }
609
+
610
+ head.appendChild(style);
611
+ isDev && logger.debug('\n' + 'added additional CSS styles');
612
+ } // END injectCss
613
+
614
+ // Include the version number
615
+ Dailymotion.VERSION = '1.0.0';
616
+
617
+ Dailymotion.sdkReadyQueue = [];
618
+
619
+ // initialize plugin if page ready
620
+ // -------------------------------------------------------------------------
621
+ var dependencies_met_page_ready = setInterval (() => {
622
+ var pageState = $('#content').css("display");
623
+ var pageVisible = (pageState === 'block') ? true : false;
624
+ var j1CoreFinished = (j1.getState() === 'finished') ? true : false;
625
+
626
+ if (j1CoreFinished && pageVisible) {
627
+ startTimeModule = Date.now();
628
+
629
+ isDev && logger.debug('\n' + 'initializing plugin: started');
630
+ isDev && logger.debug('\n' + 'version of videoJS detected: ' + videojs.VERSION);
631
+
632
+ loadScript('//api.dmcdn.net/all.js', apiLoaded);
633
+ // loadScript('/assets/theme/j1/modules/videojs/plugins/players/dm/api/dailymotion.sdk.min.js', apiLoaded);
634
+ injectCss();
635
+
636
+ clearInterval(dependencies_met_page_ready);
637
+ } // END pageVisible
638
+ }, 10); // END dependencies_met_page_ready
639
+
640
+ // Older versions of VJS5 doesn't have the registerTech function
641
+ if (typeof videojs.registerTech !== 'undefined') {
642
+ videojs.registerTech('Dailymotion', Dailymotion);
643
+ } else {
644
+ videojs.registerComponent('Dailymotion', Dailymotion);
645
+ }
646
+
647
+ }));