', {
class: classes.videoContainer + ' ' + classes.invisible
}),
$videoWrapper = jQuery('
', {
class: classes.videoWrapper
}),
$playIcon = $activeSlide.children('.' + classes.playButton);
let videoType, apiProvider;
$videoContainer.append($videoWrapper);
$activeSlide.append($videoContainer);
if (-1 !== videoURL.indexOf('vimeo.com')) {
videoType = 'vimeo';
apiProvider = elementorFrontend.utils.vimeo;
} else if (videoURL.match(/^(?:https?:\/\/)?(?:www\.)?(?:m\.)?(?:youtu\.be\/|youtube\.com)/)) {
videoType = 'youtube';
apiProvider = elementorFrontend.utils.youtube;
}
const videoID = apiProvider.getVideoIDFromURL(videoURL);
apiProvider.onApiReady(apiObject => {
if ('youtube' === videoType) {
this.prepareYTVideo(apiObject, videoID, $videoContainer, $videoWrapper, $playIcon);
} else if ('vimeo' === videoType) {
this.prepareVimeoVideo(apiObject, videoURL, $videoContainer, $videoWrapper, $playIcon);
}
});
$playIcon.addClass(classes.playing).removeClass(classes.hidden);
},
prepareYTVideo(YT, videoID, $videoContainer, $videoWrapper, $playIcon) {
const classes = this.getSettings('classes'),
$videoPlaceholderElement = jQuery('
');
let startStateCode = YT.PlayerState.PLAYING;
$videoWrapper.append($videoPlaceholderElement);
// Since version 67, Chrome doesn't fire the `PLAYING` state at start time
if (window.chrome) {
startStateCode = YT.PlayerState.UNSTARTED;
}
$videoContainer.addClass('elementor-loading' + ' ' + classes.invisible);
this.player = new YT.Player($videoPlaceholderElement[0], {
videoId: videoID,
events: {
onReady: () => {
$playIcon.addClass(classes.hidden);
$videoContainer.removeClass(classes.invisible);
this.player.playVideo();
},
onStateChange: event => {
if (event.data === startStateCode) {
$videoContainer.removeClass('elementor-loading' + ' ' + classes.invisible);
}
}
},
playerVars: {
controls: 0,
rel: 0
}
});
},
prepareVimeoVideo(Vimeo, videoURL, $videoContainer, $videoWrapper, $playIcon) {
const classes = this.getSettings('classes'),
vimeoOptions = {
url: videoURL,
autoplay: true,
transparent: false,
playsinline: false
};
this.player = new Vimeo.Player($videoWrapper, vimeoOptions);
this.player.ready().then(() => {
$playIcon.addClass(classes.hidden);
$videoContainer.removeClass(classes.invisible);
});
},
setEntranceAnimation(animation) {
animation = animation || elementorFrontend.getCurrentDeviceSetting(this.getSettings('modalOptions'), 'entranceAnimation');
const $widgetMessage = this.getModal().getElements('message');
if (this.oldAnimation) {
$widgetMessage.removeClass(this.oldAnimation);
}
this.oldAnimation = animation;
if (animation) {
$widgetMessage.addClass('animated ' + animation);
}
},
openSlideshow(slideshowID, initialSlideURL) {
const $allSlideshowLinks = jQuery(this.getSettings('selectors.links')).filter((index, element) => {
const $element = jQuery(element);
return slideshowID === element.dataset.elementorLightboxSlideshow && !$element.parent('.swiper-slide-duplicate').length && !$element.parents('.slick-cloned').length;
});
const slides = [];
let initialSlideIndex = 0;
$allSlideshowLinks.each(function () {
const slideVideo = this.dataset.elementorLightboxVideo;
let slideIndex = this.dataset.elementorLightboxIndex;
if (undefined === slideIndex) {
slideIndex = $allSlideshowLinks.index(this);
}
if (initialSlideURL === this.href || slideVideo && initialSlideURL === slideVideo) {
initialSlideIndex = slideIndex;
}
const slideData = {
image: this.href,
index: slideIndex,
title: this.dataset.elementorLightboxTitle,
description: this.dataset.elementorLightboxDescription,
hash: this.getAttribute('data-e-action-hash')
};
if (slideVideo) {
slideData.video = slideVideo;
}
slides.push(slideData);
});
slides.sort((a, b) => a.index - b.index);
this.showModal({
type: 'slideshow',
id: slideshowID,
modalOptions: {
id: 'elementor-lightbox-slideshow-' + slideshowID
},
slideshow: {
slides,
swiper: {
initialSlide: +initialSlideIndex
}
}
});
},
onSlideChange() {
this.getSlide('prev').add(this.getSlide('next')).add(this.getSlide('active')).find('.' + this.getSettings('classes.videoWrapper')).remove();
this.playSlideVideo();
this.updateFooterText();
}
});
/***/ }),
/***/ "../assets/dev/js/frontend/utils/lightbox/screenfull.js":
/*!**************************************************************!*\
!*** ../assets/dev/js/frontend/utils/lightbox/screenfull.js ***!
\**************************************************************/
/***/ ((module) => {
"use strict";
(function () {
'use strict';
var document = typeof window !== 'undefined' && typeof window.document !== 'undefined' ? window.document : {};
var isCommonjs = true && module.exports;
var fn = function () {
var val;
var fnMap = [['requestFullscreen', 'exitFullscreen', 'fullscreenElement', 'fullscreenEnabled', 'fullscreenchange', 'fullscreenerror'],
// New WebKit
['webkitRequestFullscreen', 'webkitExitFullscreen', 'webkitFullscreenElement', 'webkitFullscreenEnabled', 'webkitfullscreenchange', 'webkitfullscreenerror'],
// Old WebKit
['webkitRequestFullScreen', 'webkitCancelFullScreen', 'webkitCurrentFullScreenElement', 'webkitCancelFullScreen', 'webkitfullscreenchange', 'webkitfullscreenerror'], ['mozRequestFullScreen', 'mozCancelFullScreen', 'mozFullScreenElement', 'mozFullScreenEnabled', 'mozfullscreenchange', 'mozfullscreenerror'], ['msRequestFullscreen', 'msExitFullscreen', 'msFullscreenElement', 'msFullscreenEnabled', 'MSFullscreenChange', 'MSFullscreenError']];
var i = 0;
var l = fnMap.length;
var ret = {};
for (; i < l; i++) {
val = fnMap[i];
if (val && val[1] in document) {
var valLength = val.length;
for (i = 0; i < valLength; i++) {
ret[fnMap[0][i]] = val[i];
}
return ret;
}
}
return false;
}();
var eventNameMap = {
change: fn.fullscreenchange,
error: fn.fullscreenerror
};
var screenfull = {
request(element) {
return new Promise(function (resolve, reject) {
var onFullScreenEntered = function () {
this.off('change', onFullScreenEntered);
resolve();
}.bind(this);
this.on('change', onFullScreenEntered);
element = element || document.documentElement;
Promise.resolve(element[fn.requestFullscreen]()).catch(reject);
}.bind(this));
},
exit() {
return new Promise(function (resolve, reject) {
if (!this.isFullscreen) {
resolve();
return;
}
var onFullScreenExit = function () {
this.off('change', onFullScreenExit);
resolve();
}.bind(this);
this.on('change', onFullScreenExit);
Promise.resolve(document[fn.exitFullscreen]()).catch(reject);
}.bind(this));
},
toggle(element) {
return this.isFullscreen ? this.exit() : this.request(element);
},
onchange(callback) {
this.on('change', callback);
},
onerror(callback) {
this.on('error', callback);
},
on(event, callback) {
var eventName = eventNameMap[event];
if (eventName) {
document.addEventListener(eventName, callback, false);
}
},
off(event, callback) {
var eventName = eventNameMap[event];
if (eventName) {
document.removeEventListener(eventName, callback, false);
}
},
raw: fn
};
if (!fn) {
if (isCommonjs) {
module.exports = {
isEnabled: false
};
} else {
window.screenfull = {
isEnabled: false
};
}
return;
}
Object.defineProperties(screenfull, {
isFullscreen: {
get() {
return Boolean(document[fn.fullscreenElement]);
}
},
element: {
enumerable: true,
get() {
return document[fn.fullscreenElement];
}
},
isEnabled: {
enumerable: true,
get() {
// Coerce to boolean in case of old WebKit
return Boolean(document[fn.fullscreenEnabled]);
}
}
});
if (isCommonjs) {
module.exports = screenfull;
} else {
window.screenfull = screenfull;
}
})();
/***/ }),
/***/ "../node_modules/@babel/runtime/helpers/defineProperty.js":
/*!****************************************************************!*\
!*** ../node_modules/@babel/runtime/helpers/defineProperty.js ***!
\****************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js");
function _defineProperty(obj, key, value) {
key = toPropertyKey(key);
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ "../node_modules/@babel/runtime/helpers/toPrimitive.js":
/*!*************************************************************!*\
!*** ../node_modules/@babel/runtime/helpers/toPrimitive.js ***!
\*************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
function _toPrimitive(input, hint) {
if (_typeof(input) !== "object" || input === null) return input;
var prim = input[Symbol.toPrimitive];
if (prim !== undefined) {
var res = prim.call(input, hint || "default");
if (_typeof(res) !== "object") return res;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (hint === "string" ? String : Number)(input);
}
module.exports = _toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ "../node_modules/@babel/runtime/helpers/toPropertyKey.js":
/*!***************************************************************!*\
!*** ../node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
\***************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ "../node_modules/@babel/runtime/helpers/toPrimitive.js");
function _toPropertyKey(arg) {
var key = toPrimitive(arg, "string");
return _typeof(key) === "symbol" ? key : String(key);
}
module.exports = _toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ "../node_modules/@babel/runtime/helpers/typeof.js":
/*!********************************************************!*\
!*** ../node_modules/@babel/runtime/helpers/typeof.js ***!
\********************************************************/
/***/ ((module) => {
function _typeof(obj) {
"@babel/helpers - typeof";
return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
return typeof obj;
} : function (obj) {
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
}, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
}
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ })
},
/******/ __webpack_require__ => { // webpackRuntimeModules
/******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
/******/ __webpack_require__.O(0, ["frontend","frontend-modules"], () => (__webpack_exec__("../assets/dev/js/frontend/preloaded-modules.js")));
/******/ var __webpack_exports__ = __webpack_require__.O();
/******/ }
]);
//# sourceMappingURL=preloaded-modules.js.map