j1-template 2024.3.26 → 2024.3.28
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/banner.html +3 -1
- data/assets/theme/j1/adapter/js/masonry.js +6 -8
- data/assets/theme/j1/adapter/js/videojs.js +8 -6
- data/assets/theme/j1/core/js/template.js +28 -1
- data/assets/theme/j1/core/js/template.min.js +4 -4
- data/assets/theme/j1/modules/lightGallery/js/lightgallery.js +4 -2
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-autoplay.js +6 -3
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-comment.js +6 -3
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-fullscreen.js +6 -3
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-hash.js +6 -3
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-medium-zoom.js +6 -3
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-pager.js +6 -3
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-relative-caption.js +6 -3
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-rotate.js +6 -4
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-share.js +6 -3
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-thumbnail.js +6 -3
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-video.js +232 -100
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-video.min.js +1 -1
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-vimeo-thumbnail.js +6 -3
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-zoom.js +6 -3
- data/assets/theme/j1/modules/videojs/css/themes/uno.css +1 -2
- data/assets/theme/j1/modules/videojs/plugins/players/yt/js/youtube.js +21 -6
- 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/README.md +5 -5
- data/lib/starter_web/_config.yml +1 -1
- data/lib/starter_web/_data/blocks/banner.yml +29 -18
- data/lib/starter_web/_data/blocks/panel.yml +79 -124
- data/lib/starter_web/_data/modules/blog_navigator.yml +1 -1
- data/lib/starter_web/_data/modules/defaults/blog_navigator.yml +2 -2
- data/lib/starter_web/_data/modules/gallery.yml +145 -19
- data/lib/starter_web/_data/modules/masonry.yml +9 -10
- data/lib/starter_web/_data/templates/feed.xml +1 -1
- data/lib/starter_web/_includes/attributes.asciidoc +2 -1
- data/lib/starter_web/_plugins/index/lunr.rb +1 -1
- data/lib/starter_web/assets/image/module/attic/1920x1280/nick-fewings.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/1920x1280/no-revisions.jpg +0 -0
- data/lib/starter_web/assets/image/module/attic/1920x1280/wolfgang-weiser.jpg +0 -0
- data/lib/starter_web/assets/image/page/features/example-content-1280x800.jpg +0 -0
- data/lib/starter_web/assets/image/page/features/google-lighthouse-1080x300.jpg +0 -0
- data/lib/starter_web/assets/image/page/features/google-lighthouse-scores.jpg +0 -0
- data/lib/starter_web/assets/image/page/features/master-header-1280x600.jpg +0 -0
- data/lib/starter_web/assets/image/page/features/nav-module-1280x300.jpg +0 -0
- data/lib/starter_web/assets/image/page/features/teaser-banner-1280x600.jpg +0 -0
- data/lib/starter_web/assets/image/page/features/tts-1280x500.jpg +0 -0
- data/lib/starter_web/assets/video/tracks/html5/peck_pocketed/captions/video.vtt +2 -3
- data/lib/starter_web/assets/video/tracks/html5/peck_pocketed/chapters/video.vtt +4 -6
- data/lib/starter_web/collections/posts/public/featured/_posts/0000-00-00-welcome-to-j1.adoc.erb +18 -20
- data/lib/starter_web/collections/posts/public/featured/_posts/2021-01-01-about-cookies.adoc +6 -7
- data/lib/starter_web/collections/posts/public/featured/_posts/{2023-10-18-url-types.adoc → 2022-10-18-url-types.adoc} +7 -4
- data/lib/starter_web/collections/posts/public/featured/_posts/{2021-02-01-static-site-generators.adoc → 2023-02-01-static-site-generators.adoc} +5 -6
- data/lib/starter_web/collections/posts/public/featured/_posts/{2022-02-01-about-j1.adoc → 2024-02-01-about-j1.adoc} +4 -5
- data/lib/starter_web/index.html +17 -73
- data/lib/starter_web/package.json +1 -1
- data/lib/starter_web/pages/public/features/{general.adoc → core-features.adoc} +92 -47
- data/lib/starter_web/pages/public/features/{template.adoc → theme-features.adoc} +313 -195
- data/lib/starter_web/pages/public/tools/tester/app_tester_amplitudejs_yt.adoc +2 -2
- data/lib/starter_web/pages/public/tools/tester/app_tester_swiperjs.adoc +10 -15
- data/lib/starter_web/pages/public/tools/tester/videojs_macro_tester.adoc +107 -102
- data/lib/starter_web/pages/public/tour/asciidoc_extensions.adoc +13 -21
- data/lib/starter_web/pages/public/tour/audio_data.adoc +2 -2
- data/lib/starter_web/pages/public/tour/icon_fonts.adoc +1 -1
- data/lib/starter_web/pages/public/tour/image_data.adoc +138 -234
- data/lib/starter_web/pages/public/tour/responsive_tables.adoc +1 -1
- data/lib/starter_web/pages/public/tour/video_data.adoc +74 -85
- metadata +12 -9
- data/lib/starter_web/assets/image/module/attic/cookies-1920x1200.jpg +0 -0
- data/lib/starter_web/pages/public/tour/modal_extentions.adoc +0 -126
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
# -----------------------------------------------------------------------------
|
3
|
-
# ~/assets/theme/j1/modules/lightGallery/js/plugins/lg-video.js
|
3
|
+
# ~/assets/theme/j1/modules/lightGallery/js/plugins/lg-video.js (5)
|
4
4
|
# Provides lightGallery v2.8.3 JS code for the plugin lgVideo
|
5
5
|
#
|
6
6
|
# Product/Info:
|
@@ -30,7 +30,8 @@
|
|
30
30
|
}(this, (function () {
|
31
31
|
'use strict';
|
32
32
|
|
33
|
-
/*!
|
33
|
+
/*!
|
34
|
+
****************************************************************************
|
34
35
|
Copyright (c) Microsoft Corporation.
|
35
36
|
|
36
37
|
Permission to use, copy, modify, and/or distribute this software for any
|
@@ -43,7 +44,8 @@
|
|
43
44
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
44
45
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
45
46
|
PERFORMANCE OF THIS SOFTWARE.
|
46
|
-
|
47
|
+
****************************************************************************
|
48
|
+
*/
|
47
49
|
|
48
50
|
var __assign = function() {
|
49
51
|
__assign = Object.assign || function __assign(t) {
|
@@ -232,20 +234,136 @@
|
|
232
234
|
// -------------------------------------------------------------------------
|
233
235
|
var vjsProcessExtendedButtonsAndPlugins = function (vjsObject, videojsPlayer, videoInfo) {
|
234
236
|
const vjsOptions = j1.modules.videojs.options;
|
235
|
-
var dependency_met_module_ready, videoInfo,
|
236
|
-
|
237
|
-
|
237
|
+
var dependency_met_module_ready, videoInfo, playerState,
|
238
|
+
videoStart, videojsPlayer, playbackRates,
|
239
|
+
hotKeysPlugin, skipButtonsPlugin, zoomPlugin;
|
238
240
|
|
239
|
-
dependency_met_module_ready = setInterval (() => {
|
240
|
-
var isModuleInitialised = (j1.adapter.gallery.getState() === 'finished') ? true : false;
|
241
|
-
var isVideojsOptions = (isEmpty(vjsObject.settings.videojsOptions)) ? false : true;
|
242
241
|
|
243
|
-
|
244
|
-
|
245
|
-
|
242
|
+
// ---------------------------------------------------------------------
|
243
|
+
// helper functions
|
244
|
+
// =====================================================================
|
246
245
|
|
247
|
-
|
248
|
-
|
246
|
+
// remove existng markers
|
247
|
+
// ---------------------------------------------------------------------
|
248
|
+
function removeChapterMarkers(timeline, currentPlayerId) {
|
249
|
+
timeline.find('.vjs-chapter-marker').remove();
|
250
|
+
}
|
251
|
+
|
252
|
+
// get player status
|
253
|
+
// ---------------------------------------------------------------------
|
254
|
+
function getPlayerStatus(player) {
|
255
|
+
return {
|
256
|
+
paused: player.paused(),
|
257
|
+
currentTime: player.currentTime(),
|
258
|
+
duration: player.duration(),
|
259
|
+
muted: player.muted(),
|
260
|
+
bufferedPercent: player.bufferedPercent()
|
261
|
+
};
|
262
|
+
}
|
263
|
+
|
264
|
+
// check if player is playing
|
265
|
+
// ---------------------------------------------------------------------
|
266
|
+
function isPlaying (player) {
|
267
|
+
var vjsIsPlaying = (!player.paused() || player.currentTime() > 0) ? true : false;
|
268
|
+
|
269
|
+
return vjsIsPlaying;
|
270
|
+
}
|
271
|
+
|
272
|
+
// set chapter markers for the player (videojsPlayer) specified
|
273
|
+
// ---------------------------------------------------------------------
|
274
|
+
function addChapterMarkers(videojsPlayer) {
|
275
|
+
var timeline = $(videojsPlayer.controlBar.progressControl.children_[0].el_);
|
276
|
+
var playerID = videojsPlayer.id();
|
277
|
+
var parser = new WebVTTParser();
|
278
|
+
var markers = [];
|
279
|
+
|
280
|
+
function cb_load (data /* ,textStatus, jqXHR */ ) {
|
281
|
+
var tree = parser.parse(data, 'metadata');
|
282
|
+
var marker;
|
283
|
+
|
284
|
+
// add chapter tracks to markers array
|
285
|
+
for (var i=0; i<tree.cues.length; i++) {
|
286
|
+
marker = { time: tree.cues[i].startTime, label: tree.cues[i].text };
|
287
|
+
markers.push(marker);
|
288
|
+
}
|
289
|
+
}; // END function cb_load
|
290
|
+
|
291
|
+
// create chapter tracks from source file
|
292
|
+
// -----------------------------------------------------------------
|
293
|
+
loadVtt(videojsPlayer.chapterTracksSource, cb_load);
|
294
|
+
|
295
|
+
// failsafe: remove already existing markers for current player
|
296
|
+
// removeChapterMarkers(timeline, playerID);
|
297
|
+
|
298
|
+
// if tracks available, add (chapter) tracks on timeline
|
299
|
+
// -----------------------------------------------------------------
|
300
|
+
if (j1.modules.videojs.data.players[playerID].videoData.tracks.length) {
|
301
|
+
setTimeout (function() {
|
302
|
+
var markers_loaded = setInterval (function () {
|
303
|
+
if (markers.length) {
|
304
|
+
const duration = videojsPlayer.duration();
|
305
|
+
|
306
|
+
for (var i=0; i<markers.length; i++) {
|
307
|
+
var left = (markers[i].time / duration * 100) + '%';
|
308
|
+
var time = markers[i].time;
|
309
|
+
|
310
|
+
// add (unique) marker element
|
311
|
+
var el = $(
|
312
|
+
'<div class="vjs-chapter-marker" ' +
|
313
|
+
'style="left: ' + left + '" ' +
|
314
|
+
'data-time="' + time + '" ' +
|
315
|
+
'data-player-id="' + playerID + '">' +
|
316
|
+
'<span>' + markers[i].label + '</span></div>'
|
317
|
+
);
|
318
|
+
|
319
|
+
// event handler with closure for correct player reference
|
320
|
+
(function(currentPlayer, markerTime) {
|
321
|
+
el.click(function() {
|
322
|
+
currentPlayer.currentTime(markerTime);
|
323
|
+
});
|
324
|
+
})(videojsPlayer, time);
|
325
|
+
|
326
|
+
timeline.append(el);
|
327
|
+
}
|
328
|
+
|
329
|
+
clearInterval(markers_loaded);
|
330
|
+
} else {
|
331
|
+
clearInterval(markers_loaded);
|
332
|
+
} // END if markers.length
|
333
|
+
}, 10); // END interval markers_loaded
|
334
|
+
}, 100); // END timeout
|
335
|
+
} // END if chapterTracks enabled
|
336
|
+
|
337
|
+
} // END addChapterMarkers
|
338
|
+
|
339
|
+
|
340
|
+
// ---------------------------------------------------------------------
|
341
|
+
// main
|
342
|
+
// =====================================================================
|
343
|
+
dependency_met_module_ready = setInterval (() => {
|
344
|
+
var playerId, videoData, timeline,
|
345
|
+
textTracks, isModuleInitialised, isVideojsOptions,
|
346
|
+
hasChapters, hasSubtitles;
|
347
|
+
|
348
|
+
textTracks = videojsPlayer.textTracks();
|
349
|
+
isModuleInitialised = (j1.adapter.gallery.getState() === 'finished') ? true : false;
|
350
|
+
isVideojsOptions = (isEmpty(vjsObject.settings.videojsOptions)) ? false : true;
|
351
|
+
|
352
|
+
// check on chapters
|
353
|
+
hasChapters = Array.from(textTracks).some(track =>
|
354
|
+
track.kind === 'chapters' && track.cues && track.cues.length > 0
|
355
|
+
);
|
356
|
+
|
357
|
+
// check on subtitles||captions
|
358
|
+
hasSubtitles = Array.from(textTracks).some(track =>
|
359
|
+
(track.kind === 'subtitles' || track.kind === 'captions') &&
|
360
|
+
track.cues && track.cues.length > 0
|
361
|
+
);
|
362
|
+
|
363
|
+
if (isModuleInitialised && isVideojsOptions) {
|
364
|
+
playerId = videojsPlayer.id();
|
365
|
+
videoData = { tracks: [] };
|
366
|
+
playerState = getPlayerStatus(videojsPlayer);
|
249
367
|
|
250
368
|
var hotKeysPluginDefaults = {
|
251
369
|
volumeStep: vjsOptions.plugins.hotKeys.volumeStep,
|
@@ -277,7 +395,7 @@
|
|
277
395
|
zoom: vjsOptions.plugins.zoomButtons.zoom
|
278
396
|
};
|
279
397
|
|
280
|
-
//
|
398
|
+
// add customControlContainer
|
281
399
|
// -------------------------------------------------------------
|
282
400
|
var vjsPlayerControlBar = videojsPlayer.controlBar;
|
283
401
|
|
@@ -315,7 +433,7 @@
|
|
315
433
|
zoomPlugin = vjsObject.settings.videojsOptions.controlBar.zoomPlugin;
|
316
434
|
playbackRates = vjsObject.settings.videojsOptions.controlBar.playbackRates;
|
317
435
|
|
318
|
-
//
|
436
|
+
// add video start position
|
319
437
|
// ---------------------------------------------------------
|
320
438
|
if (vjsObject.settings.videojsOptions.videoStart !== undefined) {
|
321
439
|
videoStart = vjsObject.settings.videojsOptions.videoStart[index];
|
@@ -325,11 +443,11 @@
|
|
325
443
|
}); // END on event play
|
326
444
|
} // END if videoStart
|
327
445
|
|
328
|
-
// add playbackRates
|
446
|
+
// add playbackRates
|
329
447
|
// ---------------------------------------------------------
|
330
448
|
videojsPlayer.playbackRates(playbackRates);
|
331
449
|
|
332
|
-
// add hotkeys Plugin
|
450
|
+
// add hotkeys Plugin
|
333
451
|
// ---------------------------------------------------------
|
334
452
|
if (hotKeysPlugin !== undefined && hotKeysPlugin.enabled && videojsPlayer.hotKeys !== undefined) {
|
335
453
|
|
@@ -373,7 +491,7 @@
|
|
373
491
|
|
374
492
|
} // END if hotKeysPlugin enabled
|
375
493
|
|
376
|
-
// add skipButtons Plugin
|
494
|
+
// add skipButtons Plugin
|
377
495
|
// ---------------------------------------------------------
|
378
496
|
if (skipButtonsPlugin !== undefined && skipButtonsPlugin.enabled && videojsPlayer.skipButtons !== undefined) {
|
379
497
|
// merge objects
|
@@ -396,7 +514,7 @@
|
|
396
514
|
|
397
515
|
} // END if skipButtons Plugin enabled
|
398
516
|
|
399
|
-
// add zoom Plugin (only available for
|
517
|
+
// add zoom Plugin (only available for video/mp4
|
400
518
|
// ---------------------------------------------------------
|
401
519
|
if (videoInfo.youtube) {
|
402
520
|
// zoom pluging NOT supported for YouTube
|
@@ -424,101 +542,114 @@
|
|
424
542
|
|
425
543
|
} // END if zoom Plugin enabled
|
426
544
|
|
427
|
-
// chapter
|
545
|
+
// chapter track processing
|
428
546
|
// ---------------------------------------------------------
|
429
|
-
|
547
|
+
var tracksEnabled = vjsObject.settings.videojsOptions.tracks;
|
548
|
+
if (tracksEnabled && vjsObject.core.galleryItems[vjsObject.core.index].video !== undefined) {
|
430
549
|
videoData = JSON.parse(vjsObject.core.galleryItems[vjsObject.core.index].video);
|
431
|
-
|
432
|
-
|
433
|
-
// load tracks
|
434
|
-
// TODO: chapterTracksEnabled needs to be indivialized
|
435
|
-
// per player
|
436
|
-
// ---------------------------------------------------------
|
437
|
-
if (videoData.tracks && videoData.tracks.length > 0) {
|
438
|
-
for (var i=0; i<videoData.tracks.length; i++) {
|
439
|
-
if (videoData.tracks[i].kind == 'chapters') {
|
440
|
-
trackSrc = videoData.tracks[i].src;
|
441
|
-
videojsPlayer.chapterTracksEnabled = true;
|
442
|
-
}
|
443
|
-
}
|
444
|
-
} // END load tracks
|
445
|
-
|
446
|
-
// process (chapter) tracks if tracks available
|
447
|
-
// ---------------------------------------------------------
|
448
|
-
if (videojsPlayer.chapterTracksEnabled) {
|
449
|
-
var parser = new WebVTTParser();
|
450
|
-
var markers = [];
|
451
|
-
|
452
|
-
function cb_load (data /* ,textStatus, jqXHR */ ) {
|
453
|
-
var tree = parser.parse(data, 'metadata');
|
454
|
-
var marker;
|
455
|
-
|
456
|
-
// add chapter tracks to markers array
|
457
|
-
for (var i=0; i<tree.cues.length; i++) {
|
458
|
-
marker = { time: tree.cues[i].startTime, label: tree.cues[i].text };
|
459
|
-
markers.push(marker);
|
460
|
-
}
|
461
|
-
}; // END function cb_load
|
550
|
+
videojsPlayer.videoData = videoData;
|
462
551
|
|
463
|
-
//
|
552
|
+
// save VJS videoData for later use
|
553
|
+
// NOTE: for unknown reasons, lightGallery generates
|
554
|
+
// WRONG videoData on skip forwaed|backward a video slide
|
555
|
+
// Workaround: do NOT overwrite existing video data
|
556
|
+
// stored in current window (j1.modules.videojs.data)
|
464
557
|
// -----------------------------------------------------
|
465
|
-
|
558
|
+
if (j1.modules.videojs.data.players[playerId] === undefined) {
|
559
|
+
j1.modules.videojs.data.players[playerId] = {};
|
560
|
+
j1.modules.videojs.data.players[playerId]['videoData'] = {};
|
561
|
+
j1.modules.videojs.data.players[playerId].videoData['tracks'] = videoData.tracks || [];
|
562
|
+
}
|
466
563
|
|
467
|
-
//
|
564
|
+
// load source file for chapter tracks
|
468
565
|
// -----------------------------------------------------
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
var markers_loaded = setInterval (function () {
|
481
|
-
if (markers.length) {
|
482
|
-
// make sure, that previous markers deleted
|
483
|
-
timeline.find('.vjs-chapter-marker').remove();
|
484
|
-
|
485
|
-
for (var i=0; i<markers.length; i++) {
|
486
|
-
var left = (markers[i].time / total * 100) + '%';
|
487
|
-
var time = markers[i].time;
|
488
|
-
var el = $('<div class="vjs-chapter-marker" style="left: ' +left+ '" data-time="' +time+ '"> <span>' +markers[i].label+ '</span></div>');
|
489
|
-
|
490
|
-
el.click(function() {
|
491
|
-
videojsPlayer.currentTime($(this).data('time'));
|
492
|
-
});
|
566
|
+
var chapterTracksSrc;
|
567
|
+
for (var i=0; i<videojsPlayer.videoData.tracks.length; i++) {
|
568
|
+
if (videojsPlayer.videoData.tracks[i].kind == 'captions') {
|
569
|
+
videojsPlayer.captionTracks = videojsPlayer.videoData.tracks[i];
|
570
|
+
}
|
571
|
+
if (videojsPlayer.videoData.tracks[i].kind == 'chapters') {
|
572
|
+
chapterTracksSrc = videojsPlayer.videoData.tracks[i].src;
|
573
|
+
videojsPlayer.chapterTracks = videojsPlayer.videoData.tracks[i];
|
574
|
+
videojsPlayer.chapterTracksSource = chapterTracksSrc;
|
575
|
+
}
|
576
|
+
}
|
493
577
|
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
578
|
+
// process chapter tracks
|
579
|
+
// -----------------------------------------------------
|
580
|
+
if (j1.modules.videojs.data.players[playerId].videoData.tracks.length) {
|
581
|
+
|
582
|
+
playerId = videojsPlayer.id();
|
583
|
+
timeline = $(videojsPlayer.controlBar.progressControl.children_[0].el_);
|
584
|
+
removeChapterMarkers(timeline, playerId);
|
585
|
+
|
586
|
+
// add chapter markers when playing (e.g. autoplay)
|
587
|
+
// -------------------------------------------------
|
588
|
+
if (isPlaying(videojsPlayer)) {
|
589
|
+
addChapterMarkers(videojsPlayer);
|
590
|
+
} // END if VideoJS player isPlaying
|
591
|
+
|
592
|
+
// jadams, 2025-06-22: prepare processing start position
|
593
|
+
// TODO: coding is to be continued
|
594
|
+
// -------------------------------------------------
|
595
|
+
// videojsPlayer.currentTime(videoStart);
|
596
|
+
|
597
|
+
// remove chapter markers on event 'pause'
|
598
|
+
// TODO: should be confifurable
|
599
|
+
// -------------------------------------------------
|
600
|
+
// videojsPlayer.on("pause", function() {
|
601
|
+
// var timeline = $(videojsPlayer.controlBar.progressControl.children_[0].el_);
|
602
|
+
// removeChapterMarkers(timeline, videojsPlayer.id());
|
603
|
+
// }); // END on event 'pause'
|
604
|
+
|
605
|
+
// add chapter tracks on event 'play'
|
606
|
+
// TODO: should be configurable
|
607
|
+
// -------------------------------------------------
|
608
|
+
videojsPlayer.on("play", function() {
|
609
|
+
addChapterMarkers(videojsPlayer)
|
610
|
+
}); // END on event 'play'
|
611
|
+
|
612
|
+
// failsafe: remove chapter markers on player destroyed
|
613
|
+
// TODO: should be configurable
|
614
|
+
// -------------------------------------------------
|
615
|
+
// videojsPlayer.on("dispose", function() {
|
616
|
+
// var timeline = $(videojsPlayer.controlBar.progressControl.children_[0].el_);
|
617
|
+
// removeChapterMarkers(timeline, videojsPlayer.id());
|
618
|
+
// });
|
619
|
+
|
620
|
+
// add tracks and buttons
|
621
|
+
// -------------------------------------------------
|
622
|
+
videojsPlayer.addRemoteTextTrack(videojsPlayer.captionTracks);
|
623
|
+
videojsPlayer.addRemoteTextTrack(videojsPlayer.chapterTracks);
|
624
|
+
|
625
|
+
// enable 'english' caption tracks
|
626
|
+
// -------------------------------------------------
|
627
|
+
textTracks = videojsPlayer.textTracks();
|
628
|
+
for (var i = 0; i < textTracks.length; i++) {
|
629
|
+
var track = textTracks[i];
|
630
|
+
if (track.kind === 'captions' && track.language === 'en') {
|
631
|
+
track.mode = 'showing'; // enable
|
632
|
+
} else {
|
633
|
+
track.mode = 'disabled'; // disable other
|
634
|
+
}
|
635
|
+
}
|
500
636
|
|
501
|
-
}
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
videojsPlayer.on("play", function() {
|
506
|
-
videojsPlayer.chapterTracksEnabled = false;
|
637
|
+
} else {
|
638
|
+
// remove existing chapter markers if NO tracks enabled
|
639
|
+
// -------------------------------------------------
|
640
|
+
var playerId = videojsPlayer.id();
|
507
641
|
var timeline = $(videojsPlayer.controlBar.progressControl.children_[0].el_);
|
642
|
+
removeChapterMarkers(timeline, playerId);
|
643
|
+
} // END if chapterTracks enabled
|
508
644
|
|
509
|
-
|
510
|
-
timeline.find('.vjs-chapter-marker').remove();
|
511
|
-
|
512
|
-
});
|
513
|
-
|
514
|
-
} // END remove chapter tracks
|
645
|
+
} // END if tracksEnabled
|
515
646
|
|
516
647
|
} // END if videojsOptions
|
517
648
|
|
518
649
|
clearInterval(dependency_met_module_ready);
|
519
650
|
} // END if isModuleInitialised
|
520
651
|
|
521
|
-
|
652
|
+
}, 10); // END interval dependency_met_module_ready
|
522
653
|
|
523
654
|
}; // END vjsProcessExtendedButtonsAndPlugins
|
524
655
|
|
@@ -723,7 +854,8 @@
|
|
723
854
|
<source
|
724
855
|
type="video/youtube",
|
725
856
|
src="//youtube.com/watch?v=${ytVideoID}"
|
726
|
-
|
857
|
+
>,
|
858
|
+
<tracks>
|
727
859
|
|
728
860
|
Your browser does not support HTML5 video.
|
729
861
|
</video>
|
@@ -16,4 +16,4 @@
|
|
16
16
|
# -----------------------------------------------------------------------------
|
17
17
|
*/
|
18
18
|
|
19
|
-
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o():"function"==typeof define&&define.amd?define(o):(e="undefined"!=typeof globalThis?globalThis:e||self).lgVideo=o()}(this,(function(){"use strict";var e=function(){return e=Object.assign||function(e){for(var o,t=1,i=arguments.length;t<i;t++)for(var s in o=arguments[t])Object.prototype.hasOwnProperty.call(o,s)&&(e[s]=o[s]);return e},e.apply(this,arguments)},o={autoplayFirstVideo:!0,htmlPlayerParams:!1,youTubePlayerParams:!1,vimeoPlayerParams:!1,dailymotionPlayerParams:!1,wistiaPlayerParams:!1,tiktokPlayerParams:!1,gotoNextSlideOnVideoEnd:!0,autoplayVideoOnSlide:!1,videojs:!1,videojsTheme:"",videojsOptions:{}},t="lgHasVideo",i="lgSlideItemLoad",s="lgBeforeSlide",n="lgAfterSlide",l="lgPosterClick",a=function(e){return 0===Object.keys(e).length},r=function(e){return Object.keys(e).map((function(o){return encodeURIComponent(o)+"="+encodeURIComponent(e[o])})).join("&")},d=function(o,t){if(!o.youtube)return"";var i=o.youtube[2]?o.youtube[2].slice(1).split("&").map((function(e){return e.split("=")})).reduce((function(e,o){var t=o.map(decodeURIComponent),i=t[0],s=t[1];return e[i]=s,e}),{}):"",s=t||{},n=e(e(e({},{wmode:"opaque",autoplay:0,mute:1,enablejsapi:1}),s),i);return"?"+r(n)},c=function(o,t,i){const s=j1.modules.videojs.options;var n,l,r,d,c,u,p;n=setInterval((()=>{var v,m,h="finished"===j1.adapter.gallery.getState(),y=!a(o.settings.videojsOptions);if(h&&y){var g={tracks:!1};s.playbackRates.values;t.chapterTracksEnabled=!1;var f={volumeStep:s.plugins.hotKeys.volumeStep,seekStep:s.plugins.hotKeys.seekStep,enableMute:s.plugins.hotKeys.enableMute,enableVolumeScroll:s.plugins.hotKeys.enableVolumeScroll,enableHoverScroll:s.plugins.hotKeys.enableHoverScroll,enableFullscreen:s.plugins.hotKeys.enableFullscreen,enableNumbers:s.plugins.hotKeys.enableNumbers,enableJogStyle:s.plugins.hotKeys.enableJogStyle,alwaysCaptureHotkeys:s.plugins.hotKeys.alwaysCaptureHotkeys,captureDocumentHotkeys:s.plugins.hotKeys.captureDocumentHotkeys,enableModifiersForNumbers:s.plugins.hotKeys.enableModifiersForNumbers,enableInactiveFocus:s.plugins.hotKeys.enableInactiveFocus,skipInitialFocus:s.plugins.hotKeys.skipInitialFocus},b={backward:s.plugins.skipButtons.backward,forward:s.plugins.skipButtons.forward,backwardIndex:0,forwardIndex:1},k={moveX:s.plugins.zoomButtons.moveX,moveY:s.plugins.zoomButtons.moveY,rotate:s.plugins.zoomButtons.rotate,zoom:s.plugins.zoomButtons.zoom},j=t.controlBar;const O=j.addChild("Component",{el:videojs.dom.createEl("div",{className:"vjs-theme-uno custom-progressbar-container"})}),_=j.progressControl;_&&O.el().appendChild(_.el());const T=j.currentTimeDisplay;T&&O.el().insertBefore(T.el(),_.el());const C=j.durationDisplay;if(C&&O.el().appendChild(C.el()),!a(o.settings.videojsOptions)){if(d=o.settings.videojsOptions.hotKeysPlugin,c=o.settings.videojsOptions.controlBar.skipButtonsPlugin,u=o.settings.videojsOptions.controlBar.zoomPlugin,r=o.settings.videojsOptions.controlBar.playbackRates,void 0!==o.settings.videojsOptions.videoStart&&(l=o.settings.videojsOptions.videoStart[index],t.on("play",(function(){var e=new Date("1970-01-01T"+l+"Z").getTime()/1e3;t.currentTime(e)}))),t.playbackRates(r),void 0!==d&&d.enabled&&void 0!==t.hotKeys){d.options=e(e({},f),d.options);var w=!1;void 0!==t.activePlugins_&&void 0!==t.activePlugins_.hotKeys&&(w=t.activePlugins_.hotKeys),w||t.hotKeys({volumeStep:d.options.volumeStep,seekStep:d.options.seekStep,enableMute:d.options.enableMute,enableFullscreen:d.options.enableFullscreen,enableNumbers:d.options.enableNumbers,enableVolumeScroll:d.options.enableVolumeScroll,enableHoverScroll:d.options.enableHoverScroll,alwaysCaptureHotkeys:d.options.alwaysCaptureHotkeys,captureDocumentHotkeys:d.options.captureDocumentHotkeys,documentHotkeysFocusElementFilter:d.options.documentHotkeysFocusElementFilter,seekStep:function(e){return e.ctrlKey&&e.altKey?300:e.ctrlKey?60:e.altKey?10:15}})}if(void 0!==c&&c.enabled&&void 0!==t.skipButtons){c.options=e(e({},b),c.options);var V=!1;void 0!==t.activePlugins_&&void 0!==t.activePlugins_.skipButtons&&(V=t.activePlugins_.skipButtons),V||t.skipButtons({backward:c.options.backward,forward:c.options.forward,backwardIndex:c.options.backwardIndex,forwardIndex:c.options.forwardIndex})}if(i.youtube&&(u.enabled=!1),void 0!==u&&u.enabled&&void 0!==t.zoomButtons){u.options=e(e({},k),u.options);var P=!1;void 0!==t.activePlugins_&&void 0!==t.activePlugins_.zoomButtons&&(P=t.activePlugins_.zoomButtons),P||t.zoomButtons({moveX:u.options.moveX,moveY:u.options.moveY,rotate:u.options.rotate,zoom:u.options.zoom})}if(void 0!==o.core.galleryItems[o.core.index].video&&(g=JSON.parse(o.core.galleryItems[o.core.index].video)),g.tracks&&g.tracks.length>0)for(var S=0;S<g.tracks.length;S++)"chapters"==g.tracks[S].kind&&(p=g.tracks[S].src,t.chapterTracksEnabled=!0);if(t.chapterTracksEnabled){var x=new WebVTTParser,I=[];function B(e){for(var o,t=x.parse(e,"metadata"),i=0;i<t.cues.length;i++)o={time:t.cues[i].startTime,label:t.cues[i].text},I.push(o)}v=p,m=B,new WebVTTParser,$.ajax({url:v,type:"GET",success:m,error:function(e){JSON.stringify(e,void 0,2)}}),t.on("play",(function(){t.currentTime(l);var e=t.duration(),o=$(t.controlBar.progressControl.children_[0].el_);o.find(".vjs-chapter-marker").remove(),setTimeout((function(){var i=setInterval((function(){if(I.length){o.find(".vjs-chapter-marker").remove();for(var s=0;s<I.length;s++){var n=I[s].time/e*100+"%",l=I[s].time,a=$('<div class="vjs-chapter-marker" style="left: '+n+'" data-time="'+l+'"> <span>'+I[s].label+"</span></div>");a.click((function(){t.currentTime($(this).data("time"))})),o.append(a)}clearInterval(i)}}),10)}),100)}))}else t.on("play",(function(){t.chapterTracksEnabled=!1,$(t.controlBar.progressControl.children_[0].el_).find(".vjs-chapter-marker").remove()}))}clearInterval(n)}}),10)};return function(){function a(t){return this.core=t,this.settings=e(e({},o),this.core.settings),this}return a.prototype.init=function(){var e=this;this.core.LGel.on(t+".video",this.onHasVideo.bind(this)),this.core.LGel.on(l+".video",(function(){var o=e.core.getSlideItem(e.core.index);e.loadVideoOnPosterClick(o)})),this.core.LGel.on(i+".video",this.onSlideItemLoad.bind(this)),this.core.LGel.on(s+".video",this.onBeforeSlide.bind(this)),this.core.LGel.on(n+".video",this.onAfterSlide.bind(this))},a.prototype.onSlideItemLoad=function(e){var o=this,t=e.detail,i=t.isFirstSlide,s=t.index;this.settings.autoplayFirstVideo&&i&&s===this.core.index&&setTimeout((function(){o.loadAndPlayVideo(s)}),200),!i&&this.settings.autoplayVideoOnSlide&&s===this.core.index&&this.loadAndPlayVideo(s)},a.prototype.onHasVideo=function(e){var o=e.detail,t=o.index,i=o.src,s=o.html5Video;o.hasPoster||(this.appendVideo(this.core.getSlideItem(t),{src:i,addClass:"lg-object",index:t,html5Video:s}),this.gotoNextSlideOnVideoEnd(i,t))},a.prototype.onBeforeSlide=function(e){if(this.core.lGalleryOn){var o=e.detail.prevIndex;this.pauseVideo(o)}},a.prototype.onAfterSlide=function(e){var o=this,t=e.detail,i=t.index,s=t.prevIndex,n=this.core.getSlideItem(i);this.settings.autoplayVideoOnSlide&&i!==s&&n.hasClass("lg-complete")&&setTimeout((function(){o.loadAndPlayVideo(i)}),100)},a.prototype.loadAndPlayVideo=function(e){var o=this.core.getSlideItem(e);this.core.galleryItems[e].poster?this.loadVideoOnPosterClick(o,!0):this.playVideo(e)},a.prototype.playVideo=function(e){this.controlVideo(e,"play")},a.prototype.pauseVideo=function(e){this.controlVideo(e,"pause")},a.prototype.getVideoHtml=function(e,o,t,i){var s,n,l,a,c;if(n=this.core.galleryItems[t].__slideVideoInfo||{},(s=this.core.galleryItems[t]).subHtml.includes("<h2>")?l=s.subHtml.split("</h2>")[0].replace("<h2>",""):s.subHtml.includes("<h5>")&&(l=s.subHtml.split("</h5>")[0].replace("<h5>","")),l=l?'title="'+l+'"':"",c='allowtransparency="true"\n frameborder="0"\n scrolling="no"\n allowfullscreen\n mozallowfullscreen\n webkitallowfullscreen\n oallowfullscreen\n msallowfullscreen',n.youtube){var u="lg-youtube"+t,p=(d(n,this.settings.youTubePlayerParams),e.includes("youtube-nocookie.com"),n.youtube[1]);"youtube",a=`\n <video\n id="${u}"\n class="video-js lg-video-object lg-youtube vjs-theme-uno">\n <source\n type="video/youtube",\n src="//youtube.com/watch?v=${p}"\n >\n\n Your browser does not support HTML5 video.\n </video>\n `}else if(n.vimeo){u="lg-vimeo"+t;var v=function(e,o){if(!o||!o.vimeo)return"";var t=o.vimeo[2]||"",i=Object.assign({},{autoplay:0,muted:1},e),s=i&&0!==Object.keys(i).length?r(i):"",n=((o.vimeo[0].split("/").pop()||"").split("?")[0]||"").split("#")[0],l=o.vimeo[1]!==n;l&&(t=t.replace("/"+n,""));var a=l?"h="+n:"";return"?"+a+(s=a?"&"+s:s)+("?"==t[0]?"&"+t.slice(1):t||"")}(this.settings.vimeoPlayerParams,n);a='<iframe allow="autoplay" id='+u+' class="lg-video-object lg-vimeo '+o+'" '+l+' src="//player.vimeo.com/video/'+(n.vimeo[1]+v)+'" '+c+"></iframe>"}else if(n.wistia){var m="lg-wistia"+t;v=(v=r(this.settings.wistiaPlayerParams))?"?"+v:"",a='<iframe allow="autoplay" id="'+m+'" src="//fast.wistia.net/embed/iframe/'+(n.wistia[4]+v)+'" '+l+' class="wistia_embed lg-video-object lg-wistia '+o+'" name="wistia_embed" '+c+"></iframe>"}else if(n.dailymotion){var h="lg-dailymotion"+t;v=(v=r(this.settings.dailymotionPlayerParams))?"?"+v:"",a=`\n <iframe\n id="${h}"\n src="//dailymotion.com/embed/video/${n.dailymotion[1]}?api=1 ${v}"\n ${l}\n class="dailymotion_embed lg-video-object lg-dailymotiion ${o}"\n name="dailymotion_embed"\n ${c}>\n </iframe>\n `}else if(n.html5){for(var y="",g=0;g<i.source.length;g++){var f=i.source[g].type,b=f?'type="'+f+'"':"";y+='<source src="'+i.source[g].src+'" '+b+">"}if(i.tracks){var k=function(e){var o="",t=i.tracks[e];Object.keys(t||{}).forEach((function(e){o+=e+'="'+t[e]+'" '})),y+="<track "+o+">"};for(g=0;g<i.tracks.length;g++)k(g)}var j="",w=i.attributes||{};Object.keys(w||{}).forEach((function(e){j+=e+'="'+w[e]+'" '})),a='<video class="lg-video-object lg-html5 '+(this.settings.videojs&&this.settings.videojsTheme?this.settings.videojsTheme+" ":"")+" "+(this.settings.videojs?" video-js":"")+'" '+j+">\n "+y+"\n Your browser does not support HTML5 video.\n </video>"}return a},a.prototype.appendVideo=function(e,o){var t,i,s={},n=this.getVideoHtml(o.src,o.addClass,o.index,o.html5Video);e.find(".lg-video-cont").append(n);var l=e.find(".lg-video-object").first();if(l.get()){if(o.html5Video&&l.on("mousedown.lg.video",(function(e){e.stopPropagation()})),(s=this.core.galleryItems[o.index].__slideVideoInfo).videojs={enabled:!1},i=n.includes("iframe"),s.videojs.enabled=!i,this.settings.videojs&&(null==s?void 0:s.html5))try{if(s.videojs.enabled)return t=videojs(l.get(),this.settings.videojsOptions),this.settings.vjsPlayer=t,s.videojs.player=t,t}catch(e){console.warn("lightGallery: Make sure you have included //github.com/vimeo/player.js")}if(this.settings.videojs&&(null==s?void 0:s.youtube))try{if(s.videojs.enabled)return t=videojs(l.get(),this.settings.videojsOptions),this.settings.vjsPlayer=t,s.videojs.player=t,t}catch(e){console.warn("lightGallery: Make sure you have included //github.com/vimeo/player.js")}}},a.prototype.gotoNextSlideOnVideoEnd=function(e,o){var t=this,i=this.core.getSlideItem(o).find(".lg-video-object").first();if(i.get()){var s=this.core.galleryItems[o].__slideVideoInfo||{};if(this.settings.gotoNextSlideOnVideoEnd)if(s.html5)i.on("ended",(function(){t.core.goToNextSlide()}));else if(s.vimeo)try{new Vimeo.Player(i.get()).on("ended",(function(){t.core.goToNextSlide()}))}catch(e){console.error("lightGallery:- Make sure you have included //github.com/vimeo/player.js")}else if(s.wistia)try{window._wq=window._wq||[],window._wq.push({id:i.attr("id"),onReady:function(e){e.bind("end",(function(){t.core.goToNextSlide()}))}})}catch(e){console.error("lightGallery:- Make sure you have included //fast.wistia.com/assets/external/E-v1.js")}}},a.prototype.controlVideo=function(e,o){var t,i,s="not_set";if((t=this.core.getSlideItem(e).find(".lg-video-object").first()).get())if(((i=this.core.galleryItems[e].__slideVideoInfo||{}).html5||i.youtube)&&(void 0!==t.selector.player&&(s=t.selector.player),"not_set"!==s&&c(this,s,i)),i.html5)if(this.settings.videojs)try{videojs(t.get())[o]()}catch(e){console.warn("lightGallery: Make sure you have included videojs")}else t.get()[o]();else if(i.youtube)if(this.settings.videojs)try{videojs(t.get())[o]()}catch(e){console.warn("lightGallery: Make sure you have included videojs")}else try{t.get().contentWindow.postMessage('{"event":"command","func":"'+o+'Video","args":""}',"*")}catch(e){console.error("lightGallery:- "+e)}else if(i.vimeo)try{new Vimeo.Player(t.get())[o]()}catch(e){console.warn("lightGallery: Make sure you have included //github.com/vimeo/player.js")}else if(i.wistia)try{window._wq=window._wq||[],window._wq.push({id:t.attr("id"),onReady:function(e){e[o]()}})}catch(e){console.warn("lightGallery: Make sure you have included //fast.wistia.com/assets/external/E-v1.js")}},a.prototype.loadVideoOnPosterClick=function(e,o){var t=this;if(e.hasClass("lg-video-loaded"))o&&this.playVideo(this.core.index);else if(e.hasClass("lg-has-video"))this.playVideo(this.core.index);else{e.addClass("lg-has-video");var i=void 0,s=this.core.galleryItems[this.core.index].src,n=this.core.galleryItems[this.core.index].video;n&&(i="string"==typeof n?JSON.parse(n):n);var l=this.appendVideo(e,{src:s,addClass:"",index:this.core.index,html5Video:i});this.gotoNextSlideOnVideoEnd(s,this.core.index);var a=e.find(".lg-object").first().get();e.find(".lg-video-cont").first().append(a),e.addClass("lg-video-loading"),l&&l.ready((function(){l.on("loadedmetadata",(function(){t.onVideoLoadAfterPosterClick(e,t.core.index)}))})),e.find(".lg-video-object").first().on("load.lg error.lg loadedmetadata.lg",(function(){setTimeout((function(){t.onVideoLoadAfterPosterClick(e,t.core.index)}),50)}))}},a.prototype.onVideoLoadAfterPosterClick=function(e,o){e.addClass("lg-video-loaded"),this.playVideo(o)},a.prototype.destroy=function(){this.core.LGel.off(".lg.video"),this.core.LGel.off(".video")},a}()}));
|
19
|
+
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o():"function"==typeof define&&define.amd?define(o):(e="undefined"!=typeof globalThis?globalThis:e||self).lgVideo=o()}(this,(function(){"use strict";var e=function(){return e=Object.assign||function(e){for(var o,t=1,i=arguments.length;t<i;t++)for(var s in o=arguments[t])Object.prototype.hasOwnProperty.call(o,s)&&(e[s]=o[s]);return e},e.apply(this,arguments)},o={autoplayFirstVideo:!0,htmlPlayerParams:!1,youTubePlayerParams:!1,vimeoPlayerParams:!1,dailymotionPlayerParams:!1,wistiaPlayerParams:!1,tiktokPlayerParams:!1,gotoNextSlideOnVideoEnd:!0,autoplayVideoOnSlide:!1,videojs:!1,videojsTheme:"",videojsOptions:{}},t="lgHasVideo",i="lgSlideItemLoad",s="lgBeforeSlide",n="lgAfterSlide",a="lgPosterClick",l=function(e){return 0===Object.keys(e).length},r=function(e){return Object.keys(e).map((function(o){return encodeURIComponent(o)+"="+encodeURIComponent(e[o])})).join("&")},d=function(o,t){if(!o.youtube)return"";var i=o.youtube[2]?o.youtube[2].slice(1).split("&").map((function(e){return e.split("=")})).reduce((function(e,o){var t=o.map(decodeURIComponent),i=t[0],s=t[1];return e[i]=s,e}),{}):"",s=t||{},n=e(e(e({},{wmode:"opaque",autoplay:0,mute:1,enablejsapi:1}),s),i);return"?"+r(n)},c=function(o,t,i){const s=j1.modules.videojs.options;var n,a,r,d,c,u;function p(e,o){e.find(".vjs-chapter-marker").remove()}function v(e){var o,t,i=$(e.controlBar.progressControl.children_[0].el_),s=e.id(),n=new WebVTTParser,a=[];o=e.chapterTracksSource,t=function(e){for(var o,t=n.parse(e,"metadata"),i=0;i<t.cues.length;i++)o={time:t.cues[i].startTime,label:t.cues[i].text},a.push(o)},new WebVTTParser,$.ajax({url:o,type:"GET",success:t,error:function(e){JSON.stringify(e,void 0,2)}}),p(i),j1.modules.videojs.data.players[s].videoData.tracks.length&&setTimeout((function(){var o=setInterval((function(){if(a.length){const d=e.duration();for(var t=0;t<a.length;t++){var n=a[t].time/d*100+"%",l=a[t].time,r=$('<div class="vjs-chapter-marker" style="left: '+n+'" data-time="'+l+'" data-player-id="'+s+'"><span>'+a[t].label+"</span></div>");!function(e,o){r.click((function(){e.currentTime(o)}))}(e,l),i.append(r)}clearInterval(o)}else clearInterval(o)}),10)}),100)}n=setInterval((()=>{var m,y,h="finished"===j1.adapter.gallery.getState(),g=!l(o.settings.videojsOptions);if(h&&g){_=t.id(),m={tracks:[]},{paused:(y=t).paused(),currentTime:y.currentTime(),duration:y.duration(),muted:y.muted(),bufferedPercent:y.bufferedPercent()};var f={volumeStep:s.plugins.hotKeys.volumeStep,seekStep:s.plugins.hotKeys.seekStep,enableMute:s.plugins.hotKeys.enableMute,enableVolumeScroll:s.plugins.hotKeys.enableVolumeScroll,enableHoverScroll:s.plugins.hotKeys.enableHoverScroll,enableFullscreen:s.plugins.hotKeys.enableFullscreen,enableNumbers:s.plugins.hotKeys.enableNumbers,enableJogStyle:s.plugins.hotKeys.enableJogStyle,alwaysCaptureHotkeys:s.plugins.hotKeys.alwaysCaptureHotkeys,captureDocumentHotkeys:s.plugins.hotKeys.captureDocumentHotkeys,enableModifiersForNumbers:s.plugins.hotKeys.enableModifiersForNumbers,enableInactiveFocus:s.plugins.hotKeys.enableInactiveFocus,skipInitialFocus:s.plugins.hotKeys.skipInitialFocus},b={backward:s.plugins.skipButtons.backward,forward:s.plugins.skipButtons.forward,backwardIndex:0,forwardIndex:1},j={moveX:s.plugins.zoomButtons.moveX,moveY:s.plugins.zoomButtons.moveY,rotate:s.plugins.zoomButtons.rotate,zoom:s.plugins.zoomButtons.zoom},k=t.controlBar;const h=k.addChild("Component",{el:videojs.dom.createEl("div",{className:"vjs-theme-uno custom-progressbar-container"})}),g=k.progressControl;g&&h.el().appendChild(g.el());const O=k.currentTimeDisplay;O&&h.el().insertBefore(O.el(),g.el());const C=k.durationDisplay;if(C&&h.el().appendChild(C.el()),!l(o.settings.videojsOptions)){if(d=o.settings.videojsOptions.hotKeysPlugin,c=o.settings.videojsOptions.controlBar.skipButtonsPlugin,u=o.settings.videojsOptions.controlBar.zoomPlugin,r=o.settings.videojsOptions.controlBar.playbackRates,void 0!==o.settings.videojsOptions.videoStart&&(a=o.settings.videojsOptions.videoStart[index],t.on("play",(function(){var e=new Date("1970-01-01T"+a+"Z").getTime()/1e3;t.currentTime(e)}))),t.playbackRates(r),void 0!==d&&d.enabled&&void 0!==t.hotKeys){d.options=e(e({},f),d.options);var w=!1;void 0!==t.activePlugins_&&void 0!==t.activePlugins_.hotKeys&&(w=t.activePlugins_.hotKeys),w||t.hotKeys({volumeStep:d.options.volumeStep,seekStep:d.options.seekStep,enableMute:d.options.enableMute,enableFullscreen:d.options.enableFullscreen,enableNumbers:d.options.enableNumbers,enableVolumeScroll:d.options.enableVolumeScroll,enableHoverScroll:d.options.enableHoverScroll,alwaysCaptureHotkeys:d.options.alwaysCaptureHotkeys,captureDocumentHotkeys:d.options.captureDocumentHotkeys,documentHotkeysFocusElementFilter:d.options.documentHotkeysFocusElementFilter,seekStep:function(e){return e.ctrlKey&&e.altKey?300:e.ctrlKey?60:e.altKey?10:15}})}if(void 0!==c&&c.enabled&&void 0!==t.skipButtons){c.options=e(e({},b),c.options);var V=!1;void 0!==t.activePlugins_&&void 0!==t.activePlugins_.skipButtons&&(V=t.activePlugins_.skipButtons),V||t.skipButtons({backward:c.options.backward,forward:c.options.forward,backwardIndex:c.options.backwardIndex,forwardIndex:c.options.forwardIndex})}if(i.youtube&&(u.enabled=!1),void 0!==u&&u.enabled&&void 0!==t.zoomButtons){u.options=e(e({},j),u.options);var P=!1;void 0!==t.activePlugins_&&void 0!==t.activePlugins_.zoomButtons&&(P=t.activePlugins_.zoomButtons),P||t.zoomButtons({moveX:u.options.moveX,moveY:u.options.moveY,rotate:u.options.rotate,zoom:u.options.zoom})}if(o.settings.videojsOptions.tracks&&void 0!==o.core.galleryItems[o.core.index].video){var S;m=JSON.parse(o.core.galleryItems[o.core.index].video),t.videoData=m,void 0===j1.modules.videojs.data.players[_]&&(j1.modules.videojs.data.players[_]={},j1.modules.videojs.data.players[_].videoData={},j1.modules.videojs.data.players[_].videoData.tracks=m.tracks||[]);for(var x=0;x<t.videoData.tracks.length;x++)"chapters"==t.videoData.tracks[x].kind&&(S=t.videoData.tracks[x].src,t.chapterTracksSource=S);if(j1.modules.videojs.data.players[_].videoData.tracks.length)_=t.id(),p(I=$(t.controlBar.progressControl.children_[0].el_)),function(e){return!e.paused()||e.currentTime()>0}(t)&&v(t),t.on("pause",(function(){p($(t.controlBar.progressControl.children_[0].el_),t.id())})),t.on("play",(function(){v(t)})),t.on("dispose",(function(){p($(t.controlBar.progressControl.children_[0].el_),t.id())}));else{var I=$(t.controlBar.progressControl.children_[0].el_),_=t.id();p(I)}}}clearInterval(n)}}),10)};return function(){function l(t){return this.core=t,this.settings=e(e({},o),this.core.settings),this}return l.prototype.init=function(){var e=this;this.core.LGel.on(t+".video",this.onHasVideo.bind(this)),this.core.LGel.on(a+".video",(function(){var o=e.core.getSlideItem(e.core.index);e.loadVideoOnPosterClick(o)})),this.core.LGel.on(i+".video",this.onSlideItemLoad.bind(this)),this.core.LGel.on(s+".video",this.onBeforeSlide.bind(this)),this.core.LGel.on(n+".video",this.onAfterSlide.bind(this))},l.prototype.onSlideItemLoad=function(e){var o=this,t=e.detail,i=t.isFirstSlide,s=t.index;this.settings.autoplayFirstVideo&&i&&s===this.core.index&&setTimeout((function(){o.loadAndPlayVideo(s)}),200),!i&&this.settings.autoplayVideoOnSlide&&s===this.core.index&&this.loadAndPlayVideo(s)},l.prototype.onHasVideo=function(e){var o=e.detail,t=o.index,i=o.src,s=o.html5Video;o.hasPoster||(this.appendVideo(this.core.getSlideItem(t),{src:i,addClass:"lg-object",index:t,html5Video:s}),this.gotoNextSlideOnVideoEnd(i,t))},l.prototype.onBeforeSlide=function(e){if(this.core.lGalleryOn){var o=e.detail.prevIndex;this.pauseVideo(o)}},l.prototype.onAfterSlide=function(e){var o=this,t=e.detail,i=t.index,s=t.prevIndex,n=this.core.getSlideItem(i);this.settings.autoplayVideoOnSlide&&i!==s&&n.hasClass("lg-complete")&&setTimeout((function(){o.loadAndPlayVideo(i)}),100)},l.prototype.loadAndPlayVideo=function(e){var o=this.core.getSlideItem(e);this.core.galleryItems[e].poster?this.loadVideoOnPosterClick(o,!0):this.playVideo(e)},l.prototype.playVideo=function(e){this.controlVideo(e,"play")},l.prototype.pauseVideo=function(e){this.controlVideo(e,"pause")},l.prototype.getVideoHtml=function(e,o,t,i){var s,n,a,l,c;if(n=this.core.galleryItems[t].__slideVideoInfo||{},(s=this.core.galleryItems[t]).subHtml.includes("<h2>")?a=s.subHtml.split("</h2>")[0].replace("<h2>",""):s.subHtml.includes("<h5>")&&(a=s.subHtml.split("</h5>")[0].replace("<h5>","")),a=a?'title="'+a+'"':"",c='allowtransparency="true"\n frameborder="0"\n scrolling="no"\n allowfullscreen\n mozallowfullscreen\n webkitallowfullscreen\n oallowfullscreen\n msallowfullscreen',n.youtube){var u="lg-youtube"+t,p=(d(n,this.settings.youTubePlayerParams),e.includes("youtube-nocookie.com"),n.youtube[1]);"youtube",l=`\n <video\n id="${u}"\n class="video-js lg-video-object lg-youtube vjs-theme-uno">\n <source\n type="video/youtube",\n src="//youtube.com/watch?v=${p}"\n >,\n <tracks>\n\n Your browser does not support HTML5 video.\n </video>\n `}else if(n.vimeo){u="lg-vimeo"+t;var v=function(e,o){if(!o||!o.vimeo)return"";var t=o.vimeo[2]||"",i=Object.assign({},{autoplay:0,muted:1},e),s=i&&0!==Object.keys(i).length?r(i):"",n=((o.vimeo[0].split("/").pop()||"").split("?")[0]||"").split("#")[0],a=o.vimeo[1]!==n;a&&(t=t.replace("/"+n,""));var l=a?"h="+n:"";return"?"+l+(s=l?"&"+s:s)+("?"==t[0]?"&"+t.slice(1):t||"")}(this.settings.vimeoPlayerParams,n);l='<iframe allow="autoplay" id='+u+' class="lg-video-object lg-vimeo '+o+'" '+a+' src="//player.vimeo.com/video/'+(n.vimeo[1]+v)+'" '+c+"></iframe>"}else if(n.wistia){var m="lg-wistia"+t;v=(v=r(this.settings.wistiaPlayerParams))?"?"+v:"",l='<iframe allow="autoplay" id="'+m+'" src="//fast.wistia.net/embed/iframe/'+(n.wistia[4]+v)+'" '+a+' class="wistia_embed lg-video-object lg-wistia '+o+'" name="wistia_embed" '+c+"></iframe>"}else if(n.dailymotion){var y="lg-dailymotion"+t;v=(v=r(this.settings.dailymotionPlayerParams))?"?"+v:"",l=`\n <iframe\n id="${y}"\n src="//dailymotion.com/embed/video/${n.dailymotion[1]}?api=1 ${v}"\n ${a}\n class="dailymotion_embed lg-video-object lg-dailymotiion ${o}"\n name="dailymotion_embed"\n ${c}>\n </iframe>\n `}else if(n.html5){for(var h="",g=0;g<i.source.length;g++){var f=i.source[g].type,b=f?'type="'+f+'"':"";h+='<source src="'+i.source[g].src+'" '+b+">"}if(i.tracks){var j=function(e){var o="",t=i.tracks[e];Object.keys(t||{}).forEach((function(e){o+=e+'="'+t[e]+'" '})),h+="<track "+o+">"};for(g=0;g<i.tracks.length;g++)j(g)}var k="",w=i.attributes||{};Object.keys(w||{}).forEach((function(e){k+=e+'="'+w[e]+'" '})),l='<video class="lg-video-object lg-html5 '+(this.settings.videojs&&this.settings.videojsTheme?this.settings.videojsTheme+" ":"")+" "+(this.settings.videojs?" video-js":"")+'" '+k+">\n "+h+"\n Your browser does not support HTML5 video.\n </video>"}return l},l.prototype.appendVideo=function(e,o){var t,i,s={},n=this.getVideoHtml(o.src,o.addClass,o.index,o.html5Video);e.find(".lg-video-cont").append(n);var a=e.find(".lg-video-object").first();if(a.get()){if(o.html5Video&&a.on("mousedown.lg.video",(function(e){e.stopPropagation()})),(s=this.core.galleryItems[o.index].__slideVideoInfo).videojs={enabled:!1},i=n.includes("iframe"),s.videojs.enabled=!i,this.settings.videojs&&(null==s?void 0:s.html5))try{if(s.videojs.enabled)return t=videojs(a.get(),this.settings.videojsOptions),this.settings.vjsPlayer=t,s.videojs.player=t,t}catch(e){console.warn("lightGallery: Make sure you have included //github.com/vimeo/player.js")}if(this.settings.videojs&&(null==s?void 0:s.youtube))try{if(s.videojs.enabled)return t=videojs(a.get(),this.settings.videojsOptions),this.settings.vjsPlayer=t,s.videojs.player=t,t}catch(e){console.warn("lightGallery: Make sure you have included //github.com/vimeo/player.js")}}},l.prototype.gotoNextSlideOnVideoEnd=function(e,o){var t=this,i=this.core.getSlideItem(o).find(".lg-video-object").first();if(i.get()){var s=this.core.galleryItems[o].__slideVideoInfo||{};if(this.settings.gotoNextSlideOnVideoEnd)if(s.html5)i.on("ended",(function(){t.core.goToNextSlide()}));else if(s.vimeo)try{new Vimeo.Player(i.get()).on("ended",(function(){t.core.goToNextSlide()}))}catch(e){console.error("lightGallery:- Make sure you have included //github.com/vimeo/player.js")}else if(s.wistia)try{window._wq=window._wq||[],window._wq.push({id:i.attr("id"),onReady:function(e){e.bind("end",(function(){t.core.goToNextSlide()}))}})}catch(e){console.error("lightGallery:- Make sure you have included //fast.wistia.com/assets/external/E-v1.js")}}},l.prototype.controlVideo=function(e,o){var t,i,s="not_set";if((t=this.core.getSlideItem(e).find(".lg-video-object").first()).get())if(((i=this.core.galleryItems[e].__slideVideoInfo||{}).html5||i.youtube)&&(void 0!==t.selector.player&&(s=t.selector.player),"not_set"!==s&&c(this,s,i)),i.html5)if(this.settings.videojs)try{videojs(t.get())[o]()}catch(e){console.warn("lightGallery: Make sure you have included videojs")}else t.get()[o]();else if(i.youtube)if(this.settings.videojs)try{videojs(t.get())[o]()}catch(e){console.warn("lightGallery: Make sure you have included videojs")}else try{t.get().contentWindow.postMessage('{"event":"command","func":"'+o+'Video","args":""}',"*")}catch(e){console.error("lightGallery:- "+e)}else if(i.vimeo)try{new Vimeo.Player(t.get())[o]()}catch(e){console.warn("lightGallery: Make sure you have included //github.com/vimeo/player.js")}else if(i.wistia)try{window._wq=window._wq||[],window._wq.push({id:t.attr("id"),onReady:function(e){e[o]()}})}catch(e){console.warn("lightGallery: Make sure you have included //fast.wistia.com/assets/external/E-v1.js")}},l.prototype.loadVideoOnPosterClick=function(e,o){var t=this;if(e.hasClass("lg-video-loaded"))o&&this.playVideo(this.core.index);else if(e.hasClass("lg-has-video"))this.playVideo(this.core.index);else{e.addClass("lg-has-video");var i=void 0,s=this.core.galleryItems[this.core.index].src,n=this.core.galleryItems[this.core.index].video;n&&(i="string"==typeof n?JSON.parse(n):n);var a=this.appendVideo(e,{src:s,addClass:"",index:this.core.index,html5Video:i});this.gotoNextSlideOnVideoEnd(s,this.core.index);var l=e.find(".lg-object").first().get();e.find(".lg-video-cont").first().append(l),e.addClass("lg-video-loading"),a&&a.ready((function(){a.on("loadedmetadata",(function(){t.onVideoLoadAfterPosterClick(e,t.core.index)}))})),e.find(".lg-video-object").first().on("load.lg error.lg loadedmetadata.lg",(function(){setTimeout((function(){t.onVideoLoadAfterPosterClick(e,t.core.index)}),50)}))}},l.prototype.onVideoLoadAfterPosterClick=function(e,o){e.addClass("lg-video-loaded"),this.playVideo(o)},l.prototype.destroy=function(){this.core.LGel.off(".lg.video"),this.core.LGel.off(".video")},l}()}));
|
@@ -27,9 +27,11 @@
|
|
27
27
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
28
28
|
typeof define === 'function' && define.amd ? define(factory) :
|
29
29
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.lgVimeoThumbnail = factory());
|
30
|
-
}(this, (function () {
|
30
|
+
}(this, (function () {
|
31
|
+
'use strict';
|
31
32
|
|
32
|
-
/*!
|
33
|
+
/*!
|
34
|
+
****************************************************************************
|
33
35
|
Copyright (c) Microsoft Corporation.
|
34
36
|
|
35
37
|
Permission to use, copy, modify, and/or distribute this software for any
|
@@ -42,7 +44,8 @@
|
|
42
44
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
43
45
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
44
46
|
PERFORMANCE OF THIS SOFTWARE.
|
45
|
-
|
47
|
+
****************************************************************************
|
48
|
+
*/
|
46
49
|
|
47
50
|
var __assign = function() {
|
48
51
|
__assign = Object.assign || function __assign(t) {
|
@@ -27,9 +27,11 @@
|
|
27
27
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
28
28
|
typeof define === 'function' && define.amd ? define(factory) :
|
29
29
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.lgZoom = factory());
|
30
|
-
}(this, (function () {
|
30
|
+
}(this, (function () {
|
31
|
+
'use strict';
|
31
32
|
|
32
|
-
/*!
|
33
|
+
/*!
|
34
|
+
****************************************************************************
|
33
35
|
Copyright (c) Microsoft Corporation.
|
34
36
|
|
35
37
|
Permission to use, copy, modify, and/or distribute this software for any
|
@@ -42,7 +44,8 @@
|
|
42
44
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
43
45
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
44
46
|
PERFORMANCE OF THIS SOFTWARE.
|
45
|
-
|
47
|
+
****************************************************************************
|
48
|
+
*/
|
46
49
|
|
47
50
|
var __assign = function() {
|
48
51
|
__assign = Object.assign || function __assign(t) {
|
@@ -78,13 +78,12 @@
|
|
78
78
|
}
|
79
79
|
|
80
80
|
/* auto HIDE VJS controlbar when video is PAUSED */
|
81
|
-
/*
|
82
81
|
.vjs-has-started.vjs-user-inactive.vjs-paused .vjs-control-bar {
|
83
82
|
visibility: visible;
|
84
83
|
opacity: 0;
|
85
84
|
transition: visibility 1s, opacity 1s;
|
86
85
|
}
|
87
|
-
|
86
|
+
|
88
87
|
|
89
88
|
/* manage time (display) divider, remaining-time */
|
90
89
|
.vjs-theme-uno .vjs-time-divider,
|
@@ -597,19 +597,34 @@
|
|
597
597
|
} // END
|
598
598
|
|
599
599
|
playbackRate() {
|
600
|
-
|
601
|
-
|
600
|
+
// jadams, 2025-06-22: check to prevent "Cannot read properties of undefined"
|
601
|
+
try {
|
602
|
+
return this.ytPlayer ? this.ytPlayer.getPlaybackRate() : 1;
|
603
|
+
} catch (error) {
|
604
|
+
return 1; // getDuration is not available/supported
|
605
|
+
}
|
606
|
+
} // END playbackRate
|
602
607
|
|
603
608
|
setPlaybackRate(suggestedRate) {
|
604
609
|
if (!this.ytPlayer) {
|
605
610
|
return;
|
606
611
|
}
|
607
612
|
|
608
|
-
|
609
|
-
|
613
|
+
// jadams, 2025-06-22: check to prevent "Cannot read properties of undefined"
|
614
|
+
try {
|
615
|
+
this.ytPlayer.setPlaybackRate(suggestedRate);
|
616
|
+
} catch (error) {
|
617
|
+
this.ytPlayer.setPlaybackRate(1); // getDuration is not available/supported
|
618
|
+
}
|
619
|
+
} // END setPlaybackRate
|
610
620
|
|
611
621
|
duration() {
|
612
|
-
|
622
|
+
// jadams, 2025-06-22: check to prevent "Cannot read properties of undefined"
|
623
|
+
try {
|
624
|
+
return this.ytPlayer ? this.ytPlayer.getDuration() : 0;
|
625
|
+
} catch (error) {
|
626
|
+
return 0; // return 0, if getDuration is not available/supported
|
627
|
+
}
|
613
628
|
} // END duration
|
614
629
|
|
615
630
|
currentSrc() {
|
@@ -861,4 +876,4 @@
|
|
861
876
|
console.error('\n' + 'invalid version of videoJS detected: ' + videojs.VERSION);
|
862
877
|
}
|
863
878
|
|
864
|
-
}));
|
879
|
+
}));
|