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.
- checksums.yaml +4 -4
- data/assets/data/apps/amplitudehtml +1147 -0
- data/assets/data/apps/gallery.html +342 -0
- data/assets/data/{masonry.html → apps/masonry.html} +22 -9
- data/assets/data/apps/swiper.html +901 -0
- data/assets/data/masonry_app.html +521 -0
- data/assets/theme/j1/modules/lightGallery/css/theme/uno/uno.css +21 -13
- data/assets/theme/j1/modules/lightGallery/css/theme/uno/uno.min.css +1 -2
- data/assets/theme/j1/modules/lightGallery/js/lightgallery.js +14 -13
- data/assets/theme/j1/modules/lightGallery/js/lightgallery.min.js +1 -1
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-video.js +265 -226
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-video.min.js +1 -1
- data/assets/theme/j1/modules/videojs/css/themes/uno.css +12 -2
- data/assets/theme/j1/modules/videojs/css/videojs.css +2 -3
- data/assets/theme/j1/modules/videojs/css/videojs.min.css +1 -1
- data/assets/theme/j1/modules/videojs/plugins/controls/zoom/css/zoom.css +55 -55
- data/assets/theme/j1/modules/videojs/plugins/controls/zoom/css/zoom.min.css +2 -1
- data/assets/theme/j1/modules/videojs/plugins/controls/zoom/js/zoom.js +590 -382
- data/assets/theme/j1/modules/videojs/plugins/controls/zoom/js/zoom.min.js +1 -1
- data/assets/theme/j1/modules/videojs/plugins/j1_core/template.min.js +31 -0
- data/assets/theme/j1/modules/videojs/plugins/players/dm/!examples/{simple.html → index.html} +11 -10
- data/assets/theme/j1/modules/videojs/plugins/players/dm/js/dailymotion.0.js +647 -0
- data/assets/theme/j1/modules/videojs/plugins/players/dm/js/dailymotion.1.js +653 -0
- data/assets/theme/j1/modules/videojs/plugins/players/vm/!examples/{player → iframe_api}/index.html +3 -3
- data/assets/theme/j1/modules/videojs/plugins/players/vm/!examples/{index.html → videojs_api/index.html} +7 -3
- data/assets/theme/j1/modules/videojs/plugins/players/vm/api/js/v2.21.0/vimeo.js +3562 -0
- data/assets/theme/j1/modules/videojs/plugins/players/vm/api/js/v2.21.0/vimeo.min.js +36 -0
- data/assets/theme/j1/modules/videojs/plugins/players/vm/api/js/vimeo.js +451 -1849
- data/assets/theme/j1/modules/videojs/plugins/players/vm/api/js/vimeo.min.js +2 -14
- data/assets/theme/j1/modules/videojs/plugins/players/vm/js/LICENSE +21 -0
- data/assets/theme/j1/modules/videojs/plugins/players/vm/js/README.md +54 -0
- data/assets/theme/j1/modules/videojs/plugins/players/vm/js/old/vimeo.js +666 -0
- data/assets/theme/j1/modules/videojs/plugins/players/vm/js/old/vimeo.min.js +28 -0
- data/assets/theme/j1/modules/videojs/plugins/players/vm/js/vimeo.js +2318 -548
- data/assets/theme/j1/modules/videojs/plugins/players/vm/js/vimeo.min.js +12 -18
- data/assets/theme/j1/modules/videojs/plugins/players/yt/!examples/{simple.html → index.html} +15 -6
- data/assets/theme/j1/modules/videojs/plugins/players/yt/js/youtube.js +12 -5
- data/assets/theme/j1/modules/videojs/plugins/players/yt/js/youtube.min.js +1 -1
- data/lib/j1/version.rb +1 -1
- data/lib/starter_web/Gemfile +1 -1
- data/lib/starter_web/README.md +5 -5
- data/lib/starter_web/_config.yml +2 -2
- data/lib/starter_web/_data/blocks/banner.yml +1 -1
- data/lib/starter_web/_data/j1_config.yml +1 -1
- data/lib/starter_web/_data/layouts/home.yml +1 -1
- data/lib/starter_web/_data/modules/authentication.yml +1 -2
- data/lib/starter_web/_data/modules/defaults/masonry.yml +1 -1
- data/lib/starter_web/_data/modules/gallery.yml +35 -24
- data/lib/starter_web/_data/modules/log4javascript.yml +1 -1
- data/lib/starter_web/_data/modules/masonry.yml +30 -14
- data/lib/starter_web/_data/modules/navigator.yml +1 -1
- data/lib/starter_web/_data/modules/navigator_menu.yml +12 -8
- data/lib/starter_web/_data/templates/feed.xml +1 -1
- data/lib/starter_web/_plugins/asciidoctor/dailymotion-block.rb +206 -24
- data/lib/starter_web/_plugins/index/lunr.rb +1 -1
- data/lib/starter_web/assets/image/module/attic/1920x1280/admin-dashboard-bootstrap.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/1920x1280/alexander-redl.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/1920x1280/alexander-shatov.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/1920x1280/alexey-ruban.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/1920x1280/andrea-badino.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/1920x1280/bootstrap-modal.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/1920x1280/bp-miller.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/1920x1280/brad-neathery.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/1920x1280/brigitta-schneiter.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/1920x1280/build-with-gemini.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/1920x1280/clem-onojeghuo.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/1920x1280/eleni-afiontzi.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/1920x1280/fly-d.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/1920x1280/guillaume-bolduc.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/1920x1280/ideas-start-here-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/1920x1280/isaac-davis.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/1920x1280/j1-launch.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/1920x1280/j1-mockup.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/1920x1280/john-schnobrich-2.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/1920x1280/josep-martins.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/1920x1280/josh-liu.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/1920x1280/kelly-sikkemal.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/1920x1280/kira-auf-der-heide.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/1920x1280/kristopher-roller.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/1920x1280/markus-spiske.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/1920x1280/martin-sanchez.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/1920x1280/material_symbols.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/1920x1280/matthaeus.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/1920x1280/melanie-deziel.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/1920x1280/nasa.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/1920x1280/quino-al-2.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/1920x1280/stories-ink-tattoo-care.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/1920x1280/towfiqu-barbhuiya.jpg +0 -0
- data/lib/starter_web/collections/posts/public/featured/_posts/0000-00-00-welcome-to-j1.adoc.erb +1 -1
- data/lib/starter_web/collections/posts/public/featured/_posts/2022-02-01-about-j1.adoc +2 -2
- data/lib/starter_web/collections/posts/public/featured/_posts/2023-10-18-url-types.adoc +2 -2
- data/lib/starter_web/config.ru +1 -1
- data/lib/starter_web/dot.gitattributes +1 -1
- data/lib/starter_web/index.html +8 -8
- data/lib/starter_web/package.json +1 -1
- data/lib/starter_web/pages/public/about/features.adoc +5 -5
- data/lib/starter_web/pages/public/about/reporting_issues.adoc +5 -5
- data/lib/starter_web/pages/public/about/site.adoc +14 -10
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/000_intro.adoc +1 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/100_converter.adoc +1 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/200_themes.adoc +1 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/documentation.adoc +1 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/multi.adoc +1 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/simple-document/simple.adoc +1 -1
- data/lib/starter_web/pages/public/blog/navigator/archive/allview.html +1 -1
- data/lib/starter_web/pages/public/blog/navigator/archive/categoryview.html +1 -1
- data/lib/starter_web/pages/public/blog/navigator/archive/dateview.html +1 -1
- data/lib/starter_web/pages/public/blog/navigator/archive/tagview.html +1 -1
- data/lib/starter_web/pages/public/blog/navigator/index.html +1 -1
- data/lib/starter_web/pages/public/learn/bookshelf/article_previewer/viewer_biography.adoc +1 -1
- data/lib/starter_web/pages/public/learn/bookshelf/article_previewer/viewer_fantasy.adoc +1 -1
- data/lib/starter_web/pages/public/learn/bookshelf/article_previewer/viewer_romance.adoc +1 -1
- data/lib/starter_web/pages/public/learn/bookshelf/jekyll_collections.adoc +1 -1
- data/lib/starter_web/pages/public/learn/bookshelf/viewer_all_books.adoc +1 -1
- data/lib/starter_web/pages/public/learn/where_to_go.adoc +1 -1
- data/lib/starter_web/pages/public/legal/en/100_copyright.adoc +3 -3
- data/lib/starter_web/pages/public/legal/en/200_impress.adoc +3 -3
- data/lib/starter_web/pages/public/legal/en/300_privacy.adoc +3 -3
- data/lib/starter_web/pages/public/legal/en/400_comment_policy.adoc +3 -3
- data/lib/starter_web/pages/public/panels/intro_panel/panel.adoc +1 -4
- data/lib/starter_web/pages/public/plans/plans.adoc +1 -1
- data/lib/starter_web/pages/public/tools/previewer/preview_bootstrap_theme.adoc +1 -1
- data/lib/starter_web/pages/public/tools/tester/videojs_macro_tester.adoc +116 -43
- data/lib/starter_web/pages/public/tour/_includes/documents/419_advanced_modals_demo.asciidoc +1 -1
- data/lib/starter_web/pages/public/tour/video_data.adoc +28 -22
- metadata +25 -49
- data/assets/theme/j1/modules/videojs/plugins/players/dm/!examples/dailymotion-controls.html +0 -18
- data/assets/theme/j1/modules/videojs/plugins/players/dm/!examples/dailymotion-javascript.html +0 -28
- data/assets/theme/j1/modules/videojs/plugins/players/dm/!examples/dailymotion-playlist.html +0 -19
- data/assets/theme/j1/modules/videojs/plugins/players/dm/!examples/global-parameters.html +0 -30
- data/assets/theme/j1/modules/videojs/plugins/players/dm/!examples/switch.html +0 -39
- data/assets/theme/j1/modules/videojs/plugins/players/yt/!examples/global-parameters.html +0 -34
- data/assets/theme/j1/modules/videojs/plugins/players/yt/!examples/switch.html +0 -39
- data/assets/theme/j1/modules/videojs/plugins/players/yt/!examples/youtube-controls.html +0 -20
- data/assets/theme/j1/modules/videojs/plugins/players/yt/!examples/youtube-javascript.html +0 -29
- data/assets/theme/j1/modules/videojs/plugins/players/yt/!examples/youtube-list.html +0 -21
- data/assets/theme/j1/modules/videojs/plugins/players/yt/!examples/youtube-playlist.html +0 -21
- data/lib/starter_web/assets/image/module/attic/1920x1280/j1-content-mockup-2.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/1920x1280/j1-content-mockup-3.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/1920x1280/j1-starter-mockup-1.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/admin-dashboard-bootstrap-1280x600.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/alice-donovan-rouse-2.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/building-blocks-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/christina-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/franck-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/giammarco-boscaro-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/jessica-ruscello-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/joanna-kosinska-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/leon-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/lianhao-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/library-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/markus-krisetya-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/markus-spiske-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/markus-spiske4-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/matthaeus-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/matthew-dockery-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/no-time-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/rirri-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/shubham-dhage-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/shutterstock_sponsor-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/sigmund-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/szabo-viktor-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/themes-1920x1280-bw.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/tldr-1920x800.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/vladislav-klapin-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/yellow-cactus-1920x1280.jpg +0 -0
- /data/assets/theme/j1/modules/videojs/plugins/players/vm/{LICENSE → js/old/LICENSE} +0 -0
- /data/assets/theme/j1/modules/videojs/plugins/players/vm/{README.md → js/old/README.md} +0 -0
@@ -18,389 +18,597 @@
|
|
18
18
|
# -----------------------------------------------------------------------------
|
19
19
|
*/
|
20
20
|
|
21
|
-
/* global define, Zoom */
|
22
21
|
(function (global, factory) {
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
})(this, (function (videojs) {
|
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["@theonlyducks/videojs-zoom"] = factory(global.videojs));
|
25
|
+
})(this, (function (videojs) {
|
26
|
+
'use strict'
|
27
27
|
|
28
28
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
29
|
+
var videojs__default = /*#__PURE__*/_interopDefaultLegacy(videojs);
|
30
|
+
|
31
|
+
const Button = videojs.getComponent('Button');
|
32
|
+
const Plugin = videojs.getPlugin('plugin');
|
33
|
+
const Component = videojs.getComponent('Component');
|
34
|
+
|
35
|
+
const version = '1.3.6';
|
36
|
+
const ZOOM_SALT = 0.2;
|
37
|
+
|
38
|
+
const DEFAULT_OPTIONS = {
|
39
|
+
zoom: 1,
|
40
|
+
moveX: 0,
|
41
|
+
moveY: 0,
|
42
|
+
flip: "+",
|
43
|
+
rotate: 0,
|
44
|
+
showZoom: true,
|
45
|
+
showMove: true,
|
46
|
+
showRotate: true,
|
47
|
+
gestureHandler: false
|
48
|
+
};
|
49
|
+
|
50
|
+
class Observer {
|
51
|
+
static _instance = null;
|
52
|
+
|
53
|
+
constructor() {
|
54
|
+
this._listeners = [];
|
55
|
+
} // END constructor
|
56
|
+
|
57
|
+
static getInstance() {
|
58
|
+
if (!Observer._instance) {
|
59
|
+
Observer._instance = new Observer();
|
60
|
+
}
|
61
|
+
return Observer._instance;
|
62
|
+
}
|
63
|
+
|
64
|
+
subscribe(event, callback) {
|
65
|
+
this._listeners.push({
|
66
|
+
event,
|
67
|
+
callback
|
68
|
+
});
|
69
|
+
}
|
70
|
+
|
71
|
+
notify(event, data) {
|
72
|
+
this._listeners.forEach(listener => {
|
73
|
+
if (listener.event === event) {
|
74
|
+
return listener.callback(data);
|
75
|
+
}
|
76
|
+
});
|
77
|
+
}
|
78
|
+
} // END class Observer
|
79
|
+
|
80
|
+
class ZoomGesture extends Component {
|
81
|
+
|
82
|
+
constructor(player, options) {
|
83
|
+
super(player, options);
|
84
|
+
this._enabled = false;
|
85
|
+
this._observer = Observer.getInstance();
|
86
|
+
this.pointers = {};
|
87
|
+
this.player = player.el();
|
88
|
+
this.state = options.state;
|
89
|
+
this.function = new ZoomFunction(player, options);
|
90
|
+
|
91
|
+
player.on("loadstart", () => {
|
92
|
+
this.gesture();
|
93
|
+
});
|
94
|
+
|
95
|
+
this._observer.subscribe('plugin', state => {
|
96
|
+
this._enabled = state.enabled;
|
97
|
+
});
|
98
|
+
} // END constructor
|
99
|
+
|
100
|
+
// =====================================================================
|
101
|
+
// methods
|
102
|
+
// =====================================================================
|
103
|
+
|
104
|
+
gesture() {
|
105
|
+
this.player.addEventListener("pointerdown", event => {
|
106
|
+
this.pointers[event.pointerId] = event;
|
107
|
+
});
|
108
|
+
|
109
|
+
this.player.addEventListener("pointerup", event => {
|
110
|
+
delete this.pointers[event.pointerId];
|
111
|
+
this.player.firstChild.style.pointerEvents = "";
|
112
|
+
});
|
113
|
+
|
114
|
+
this.player.addEventListener("pointerleave", event => {
|
115
|
+
delete this.pointers[event.pointerId];
|
116
|
+
});
|
117
|
+
|
118
|
+
this.player.addEventListener("pointermove", event => {
|
119
|
+
if (!this._enabled) return;
|
120
|
+
if (!Object.keys(this.pointers).length) return;
|
121
|
+
this.player.firstChild.style.pointerEvents = "none";
|
122
|
+
const pointer = this.pointers[event.pointerId];
|
123
|
+
const moveX = event.clientX - pointer.clientX;
|
124
|
+
const moveY = event.clientY - pointer.clientY;
|
125
|
+
|
126
|
+
this.pointers[event.pointerId] = event;
|
127
|
+
this.function.moveY(moveX);
|
128
|
+
this.function.moveX(moveY);
|
129
|
+
});
|
130
|
+
|
131
|
+
this.player.addEventListener("wheel", event => {
|
132
|
+
event.preventDefault();
|
133
|
+
event.stopPropagation();
|
134
|
+
if (!this._enabled) return;
|
135
|
+
this.function.zoomHandler(-1e-2 * event.deltaY);
|
136
|
+
this.function.moveY(0);
|
137
|
+
this.function.moveX(0);
|
138
|
+
});
|
139
|
+
}
|
140
|
+
|
141
|
+
} // END class ZoomGesture
|
142
|
+
|
143
|
+
class ZoomFunction {
|
144
|
+
constructor(player, options) {
|
145
|
+
this.player = player.el();
|
146
|
+
this.plugin = options.plugin;
|
147
|
+
this.observer = Observer.getInstance();
|
148
|
+
player.on('playing', () => {
|
149
|
+
this._updateSalt();
|
150
|
+
});
|
151
|
+
|
152
|
+
this.observer.subscribe('change', state => {
|
153
|
+
this.state = {
|
154
|
+
...state,
|
155
|
+
saltMoveX: 70,
|
156
|
+
saltMoveY: 70
|
157
|
+
};
|
158
|
+
this._updateSalt();
|
159
|
+
});
|
160
|
+
} // END constructor
|
161
|
+
|
162
|
+
// =====================================================================
|
163
|
+
// methods
|
164
|
+
// =====================================================================
|
165
|
+
|
166
|
+
_updateSalt() {
|
167
|
+
this.state.saltMoveX = this.player.offsetWidth * ZOOM_SALT / 2;
|
168
|
+
this.state.saltMoveY = this.player.offsetHeight * ZOOM_SALT / 2;
|
169
|
+
}
|
170
|
+
|
171
|
+
_zoom() {
|
172
|
+
this.plugin.zoom(this.state.zoom);
|
173
|
+
this.plugin.listeners.change(this.state);
|
174
|
+
}
|
175
|
+
|
176
|
+
zoomIn() {
|
177
|
+
if (this.state.zoom >= 9.8) return;
|
178
|
+
this.state.moveCount++;
|
179
|
+
this.state.zoom += ZOOM_SALT;
|
180
|
+
this.plugin.zoom(this.state.zoom);
|
181
|
+
this.plugin.listeners.change(this.state);
|
182
|
+
}
|
183
|
+
|
184
|
+
zoomOut() {
|
185
|
+
if (this.state.zoom <= 1) return;
|
186
|
+
this.state.moveCount--;
|
187
|
+
this.state.zoom -= ZOOM_SALT;
|
188
|
+
this.plugin.zoom(this.state.zoom);
|
189
|
+
this.plugin.move(0, 0);
|
190
|
+
this.plugin.listeners.change(this.state);
|
191
|
+
}
|
192
|
+
|
193
|
+
_move() {
|
194
|
+
this.plugin.move(this.state.moveX, this.state.moveY);
|
195
|
+
this.plugin.listeners.change(this.state);
|
196
|
+
}
|
197
|
+
|
198
|
+
moveUp() {
|
199
|
+
const next = this.state.moveY + this.state.saltMoveY;
|
200
|
+
const available = this.state.moveCount * this.state.saltMoveY;
|
201
|
+
if (available < next) return;
|
202
|
+
this._updateSalt();
|
203
|
+
this.state.moveY += this.state.saltMoveY;
|
204
|
+
this._move();
|
205
|
+
}
|
206
|
+
|
207
|
+
moveDown() {
|
208
|
+
const next = this.state.moveY - this.state.saltMoveY;
|
209
|
+
const available = this.state.moveCount * this.state.saltMoveY;
|
210
|
+
if (-available > next) return;
|
211
|
+
this._updateSalt();
|
212
|
+
this.state.moveY -= this.state.saltMoveY;
|
213
|
+
this._move();
|
214
|
+
}
|
215
|
+
|
216
|
+
moveX(salt) {
|
217
|
+
const available = this._getMoveYAvailable();
|
218
|
+
this.state.moveY = Math.max(-available, Math.min(available, this.state.moveY + salt));
|
219
|
+
this._move();
|
220
|
+
}
|
221
|
+
|
222
|
+
reset() {
|
223
|
+
this.state.zoom = 1;
|
224
|
+
this.state.moveX = 0;
|
225
|
+
this.state.moveY = 0;
|
226
|
+
this.state.rotate = 0;
|
227
|
+
this.state.moveCount = 0;
|
228
|
+
this.plugin.zoom(1);
|
229
|
+
this.plugin.flip("+");
|
230
|
+
this.plugin.rotate(0);
|
231
|
+
this.plugin.move(0, 0);
|
232
|
+
this.plugin.listeners.change(this.state);
|
233
|
+
}
|
234
|
+
|
235
|
+
moveLeft() {
|
236
|
+
const next = this.state.moveX + this.state.saltMoveX;
|
237
|
+
const available = this.state.moveCount * this.state.saltMoveX;
|
238
|
+
if (available < next) return;
|
239
|
+
this._updateSalt();
|
240
|
+
this.state.moveX += this.state.saltMoveX;
|
241
|
+
this._move();
|
242
|
+
}
|
243
|
+
|
244
|
+
moveRight() {
|
245
|
+
const next = this.state.moveX - this.state.saltMoveX;
|
246
|
+
const available = this.state.moveCount * this.state.saltMoveX;
|
247
|
+
if (-available > next) return;
|
248
|
+
this._updateSalt();
|
249
|
+
this.state.moveX -= this.state.saltMoveX;
|
250
|
+
this._move();
|
251
|
+
}
|
252
|
+
|
253
|
+
moveY(salt) {
|
254
|
+
const available = this._getMoveXAvailable();
|
255
|
+
this.state.moveX = Math.max(-available, Math.min(available, this.state.moveX + salt));
|
256
|
+
this._move();
|
257
|
+
}
|
258
|
+
|
259
|
+
_rotate() {
|
260
|
+
this.plugin.rotate(this.state.rotate);
|
261
|
+
this.plugin.listeners.change(this.state);
|
262
|
+
}
|
263
|
+
|
264
|
+
rotate() {
|
265
|
+
this.state.rotate -= 90;
|
266
|
+
if (this.state.rotate === -360) {
|
267
|
+
this.state.rotate = 0;
|
268
|
+
}
|
269
|
+
this._rotate();
|
270
|
+
}
|
271
|
+
|
272
|
+
_flip() {
|
273
|
+
this.plugin.flip(this.state.flip);
|
274
|
+
this.plugin.listeners.change(this.state);
|
275
|
+
}
|
276
|
+
|
277
|
+
flip() {
|
278
|
+
this.state.flip = this.state.flip === "+" ? "-" : "+";
|
279
|
+
this._flip();
|
280
|
+
}
|
281
|
+
|
282
|
+
} // END class ZoomFunction
|
283
|
+
|
284
|
+
class ZoomModalContent {
|
285
|
+
constructor() {
|
286
|
+
this.content = null;
|
287
|
+
this._createContent();
|
288
|
+
} // END constructor
|
289
|
+
|
290
|
+
// =====================================================================
|
291
|
+
// methods
|
292
|
+
// =====================================================================
|
293
|
+
|
294
|
+
getContent() {
|
295
|
+
return this.content;
|
296
|
+
}
|
297
|
+
|
298
|
+
_createContent() {
|
299
|
+
const zoom = `
|
300
|
+
<div class="vjs-zoom-buttons__container--row">
|
301
|
+
<button id="vjs-zoom-buttons__zoomIn" class="vjs-zoom-buttons__button">
|
302
|
+
<span class="vjs-zoom-icons">add</span>
|
303
|
+
</button>
|
304
|
+
<span class="vjs-zoom-buttons__space"></span>
|
305
|
+
<button id="vjs-zoom-buttons__zoomOut" class="vjs-zoom-buttons__button">
|
306
|
+
<span class="vjs-zoom-icons">remove</span>
|
307
|
+
</button>
|
308
|
+
</div>
|
309
|
+
`;
|
310
|
+
|
311
|
+
const move = `
|
312
|
+
<div class="vjs-zoom-buttons__container--row">
|
313
|
+
<span class="vjs-zoom-buttons__space"></span>
|
314
|
+
<button id="vjs-zoom-buttons__moveUp" class="vjs-zoom-buttons__button">
|
315
|
+
<span class="vjs-zoom-icons">arrow_drop_up</span>
|
316
|
+
</button>
|
317
|
+
<span class="vjs-zoom-buttons__space"></span>
|
318
|
+
</div>
|
319
|
+
<div class="vjs-zoom-buttons__container--row">
|
320
|
+
<button id="vjs-zoom-buttons__moveLeft" class="vjs-zoom-buttons__button">
|
321
|
+
<span class="vjs-zoom-icons">arrow_left</span>
|
322
|
+
</button>
|
323
|
+
<button id="vjs-zoom-buttons__reset" class="vjs-zoom-buttons__button">
|
324
|
+
<span class="vjs-zoom-icons">fiber_manual_record</span>
|
325
|
+
</button>
|
326
|
+
<button id="vjs-zoom-buttons__moveRight" class="vjs-zoom-buttons__button">
|
327
|
+
<span class="vjs-zoom-icons">arrow_right</span>
|
328
|
+
</button>
|
329
|
+
</div>
|
330
|
+
<div class="vjs-zoom-buttons__container--row">
|
331
|
+
<span class="vjs-zoom-buttons__space"></span>
|
332
|
+
<button id="vjs-zoom-buttons__moveDown" class="vjs-zoom-buttons__button">
|
333
|
+
<span class="vjs-zoom-icons">arrow_drop_down</span>
|
334
|
+
</button>
|
335
|
+
<span class="vjs-zoom-buttons__space"></span>
|
336
|
+
</div>
|
337
|
+
`;
|
338
|
+
|
339
|
+
const rotate = `
|
340
|
+
<div class="vjs-zoom-buttons__container--row">
|
341
|
+
<button id="vjs-zoom-buttons__rotate" class="vjs-zoom-buttons__button">
|
342
|
+
<span class="vjs-zoom-icons">rotate_left</span>
|
343
|
+
</button>
|
344
|
+
<span class="vjs-zoom-buttons__space"></span>
|
345
|
+
<button id="vjs-zoom-buttons__flip" class="vjs-zoom-buttons__button">
|
346
|
+
<span class="vjs-zoom-icons">swap_horiz</span>
|
347
|
+
</button>
|
348
|
+
</div>
|
349
|
+
`;
|
350
|
+
|
351
|
+
var mergeOptions = (videojs.VERSION <= "7.10.0") ? videojs.mergeOptions : videojs.obj.merge
|
352
|
+
var options = mergeOptions(DEFAULT_OPTIONS, options);
|
353
|
+
this.content = '';
|
354
|
+
|
355
|
+
if (options.showZoom) {
|
356
|
+
this.content += zoom;
|
357
|
+
}
|
358
|
+
|
359
|
+
if (options.showMove) {
|
360
|
+
this.content += move;
|
361
|
+
}
|
362
|
+
|
363
|
+
if (options.showRotate) {
|
364
|
+
this.content += rotate;
|
365
|
+
}
|
366
|
+
|
367
|
+
} // END _createContent
|
368
|
+
|
369
|
+
_createContent_old() {
|
370
|
+
this.content = `
|
371
|
+
<div class="vjs-zoom-buttons__container--row">
|
372
|
+
<button id="vjs-zoom-buttons__zoomIn" class="vjs-zoom-buttons__button">
|
373
|
+
<span class="vjs-zoom-icons">add</span>
|
374
|
+
</button>
|
375
|
+
<span class="vjs-zoom-buttons__space"></span>
|
376
|
+
<button id="vjs-zoom-buttons__zoomOut" class="vjs-zoom-buttons__button">
|
377
|
+
<span class="vjs-zoom-icons">remove</span>
|
378
|
+
</button>
|
379
|
+
</div>
|
380
|
+
<div class="vjs-zoom-buttons__container--row">
|
381
|
+
<span class="vjs-zoom-buttons__space"></span>
|
382
|
+
<button id="vjs-zoom-buttons__moveUp" class="vjs-zoom-buttons__button">
|
383
|
+
<span class="vjs-zoom-icons">arrow_drop_up</span>
|
384
|
+
</button>
|
385
|
+
<span class="vjs-zoom-buttons__space"></span>
|
386
|
+
</div>
|
387
|
+
<div class="vjs-zoom-buttons__container--row">
|
388
|
+
<button id="vjs-zoom-buttons__moveLeft" class="vjs-zoom-buttons__button">
|
389
|
+
<span class="vjs-zoom-icons">arrow_left</span>
|
390
|
+
</button>
|
391
|
+
<button id="vjs-zoom-buttons__reset" class="vjs-zoom-buttons__button">
|
392
|
+
<span class="vjs-zoom-icons">fiber_manual_record</span>
|
393
|
+
</button>
|
394
|
+
<button id="vjs-zoom-buttons__moveRight" class="vjs-zoom-buttons__button">
|
395
|
+
<span class="vjs-zoom-icons">arrow_right</span>
|
396
|
+
</button>
|
397
|
+
</div>
|
398
|
+
<div class="vjs-zoom-buttons__container--row">
|
399
|
+
<span class="vjs-zoom-buttons__space"></span>
|
400
|
+
<button id="vjs-zoom-buttons__moveDown" class="vjs-zoom-buttons__button">
|
401
|
+
<span class="vjs-zoom-icons">arrow_drop_down</span>
|
402
|
+
</button>
|
403
|
+
<span class="vjs-zoom-buttons__space"></span>
|
404
|
+
</div>
|
405
|
+
<div class="vjs-zoom-buttons__container--row">
|
406
|
+
<button id="vjs-zoom-buttons__rotate" class="vjs-zoom-buttons__button">
|
407
|
+
<span class="vjs-zoom-icons">rotate_left</span>
|
408
|
+
</button>
|
409
|
+
<span class="vjs-zoom-buttons__space"></span>
|
410
|
+
<button id="vjs-zoom-buttons__flip" class="vjs-zoom-buttons__button">
|
411
|
+
<span class="vjs-zoom-icons">swap_horiz</span>
|
412
|
+
</button>
|
413
|
+
</div>
|
414
|
+
`;
|
415
|
+
}
|
416
|
+
|
417
|
+
} // END class ZoomModalContent
|
418
|
+
|
419
|
+
class ZoomModal extends Component {
|
420
|
+
constructor(player, options) {
|
421
|
+
super(player, options);
|
422
|
+
this.player = player.el();
|
423
|
+
this.plugin = options.plugin;
|
424
|
+
this.function = new ZoomFunction(player, options);
|
425
|
+
|
426
|
+
player.on('playing', () => {
|
427
|
+
this.listeners();
|
428
|
+
});
|
429
|
+
} // END constructor
|
430
|
+
|
431
|
+
// =====================================================================
|
432
|
+
// methods
|
433
|
+
// =====================================================================
|
434
|
+
|
435
|
+
createEl() {
|
436
|
+
const modal = videojs.dom.createEl('div', {
|
437
|
+
className: 'vjs-zoom-buttons__container'
|
438
|
+
});
|
439
|
+
const content = new ZoomModalContent();
|
440
|
+
modal.innerHTML = content.getContent();
|
441
|
+
|
442
|
+
return modal;
|
443
|
+
}
|
444
|
+
|
445
|
+
listeners() {
|
446
|
+
var buttons = this.player.getElementsByClassName('vjs-zoom-buttons__button');
|
447
|
+
buttons = Array.from(buttons);
|
448
|
+
|
449
|
+
buttons.map(button => {
|
450
|
+
const [, action] = button.id.split('__');
|
451
|
+
button.onclick = () => this.function[action]();
|
452
|
+
});
|
453
|
+
}
|
454
|
+
|
455
|
+
toggle() {
|
456
|
+
const [modal] = this.player.getElementsByClassName('vjs-zoom-buttons__container');
|
457
|
+
modal.classList.toggle('open');
|
458
|
+
|
459
|
+
this.plugin.listeners.click();
|
460
|
+
}
|
461
|
+
|
462
|
+
open() {
|
463
|
+
const [modal] = this.player.getElementsByClassName('vjs-zoom-buttons__container');
|
464
|
+
modal.classList.add('open');
|
465
|
+
|
466
|
+
this.plugin.listeners.click();
|
467
|
+
}
|
468
|
+
|
469
|
+
close() {
|
470
|
+
const [modal] = this.player.getElementsByClassName('vjs-zoom-buttons__container');
|
471
|
+
modal.classList.remove('open');
|
472
|
+
|
473
|
+
this.plugin.listeners.click();
|
474
|
+
}
|
475
|
+
|
476
|
+
} // END class ZoomModal
|
477
|
+
|
478
|
+
class ZoomButton extends Button {
|
479
|
+
constructor(player, options) {
|
480
|
+
super(player, options);
|
481
|
+
this.isOpen = false;
|
482
|
+
|
483
|
+
player.on('useractive', () => {
|
484
|
+
if (!this.isOpen) return;
|
485
|
+
const modal = this.player().getChild('ZoomModal');
|
486
|
+
modal.open();
|
487
|
+
});
|
488
|
+
|
489
|
+
player.on('userinactive', () => {
|
490
|
+
if (!this.isOpen) return;
|
491
|
+
const modal = this.player().getChild('ZoomModal');
|
492
|
+
modal.close();
|
493
|
+
});
|
494
|
+
} // END constructor
|
495
|
+
|
496
|
+
// =====================================================================
|
497
|
+
// methods
|
498
|
+
// =====================================================================
|
499
|
+
|
500
|
+
buildCSSClass() {
|
501
|
+
return `vjs-zoom-buttons ${super.buildCSSClass()}`;
|
502
|
+
}
|
503
|
+
|
504
|
+
handleClick() {
|
505
|
+
const modal = this.player().getChild('ZoomModal');
|
506
|
+
videojs.log('[~Zoom Plugin] button handleClick');
|
507
|
+
this.isOpen = !this.isOpen;
|
508
|
+
modal.toggle();
|
509
|
+
}
|
510
|
+
|
511
|
+
} // END class ZoomButton
|
512
|
+
|
513
|
+
class zoomButtons extends Plugin {
|
514
|
+
constructor(player) {
|
515
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
516
|
+
|
517
|
+
super(player, options);
|
518
|
+
videojs.log('[~Zoom Plugin] start ', options);
|
519
|
+
this.player = player.el();
|
520
|
+
|
521
|
+
this.listeners = {
|
522
|
+
click: () => {},
|
523
|
+
change: () => {}
|
524
|
+
};
|
525
|
+
|
526
|
+
// Use built-in merge function from Video.js v5.0+ or v4.4.0+
|
527
|
+
// videojs.mergeOptions is deprecated in V8 and will be removed in V9
|
528
|
+
var mergeOptions = (videojs.VERSION <= "7.10.0") ? videojs.mergeOptions : videojs.obj.merge;
|
529
|
+
|
530
|
+
this.state = mergeOptions(DEFAULT_OPTIONS, options);
|
531
|
+
this.player.style.overflow = 'hidden';
|
532
|
+
this.state.flip = "+";
|
533
|
+
this.state.moveCount = Math.round((this.state.zoom - 1) / ZOOM_SALT);
|
534
|
+
|
535
|
+
player.getChild('ControlBar').addChild('ZoomButton');
|
536
|
+
|
537
|
+
player.addChild('ZoomModal', {
|
538
|
+
plugin: this,
|
539
|
+
state: this.state
|
540
|
+
});
|
541
|
+
|
542
|
+
player.addChild('ZoomGesture', {
|
543
|
+
plugin: this,
|
544
|
+
state: this.state
|
545
|
+
});
|
546
|
+
|
547
|
+
this._observer = Observer.getInstance();
|
548
|
+
this._observer.notify("plugin", { enabled: this._enabled });
|
549
|
+
this._setTransform();
|
550
|
+
|
551
|
+
} // END constructor
|
552
|
+
|
553
|
+
// =====================================================================
|
554
|
+
// methods
|
555
|
+
// =====================================================================
|
556
|
+
|
557
|
+
zoom(value) {
|
558
|
+
if (value <= 0) {
|
559
|
+
throw new Error('Zoom value invalid');
|
560
|
+
}
|
561
|
+
this.state.zoom = value;
|
562
|
+
this.state.moveCount = Math.round((this.state.zoom - 1) / ZOOM_SALT);
|
563
|
+
this._setTransform();
|
564
|
+
}
|
565
|
+
|
566
|
+
rotate(value) {
|
567
|
+
this.state.rotate = value;
|
568
|
+
this._setTransform();
|
569
|
+
}
|
570
|
+
|
571
|
+
move(x, y) {
|
572
|
+
this.state.moveX = x;
|
573
|
+
this.state.moveY = y;
|
574
|
+
this._setTransform();
|
575
|
+
}
|
576
|
+
|
577
|
+
flip(signal) {
|
578
|
+
this.state.flip = signal;
|
579
|
+
this._setTransform();
|
580
|
+
}
|
581
|
+
|
582
|
+
toggle() {
|
583
|
+
const [modal] = this.player.getElementsByClassName('vjs-zoom-buttons__container');
|
584
|
+
modal.classList.toggle('open');
|
585
|
+
}
|
586
|
+
|
587
|
+
listen(listener, callback) {
|
588
|
+
this.listeners[listener] = callback;
|
589
|
+
}
|
590
|
+
|
591
|
+
_notify() {
|
592
|
+
this._observer.notify('change', this.state);
|
593
|
+
}
|
594
|
+
_setTransform() {
|
595
|
+
const [video] = this.player.getElementsByTagName('video');
|
596
|
+
video.style.transform = `
|
597
|
+
translate(${this.state.moveX}px, ${this.state.moveY}px)
|
598
|
+
scale(${this.state.flip}${this.state.zoom}, ${this.state.zoom})
|
599
|
+
rotate(${this.state.rotate}deg)
|
600
|
+
`;
|
601
|
+
this._notify();
|
602
|
+
}
|
603
|
+
|
604
|
+
} // END class zoomButtons
|
605
|
+
|
606
|
+
// register components|plugin
|
607
|
+
//
|
608
|
+
videojs.registerComponent('ZoomModal', ZoomModal);
|
609
|
+
videojs.registerComponent('ZoomGesture', ZoomGesture);
|
610
|
+
videojs.registerComponent('ZoomButton', ZoomButton);
|
611
|
+
videojs.registerPlugin('zoomButtons', zoomButtons);
|
612
|
+
|
613
|
+
return zoomButtons;
|
406
614
|
}));
|