j1-template 2024.3.25 → 2024.3.27
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/theme/!readme +1 -0
- data/assets/theme/j1/adapter/js/videojs.js +8 -6
- data/assets/theme/j1/core/css/themes/bootstrap/bootstrap.css +1 -1
- data/assets/theme/j1/core/css/themes/unodark/bootstrap.css +1 -1
- data/assets/theme/j1/core/css/themes/unolight/bootstrap.css +9 -9
- data/assets/theme/j1/core/css/themes/unolight/bootstrap.min.css +1 -1
- data/assets/theme/j1/core/js/template.min.js +6 -6
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-video.js +173 -78
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-video.min.js +2 -1
- data/assets/theme/j1/modules/videojs/css/themes/uno.css +1 -2
- data/assets/theme/j1/modules/videojs/css/themes/uno.min.css +1 -1
- data/assets/theme/j1/modules/videojs/js/video.js +10902 -10902
- data/assets/theme/j1/modules/videojs/plugins/players/vm/!examples/videojs_api/index.html +7 -7
- data/lib/j1/version.rb +1 -1
- data/lib/starter_web/Gemfile +9 -0
- data/lib/starter_web/README.md +5 -5
- data/lib/starter_web/_config.yml +1 -1
- data/lib/starter_web/_data/templates/feed.xml +1 -1
- data/lib/starter_web/_plugins/index/lunr.rb +1 -1
- data/lib/starter_web/package.json +1 -1
- data/lib/starter_web/pages/public/tools/tester/app_tester_amplitudejs_yt.adoc +2 -2
- data/lib/starter_web/pages/public/tools/tester/videojs_macro_tester.adoc +80 -116
- metadata +3 -3
- data/assets/theme/bla +0 -0
@@ -232,20 +232,126 @@
|
|
232
232
|
// -------------------------------------------------------------------------
|
233
233
|
var vjsProcessExtendedButtonsAndPlugins = function (vjsObject, videojsPlayer, videoInfo) {
|
234
234
|
const vjsOptions = j1.modules.videojs.options;
|
235
|
-
var dependency_met_module_ready, videoInfo,
|
236
|
-
|
237
|
-
|
235
|
+
var dependency_met_module_ready, videoInfo, playerState,
|
236
|
+
videoStart, videojsPlayer, playbackRates,
|
237
|
+
hotKeysPlugin, skipButtonsPlugin, zoomPlugin;
|
238
238
|
|
239
|
-
|
239
|
+
|
240
|
+
// ---------------------------------------------------------------------
|
241
|
+
// helper functions
|
242
|
+
// =====================================================================
|
243
|
+
|
244
|
+
// remove existng markers
|
245
|
+
// ---------------------------------------------------------------------
|
246
|
+
function removeChapterMarkers(timeline, currentPlayerId) {
|
247
|
+
timeline.find('.vjs-chapter-marker').remove();
|
248
|
+
}
|
249
|
+
|
250
|
+
// get player status
|
251
|
+
// ---------------------------------------------------------------------
|
252
|
+
function getPlayerStatus(player) {
|
253
|
+
return {
|
254
|
+
paused: player.paused(),
|
255
|
+
currentTime: player.currentTime(),
|
256
|
+
duration: player.duration(),
|
257
|
+
muted: player.muted(),
|
258
|
+
bufferedPercent: player.bufferedPercent()
|
259
|
+
};
|
260
|
+
}
|
261
|
+
|
262
|
+
// check if player is playing
|
263
|
+
// ---------------------------------------------------------------------
|
264
|
+
function isPlaying (player) {
|
265
|
+
var vjsIsPlaying = (!player.paused() || player.currentTime() > 0) ? true : false;
|
266
|
+
|
267
|
+
return vjsIsPlaying;
|
268
|
+
}
|
269
|
+
|
270
|
+
// set chapter markers for the player (videojsPlayer) specified
|
271
|
+
// ---------------------------------------------------------------------
|
272
|
+
function addChapterMarkers(videojsPlayer) {
|
273
|
+
var timeline = $(videojsPlayer.controlBar.progressControl.children_[0].el_);
|
274
|
+
var playerID = videojsPlayer.id();
|
275
|
+
var parser = new WebVTTParser();
|
276
|
+
var markers = [];
|
277
|
+
|
278
|
+
function cb_load (data /* ,textStatus, jqXHR */ ) {
|
279
|
+
var tree = parser.parse(data, 'metadata');
|
280
|
+
var marker;
|
281
|
+
|
282
|
+
// add chapter tracks to markers array
|
283
|
+
for (var i=0; i<tree.cues.length; i++) {
|
284
|
+
marker = { time: tree.cues[i].startTime, label: tree.cues[i].text };
|
285
|
+
markers.push(marker);
|
286
|
+
}
|
287
|
+
}; // END function cb_load
|
288
|
+
|
289
|
+
// create chapter tracks from source file
|
290
|
+
// -----------------------------------------------------------------
|
291
|
+
loadVtt(videojsPlayer.chapterTracksSource, cb_load);
|
292
|
+
|
293
|
+
// failsafe: remove already existing markers for current player
|
294
|
+
removeChapterMarkers(timeline, playerID);
|
295
|
+
|
296
|
+
// if tracks available, add (chapter) tracks on timeline
|
297
|
+
// -----------------------------------------------------------------
|
298
|
+
if (j1.modules.videojs.data.players[playerID].videoData.tracks.length) {
|
299
|
+
setTimeout (function() {
|
300
|
+
var markers_loaded = setInterval (function () {
|
301
|
+
if (markers.length) {
|
302
|
+
const duration = videojsPlayer.duration();
|
303
|
+
|
304
|
+
for (var i=0; i<markers.length; i++) {
|
305
|
+
var left = (markers[i].time / duration * 100) + '%';
|
306
|
+
var time = markers[i].time;
|
307
|
+
|
308
|
+
// add (unique) marker element
|
309
|
+
var el = $(
|
310
|
+
'<div class="vjs-chapter-marker" ' +
|
311
|
+
'style="left: ' + left + '" ' +
|
312
|
+
'data-time="' + time + '" ' +
|
313
|
+
'data-player-id="' + playerID + '">' +
|
314
|
+
'<span>' + markers[i].label + '</span></div>'
|
315
|
+
);
|
316
|
+
|
317
|
+
// event handler with closure for correct player reference
|
318
|
+
(function(currentPlayer, markerTime) {
|
319
|
+
el.click(function() {
|
320
|
+
currentPlayer.currentTime(markerTime);
|
321
|
+
});
|
322
|
+
})(videojsPlayer, time);
|
323
|
+
|
324
|
+
timeline.append(el);
|
325
|
+
}
|
326
|
+
|
327
|
+
clearInterval(markers_loaded);
|
328
|
+
} else {
|
329
|
+
clearInterval(markers_loaded);
|
330
|
+
} // END if markers.length
|
331
|
+
}, 10); // END interval markers_loaded
|
332
|
+
}, 100 ); // END timeout
|
333
|
+
} // END if chapterTracks enabled
|
334
|
+
} // END addChapterMarkers
|
335
|
+
|
336
|
+
|
337
|
+
// ---------------------------------------------------------------------
|
338
|
+
// main
|
339
|
+
// =====================================================================
|
340
|
+
dependency_met_module_ready = setInterval (() => {
|
341
|
+
var playerId, videoData, timeline;
|
240
342
|
var isModuleInitialised = (j1.adapter.gallery.getState() === 'finished') ? true : false;
|
241
343
|
var isVideojsOptions = (isEmpty(vjsObject.settings.videojsOptions)) ? false : true;
|
242
344
|
|
243
345
|
if (isModuleInitialised && isVideojsOptions) {
|
244
|
-
|
245
|
-
|
346
|
+
playerId = videojsPlayer.id();
|
347
|
+
videoData = { tracks: [] };
|
348
|
+
playerState = getPlayerStatus(videojsPlayer);
|
246
349
|
|
247
|
-
//
|
248
|
-
|
350
|
+
// set (initial) videoData tracks.chapters to empty array
|
351
|
+
videoData.tracks.chapters = [];
|
352
|
+
|
353
|
+
// ENABLE chapter tracks by default (to enable very first checks)
|
354
|
+
// videojsPlayer.chapterTracksEnabled = true;
|
249
355
|
|
250
356
|
var hotKeysPluginDefaults = {
|
251
357
|
volumeStep: vjsOptions.plugins.hotKeys.volumeStep,
|
@@ -424,101 +530,90 @@
|
|
424
530
|
|
425
531
|
} // END if zoom Plugin enabled
|
426
532
|
|
427
|
-
|
533
|
+
|
534
|
+
// chapter track processing, only available for VideoJS
|
428
535
|
// ---------------------------------------------------------
|
429
536
|
if (vjsObject.core.galleryItems[vjsObject.core.index].video !== undefined) {
|
430
537
|
videoData = JSON.parse(vjsObject.core.galleryItems[vjsObject.core.index].video);
|
538
|
+
videojsPlayer.videoData = videoData;
|
539
|
+
|
540
|
+
// save VJS videoData for later use
|
541
|
+
// NOTE: for unknown reasons, lightGallery generates
|
542
|
+
// WRONG videoData on skip forwaed|backward a video slide
|
543
|
+
// Workaround: do NOT overwrite existing video data
|
544
|
+
// stored in current window (j1.modules.videojs.data)
|
545
|
+
// -----------------------------------------------------
|
546
|
+
if (j1.modules.videojs.data.players[playerId] === undefined) {
|
547
|
+
j1.modules.videojs.data.players[playerId] = {};
|
548
|
+
j1.modules.videojs.data.players[playerId]['videoData'] = {};
|
549
|
+
j1.modules.videojs.data.players[playerId].videoData['tracks'] = videoData.tracks || [];
|
550
|
+
}
|
431
551
|
}
|
432
552
|
|
433
|
-
// load tracks
|
434
|
-
// TODO: chapterTracksEnabled needs to be indivialized
|
435
|
-
// per player
|
553
|
+
// load source file for chapter tracks
|
436
554
|
// ---------------------------------------------------------
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
}
|
555
|
+
var chapterTracksSrc;
|
556
|
+
for (var i=0; i<videojsPlayer.videoData.tracks.length; i++) {
|
557
|
+
if (videojsPlayer.videoData.tracks[i].kind == 'chapters') {
|
558
|
+
chapterTracksSrc = videojsPlayer.videoData.tracks[i].src;
|
559
|
+
videojsPlayer.chapterTracksSource = chapterTracksSrc;
|
443
560
|
}
|
444
|
-
}
|
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
|
462
|
-
|
463
|
-
// load chapter tracks
|
464
|
-
// -----------------------------------------------------
|
465
|
-
loadVtt(trackSrc, cb_load);
|
466
|
-
|
467
|
-
// add chapter tracks on player is playing
|
468
|
-
// -----------------------------------------------------
|
469
|
-
videojsPlayer.on("play", function() {
|
470
|
-
videojsPlayer.currentTime(videoStart);
|
561
|
+
}
|
471
562
|
|
472
|
-
|
473
|
-
|
563
|
+
// process chapter tracks
|
564
|
+
if (j1.modules.videojs.data.players[playerId].videoData.tracks.length) {
|
565
|
+
playerId = videojsPlayer.id();
|
566
|
+
timeline = $(videojsPlayer.controlBar.progressControl.children_[0].el_);
|
474
567
|
|
475
|
-
|
476
|
-
timeline.find('.vjs-chapter-marker').remove();
|
568
|
+
removeChapterMarkers(timeline, playerId);
|
477
569
|
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
timeline.find('.vjs-chapter-marker').remove();
|
570
|
+
// add chapter tracks when playing alreay (e.g. autoplay)
|
571
|
+
// -----------------------------------------------------
|
572
|
+
if (isPlaying(videojsPlayer)) {
|
573
|
+
addChapterMarkers(videojsPlayer)
|
574
|
+
} // END if VideoJS player isPlaying
|
484
575
|
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
576
|
+
// jadams, 2025-06-22: prepare settting start position
|
577
|
+
// TODO: coding is to be continued
|
578
|
+
// -----------------------------------------------------
|
579
|
+
// videojsPlayer.currentTime(videoStart);
|
489
580
|
|
490
|
-
|
491
|
-
|
492
|
-
|
581
|
+
// remove chapter tracks on event 'pause'
|
582
|
+
// -----------------------------------------------------
|
583
|
+
videojsPlayer.on("pause", function() {
|
584
|
+
var timeline = $(videojsPlayer.controlBar.progressControl.children_[0].el_);
|
493
585
|
|
494
|
-
|
495
|
-
|
496
|
-
clearInterval(markers_loaded);
|
497
|
-
}
|
498
|
-
}, 10); // END markers_loaded
|
499
|
-
}, 100 ); // END setTimeout
|
586
|
+
removeChapterMarkers(timeline, videojsPlayer.id());
|
587
|
+
}); // END on event 'pause'
|
500
588
|
|
501
|
-
|
502
|
-
|
503
|
-
// remove chapter tracks on playing
|
504
|
-
// -----------------------------------------------------
|
589
|
+
// add chapter tracks on event 'play'
|
590
|
+
// -----------------------------------------------------
|
505
591
|
videojsPlayer.on("play", function() {
|
506
|
-
videojsPlayer
|
507
|
-
|
592
|
+
addChapterMarkers(videojsPlayer)
|
593
|
+
}); // END on event 'play'
|
508
594
|
|
509
|
-
|
510
|
-
|
595
|
+
// failsafe: remove chapter markers on the player removed||destroyed
|
596
|
+
videojsPlayer.on("dispose", function() {
|
597
|
+
var timeline = $(videojsPlayer.controlBar.progressControl.children_[0].el_);
|
511
598
|
|
599
|
+
// remove already existing markers for the player destroyed
|
600
|
+
removeChapterMarkers(timeline, videojsPlayer.id());
|
512
601
|
});
|
513
602
|
|
514
|
-
}
|
603
|
+
} else {
|
604
|
+
// remove existing chapter markers if NO tracks enabled
|
605
|
+
var timeline = $(videojsPlayer.controlBar.progressControl.children_[0].el_);
|
606
|
+
var playerId = videojsPlayer.id();
|
607
|
+
|
608
|
+
removeChapterMarkers(timeline, playerId);
|
609
|
+
} // END if chapterTracks enabled
|
515
610
|
|
516
611
|
} // END if videojsOptions
|
517
612
|
|
518
613
|
clearInterval(dependency_met_module_ready);
|
519
614
|
} // END if isModuleInitialised
|
520
615
|
|
521
|
-
|
616
|
+
}, 10); // END interval dependency_met_module_ready
|
522
617
|
|
523
618
|
}; // END vjsProcessExtendedButtonsAndPlugins
|
524
619
|
|
@@ -16,4 +16,5 @@
|
|
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,h,y="finished"===j1.adapter.gallery.getState(),g=!l(o.settings.videojsOptions);if(y&&g){_=t.id(),m={tracks:[]},{paused:(h=t).paused(),currentTime:h.currentTime(),duration:h.duration(),muted:h.muted(),bufferedPercent:h.bufferedPercent()},m.tracks.chapters=[];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 y=k.addChild("Component",{el:videojs.dom.createEl("div",{className:"vjs-theme-uno custom-progressbar-container"})}),g=k.progressControl;g&&y.el().appendChild(g.el());const O=k.currentTimeDisplay;O&&y.el().insertBefore(O.el(),g.el());const C=k.durationDisplay;if(C&&y.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})}var S;void 0!==o.core.galleryItems[o.core.index].video&&(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\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 h="lg-dailymotion"+t;v=(v=r(this.settings.dailymotionPlayerParams))?"?"+v:"",l=`\n <iframe\n id="${h}"\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 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 j=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++)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 "+y+"\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}()}));
|
20
|
+
|
@@ -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,
|
@@ -16,4 +16,4 @@
|
|
16
16
|
# -----------------------------------------------------------------------------
|
17
17
|
*/
|
18
18
|
|
19
|
-
.vjs-theme-uno{--vjs-theme-uno--blue-300:#64b5f6;--vjs-theme-uno--blue-600:#1e88e5;--vjs-theme-uno--blue-800:#1565c0;--vjs-theme-uno--gray-200:var(--vjs-theme-uno--gray-200);--vjs-theme-uno--gray-900:#212121;--vjs-theme-uno--primary:#2196f3;--vjs-theme-uno--secondary:#fff}.video-js .vjs-text-track-display div{font-size:1.75rem}.video-js .vjs-text-track-display>div>div>div{background:transparent !important;display:inline-block !important;line-height:33px !important;padding:5px !important;text-shadow:1px 1px 2px #000}picture>img{max-width:100%}.vjs-poster{height:100%}.vjs-theme-uno .vjs-control-bar{height:55px;top:calc(100% - 54px);background-color:var(--vjs-theme-uno--gray-900);z-index:100}.vjs-has-started.vjs-user-inactive.vjs-paused .vjs-control-bar{visibility:visible;opacity:0;transition:visibility 1s,opacity 1s}.vjs-theme-uno .vjs-time-divider,.vjs-theme-uno .vjs-remaining-time{display:none !important}.vjs-icon-play:before{content:"\f101"}.vjs-theme-uno .vjs-big-play-button{top:25%;left:35%;width:240px;height:240px;font-size:0;z-index:1;background:url(/assets/theme/j1/modules/videojs/assets/icons/big-play-button.svg) no-repeat}.vjs-theme-uno .vjs-big-play-button:hover{top:25%;left:35%;width:240px;height:240px;font-size:0;z-index:1;background:url(/assets/theme/j1/modules/videojs/assets/icons/big-play-button-hover.svg) no-repeat}.vjs-theme-uno.vjs-big-play-button:focus,.vjs-theme-uno:hover .vjs-big-play-button{background-color:transparent}.vjs-theme-uno .vjs-button>.vjs-icon-placeholder:before,.vjs-theme-uno .vjs-time-control{line-height:54px}.video-js .vjs-time-control{font-size:1.6em}.vjs-theme-uno .vjs-play-control{position:relative;margin-top:3px;width:48px;font-size:1.4em}.vjs-theme-uno .vjs-volume-panel{order:4}.vjs-theme-uno .vjs-volume-bar{margin-top:2.5em}.vjs-volume-bar.vjs-slider-vertical{width:.3em;height:5em !important;margin:1.35em auto}.vjs-theme-uno .vjs-volume-panel:hover .vjs-volume-control.vjs-volume-horizontal{height:100%}.vjs-playback-rate{margin-top:12px !important}.vjs-playback-rate .vjs-menu{top
|
19
|
+
.vjs-theme-uno{--vjs-theme-uno--blue-300:#64b5f6;--vjs-theme-uno--blue-600:#1e88e5;--vjs-theme-uno--blue-800:#1565c0;--vjs-theme-uno--gray-200:var(--vjs-theme-uno--gray-200);--vjs-theme-uno--gray-900:#212121;--vjs-theme-uno--primary:#2196f3;--vjs-theme-uno--secondary:#fff}.vjs-menu .vjs-menu-content{font-family:"Roboto Slab",Arial,Helvetica,sans-serif}.vjs-menu-button-popup .vjs-menu .vjs-menu-content{bottom:6em}.video-js .vjs-text-track-display div{font-size:1.75rem}.video-js .vjs-text-track-display>div>div>div{background:transparent !important;display:inline-block !important;line-height:33px !important;padding:5px !important;text-shadow:1px 1px 2px #000}picture>img{max-width:100%}.vjs-poster{height:100%}.vjs-theme-uno .vjs-control-bar{height:55px;top:calc(100% - 54px);background-color:var(--vjs-theme-uno--gray-900);z-index:100}.vjs-has-started.vjs-user-inactive.vjs-paused .vjs-control-bar{visibility:visible;opacity:0;transition:visibility 1s,opacity 1s}.vjs-theme-uno .vjs-time-divider,.vjs-theme-uno .vjs-remaining-time{display:none !important}.vjs-icon-play:before{content:"\f101"}.vjs-theme-uno .vjs-big-play-button{top:25%;left:35%;width:240px;height:240px;font-size:0;z-index:1;background:url(/assets/theme/j1/modules/videojs/assets/icons/big-play-button.svg) no-repeat}.vjs-theme-uno .vjs-big-play-button:hover{top:25%;left:35%;width:240px;height:240px;font-size:0;z-index:1;background:url(/assets/theme/j1/modules/videojs/assets/icons/big-play-button-hover.svg) no-repeat}.vjs-theme-uno.vjs-big-play-button:focus,.vjs-theme-uno:hover .vjs-big-play-button{background-color:transparent}.vjs-theme-uno .vjs-button>.vjs-icon-placeholder:before,.vjs-theme-uno .vjs-time-control{line-height:54px}.video-js .vjs-time-control{font-size:1.6em}.vjs-theme-uno .vjs-play-control{position:relative;margin-top:3px;width:48px;font-size:1.4em}.vjs-theme-uno .vjs-volume-panel{order:4}.vjs-theme-uno .vjs-volume-bar{margin-top:2.5em}.vjs-volume-bar.vjs-slider-vertical{width:.3em;height:5em !important;margin:1.35em auto}.vjs-theme-uno .vjs-volume-panel:hover .vjs-volume-control.vjs-volume-horizontal{height:100%}.vjs-playback-rate{margin-top:12px !important}.vjs-playback-rate .vjs-menu{top:28px}.video-js .vjs-volume-vertical{bottom:10em;background-color:rgba(43,51,63,0.7)}.video-js .custom-progressbar-container{position:absolute;align-items:center;top:-26px;bottom:100%;left:0;right:0;width:100%;height:30px;display:flex;background-color:transparent;box-sizing:border-box}.video-js .custom-progressbar-container .vjs-progress-control{flex-grow:1;position:static;height:100%;display:flex;align-items:center}.vjs-theme-uno .video-js .vjs-progress-control .vjs-progress-holder{font-size:1em}.vjs-theme-uno .video-js .vjs-progress-control:hover .vjs-progress-holder{font-size:1.5em}.vjs-theme-uno .vjs-time-control,.video-js .vjs-current-time,.video-js .vjs-duration{display:block;top:-12px}.vjs-theme-uno .vjs-current-time .vjs-duration{display:block;line-height:3em !important}.video-js .custom-progressbar-container .vjs-progress-control .vjs-play-progress,.video-js .custom-progressbar-container .vjs-progress-control .vjs-load-progress,.video-js .custom-progressbar-container .vjs-progress-control .vjs-mouse-display{height:100%;border-radius:0}.video-js .vjs-load-progress{background-color:rgba(255,255,255,0.3)}.video-js .custom-time-display{color:#fff;font-size:.9em;min-width:50px;text-align:center}.video-js .custom-progressbar-container .vjs-current-time-display{order:-1}.video-js .vjs-remaining-time-display,.video-js .vjs-duration-display{color:#fff;font-size:.9em;padding:0 5px;white-space:nowrap}.video-js .vjs-progress-control{position:absolute;top:-18px;left:0;right:0;width:100%;height:1em;margin-top:0;background-color:transparent}.video-js .vjs-slider{height:1em;margin-top:0}.video-js .vjs-progress-control .vjs-play-progress:before{appearance:none;visibility:hidden}.video-js .vjs-progress-control:hover .vjs-play-progress .vjs-time-tooltip{font-size:.9em;padding:.35em .35em;border-radius:3px}.video-js .vjs-mouse-display{font-size:1.5em;padding:.25em .25em;border-radius:3px;transform:translateX(-50%);color:white;background-color:rgba(0,0,0,0.7)}.vjs-theme-uno .vjs-play-control .vjs-icon-placeholder:before{height:1.3em;width:1.3em;margin-top:.2em;border-radius:1em;border:3px solid var(--vjs-theme-uno--secondary);top:2px;left:9px;line-height:1.1}.vjs-theme-uno .vjs-play-control:hover .vjs-icon-placeholder:before{border:3px solid var(--vjs-theme-uno--secondary)}.vjs-theme-uno .vjs-play-progress,.vjs-theme-uno .vjs-play-progress:before{background-color:var(--vjs-theme-uno--primary)}.vjs-theme-uno .vjs-play-progress:before{height:.8em;width:.8em;content:"";border:4px solid var(--vjs-theme-uno--secondary);border-radius:.8em;top:-0.25em}.vjs-theme-uno .vjs-progress-control{font-size:14px}.vjs-theme-uno .vjs-fullscreen-control{order:6}.vjs-theme-uno.nyan .vjs-play-progress{background:linear-gradient(180deg,#fe0000 0,#fe9a01 16.666666667%,#fe9a01 0,#ff0 33.332666667%,#ff0 0,#32ff00 49.999326667%,#32ff00 0,#0099fe 66.6659926%,#0099fe 0,#63f 83.33266%,#63f 0)}.vjs-theme-uno.nyan .vjs-play-progress:before{height:1.3em;width:1.3em;background:url("data:image/svg+xml;charset=utf-8,%3Csvgxmlns='http://www.w3.org/2000/svg'viewBox='00100125'fill='%23fff'%3E%3Cpathd='M62.15337.323h2.813v3.246h-2.813zM64.85840.569h2.813v3.246h-2.813zM67.67243.814h11.9v3.246h-11.9zM79.57224.449h2.813v19.365h-2.813zM82.38637.323h3.244v3.246h-3.244zM85.6334.132h5.627v3.246H85.63zM91.25737.323h2.92v12.95h-2.92zM94.17750.274h2.922V66.21h-2.922zM91.2966.372h2.887v3.245H91.29zM88.40169.617h2.889v3.246h-2.889zM27.31272.863h61.003v3.245H27.312zM73.62276.108h2.889v3.246h-2.889zM82.56376.108h2.888v3.246h-2.888zM76.51179.354h6.053v3.245h-6.053zM61.94179.354h8.895v3.245h-8.895zM67.94776.108h2.889v3.246h-2.889zM59.32176.108h2.888v3.246h-2.888zM27.31217.917h49.387v3.246H27.312zM76.69921.162h2.873v3.287h-2.873zM56.37234.132h5.781v3.191h-5.781zM53.44837.323h2.924v12.951h-2.924zM50.48850.274h2.96v16.049h-2.96zM53.44866.323h2.924v3.257h-2.924zM56.37269.58h2.949v3.283h-2.949zM65.06963.213h2.878v6.367h-2.878zM67.94766.397h17.504v3.22H67.947z'/%3E%3Cpathd='M82.56363.213h2.888v3.185h-2.888zM73.80163.213h2.898v3.185h-2.898zM76.69956.774h2.873v3.145h-2.873zM82.56356.774h2.888v3.145h-2.888zM85.45153.444h2.864v3.33h-2.864z'/%3E%3Cpathd='M85.45156.774h2.864v3.145h-2.864zM65.06953.444h2.878v3.33h-2.878zM65.06956.774h2.878v3.145h-2.878zM62.20956.774h2.86v3.145h-2.86zM21.50924.327h2.813v45.169h-2.813zM24.32321.162h2.99v3.165h-2.99zM18.56269.496h8.75v3.367h-8.75zM15.65672.863h2.906v9.591h-2.906zM18.56279.301h8.75v3.153h-8.75zM24.32376.108h5.743V79.3h-5.743zM33.13676.108h2.824v6.346h-2.824zM35.9679.281h5.813v3.173H35.96zM41.77476.108h2.864v3.173h-2.864zM3.94840.569h11.708v3.229H3.948zM3.94843.814h2.921v6.459H3.948zM6.86947.06h2.934v6.384H6.869zM9.80350.274h2.909v6.5H9.803z'/%3E%3Cpathd='M12.71153.444h2.945v6.475h-2.945zM15.65656.774h5.853v3.145h-5.853z'/%3E%3Cpathd='M18.58359.919h2.926v3.294h-2.926zM18.58347.044h2.926v6.4h-2.926zM12.71143.814h5.872v3.229h-5.872zM15.64747.044h2.936v3.2h-2.936z'/%3E%3Cpathfill='none'd='M47.43950.274h3.049v3.17h-3.049z'/%3E%3Cpathd='M73.80130.94v-3.138h-2.965v-3.354l-37.7-.122v3.151h-3.07v3.462l-2.753-.108-.11832.381h2.871v3.185h3.07v-3.185h2.824v3.185h-2.824v3.099l20.312.084v-3.257h-2.96V50.274h2.96V37.323h2.924v-3.191h5.781v3.191h2.813l-.1083.246h2.813v3.246h9.027V30.94h-2.897zM33.13656.682h-3.07v-3.158h3.07v3.158zm2.824-22.55h-2.824v-3.084h2.824v3.084zm2.90712.928h2.907v3.184h-2.907V47.06zm5.77116.153h-2.864v-3.294h2.864v3.294zm2.801-19.399h-2.801v-3.246h2.801v3.246zm6.009-12.766h-2.96v-3.354h2.96v3.354zm8.7050h-2.832v-3.354h2.832v3.354zm8.6836.275h-2.889v-3.191h2.889v3.191z'/%3E%3C/svg%3E") no-repeat;border:0;top:-0.35em}@media screen and (max-width:39.9375em){.vjs-theme-uno .vjs-big-play-button{top:35%;left:45%;width:120px;height:120px;z-index:1;background:url(/assets/theme/j1/modules/videojs/assets/icons/small/big-play-button.svg) no-repeat}.vjs-theme-uno .vjs-big-play-button:hover{top:35%;left:45%;width:120px;height:120px;z-index:1;background:url(/assets/theme/j1/modules/videojs/assets/icons/small/big-play-button-hover.svg) no-repeat}}
|