accordion.1840403ce81de408c749.bundle.min.js
4 years ago
accordion.a037e351fac33e9c9dfc.bundle.js
4 years ago
admin-feedback.js
4 years ago
admin-feedback.min.js
4 years ago
admin-modules.js
4 years ago
admin-modules.min.js
4 years ago
admin-top-bar.js
4 years ago
admin-top-bar.min.js
4 years ago
admin.js
4 years ago
admin.min.js
4 years ago
alert.85332a4bfb582d516461.bundle.js
4 years ago
alert.cbc2a0fee74ee3ed0419.bundle.min.js
4 years ago
app-loader.js
4 years ago
app-loader.min.js
4 years ago
app-packages.js
4 years ago
app-packages.min.js
4 years ago
app.js
4 years ago
app.min.js
4 years ago
app.min.js.LICENSE.txt
4 years ago
b5be57139d4edd0d5633.bundle.js
4 years ago
beta-tester.js
4 years ago
beta-tester.min.js
4 years ago
common-modules.js
4 years ago
common-modules.min.js
4 years ago
common.js
4 years ago
common.min.js
4 years ago
container-converter.js
4 years ago
container-converter.min.js
4 years ago
container.e026b16a99db8a3987c9.bundle.min.js
4 years ago
container.f3a37a5bf3c787312748.bundle.js
4 years ago
counter.02cef29c589e742d4c8c.bundle.min.js
4 years ago
counter.c75eea9549b9f8026ad8.bundle.js
4 years ago
editor-document.js
4 years ago
editor-document.min.js
4 years ago
editor-modules.js
4 years ago
editor-modules.min.js
4 years ago
editor.js
4 years ago
editor.min.js
4 years ago
elementor-admin-bar.js
4 years ago
elementor-admin-bar.min.js
4 years ago
fe4cf752908671676148.bundle.min.js
4 years ago
frontend-modules.js
4 years ago
frontend-modules.min.js
4 years ago
frontend.js
4 years ago
frontend.min.js
4 years ago
gutenberg.js
4 years ago
gutenberg.min.js
4 years ago
image-carousel.b69ea9450ea7e942e017.bundle.js
4 years ago
image-carousel.db284b09c0f8a8f1c44d.bundle.min.js
4 years ago
kit-library.4a93dd22359db6c3e7f9.bundle.min.js
4 years ago
kit-library.4b8e9bb062f992326c78.bundle.js
4 years ago
lightbox.2b2c155d6ec60974d8c4.bundle.min.js
4 years ago
lightbox.fe7d7981b2527f42f605.bundle.js
4 years ago
new-template.js
4 years ago
new-template.min.js
4 years ago
onboarding.6a289d52dcf568139a7d.bundle.min.js
4 years ago
onboarding.eff243c8052ee52943bc.bundle.js
4 years ago
preloaded-modules.js
4 years ago
preloaded-modules.min.js
4 years ago
progress.62211c8098d91fc19c5f.bundle.js
4 years ago
progress.ca55d33bb06cee4e6f02.bundle.min.js
4 years ago
tabs.37d5b4877cdb51ea91e9.bundle.min.js
4 years ago
tabs.973c14c2ee401e66e192.bundle.js
4 years ago
text-editor.289ae80d76f0c5abea44.bundle.min.js
4 years ago
text-editor.533215eb763ebfb3a70c.bundle.js
4 years ago
text-path.15d47ed8e5e3031f9610.bundle.js
4 years ago
text-path.9f18ebdea5ac00d653e5.bundle.min.js
4 years ago
toggle.56f8ace4b1e830c02fc5.bundle.min.js
4 years ago
toggle.66e1aea86557ee6b7fd9.bundle.js
4 years ago
video.255c225d20f04576d1bf.bundle.js
4 years ago
video.d86bfd0676264945e968.bundle.min.js
4 years ago
web-cli.js
4 years ago
web-cli.min.js
4 years ago
webpack.runtime.js
4 years ago
webpack.runtime.min.js
4 years ago
wp-audio.75f0ced143febb8cd31a.bundle.min.js
4 years ago
wp-audio.8d458e51b4543ed99c04.bundle.js
4 years ago
video.255c225d20f04576d1bf.bundle.js
223 lines
| 1 | /*! elementor - v3.5.6 - 21-03-2022 */ |
| 2 | "use strict"; |
| 3 | (self["webpackChunkelementor"] = self["webpackChunkelementor"] || []).push([["video"],{ |
| 4 | |
| 5 | /***/ "../assets/dev/js/frontend/handlers/video.js": |
| 6 | /*!***************************************************!*\ |
| 7 | !*** ../assets/dev/js/frontend/handlers/video.js ***! |
| 8 | \***************************************************/ |
| 9 | /***/ ((__unused_webpack_module, exports) => { |
| 10 | |
| 11 | |
| 12 | |
| 13 | Object.defineProperty(exports, "__esModule", ({ |
| 14 | value: true |
| 15 | })); |
| 16 | exports["default"] = void 0; |
| 17 | |
| 18 | class Video extends elementorModules.frontend.handlers.Base { |
| 19 | getDefaultSettings() { |
| 20 | return { |
| 21 | selectors: { |
| 22 | imageOverlay: '.elementor-custom-embed-image-overlay', |
| 23 | video: '.elementor-video', |
| 24 | videoIframe: '.elementor-video-iframe', |
| 25 | playIcon: '.elementor-custom-embed-play' |
| 26 | } |
| 27 | }; |
| 28 | } |
| 29 | |
| 30 | getDefaultElements() { |
| 31 | const selectors = this.getSettings('selectors'); |
| 32 | return { |
| 33 | $imageOverlay: this.$element.find(selectors.imageOverlay), |
| 34 | $video: this.$element.find(selectors.video), |
| 35 | $videoIframe: this.$element.find(selectors.videoIframe), |
| 36 | $playIcon: this.$element.find(selectors.playIcon) |
| 37 | }; |
| 38 | } |
| 39 | |
| 40 | handleVideo() { |
| 41 | if (this.getElementSettings('lightbox')) { |
| 42 | return; |
| 43 | } |
| 44 | |
| 45 | if ('youtube' === this.getElementSettings('video_type')) { |
| 46 | this.apiProvider.onApiReady(apiObject => { |
| 47 | this.elements.$imageOverlay.remove(); |
| 48 | this.prepareYTVideo(apiObject, true); |
| 49 | }); |
| 50 | } else { |
| 51 | this.elements.$imageOverlay.remove(); |
| 52 | this.playVideo(); |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | playVideo() { |
| 57 | if (this.elements.$video.length) { |
| 58 | // this.youtubePlayer exists only for YouTube videos, and its play function is different. |
| 59 | if (this.youtubePlayer) { |
| 60 | this.youtubePlayer.playVideo(); |
| 61 | } else { |
| 62 | this.elements.$video[0].play(); |
| 63 | } |
| 64 | |
| 65 | return; |
| 66 | } |
| 67 | |
| 68 | const $videoIframe = this.elements.$videoIframe, |
| 69 | lazyLoad = $videoIframe.data('lazy-load'); |
| 70 | |
| 71 | if (lazyLoad) { |
| 72 | $videoIframe.attr('src', lazyLoad); |
| 73 | } |
| 74 | |
| 75 | $videoIframe[0].src = this.apiProvider.getAutoplayURL($videoIframe[0].src); |
| 76 | } |
| 77 | |
| 78 | async animateVideo() { |
| 79 | const lightbox = await elementorFrontend.utils.lightbox; |
| 80 | lightbox.setEntranceAnimation(this.getCurrentDeviceSetting('lightbox_content_animation')); |
| 81 | } |
| 82 | |
| 83 | async handleAspectRatio() { |
| 84 | const lightbox = await elementorFrontend.utils.lightbox; |
| 85 | lightbox.setVideoAspectRatio(this.getElementSettings('aspect_ratio')); |
| 86 | } |
| 87 | |
| 88 | async hideLightbox() { |
| 89 | const lightbox = await elementorFrontend.utils.lightbox; |
| 90 | lightbox.getModal().hide(); |
| 91 | } |
| 92 | |
| 93 | prepareYTVideo(YT, onOverlayClick) { |
| 94 | const elementSettings = this.getElementSettings(), |
| 95 | playerOptions = { |
| 96 | videoId: this.videoID, |
| 97 | events: { |
| 98 | onReady: () => { |
| 99 | if (elementSettings.mute) { |
| 100 | this.youtubePlayer.mute(); |
| 101 | } |
| 102 | |
| 103 | if (elementSettings.autoplay || onOverlayClick) { |
| 104 | this.youtubePlayer.playVideo(); |
| 105 | } |
| 106 | }, |
| 107 | onStateChange: event => { |
| 108 | if (event.data === YT.PlayerState.ENDED && elementSettings.loop) { |
| 109 | this.youtubePlayer.seekTo(elementSettings.start || 0); |
| 110 | } |
| 111 | } |
| 112 | }, |
| 113 | playerVars: { |
| 114 | controls: elementSettings.controls ? 1 : 0, |
| 115 | rel: elementSettings.rel ? 1 : 0, |
| 116 | playsinline: elementSettings.play_on_mobile ? 1 : 0, |
| 117 | modestbranding: elementSettings.modestbranding ? 1 : 0, |
| 118 | autoplay: elementSettings.autoplay ? 1 : 0, |
| 119 | start: elementSettings.start, |
| 120 | end: elementSettings.end |
| 121 | } |
| 122 | }; // To handle CORS issues, when the default host is changed, the origin parameter has to be set. |
| 123 | |
| 124 | if (elementSettings.yt_privacy) { |
| 125 | playerOptions.host = 'https://www.youtube-nocookie.com'; |
| 126 | playerOptions.origin = window.location.hostname; |
| 127 | } |
| 128 | |
| 129 | this.youtubePlayer = new YT.Player(this.elements.$video[0], playerOptions); |
| 130 | } |
| 131 | |
| 132 | bindEvents() { |
| 133 | this.elements.$imageOverlay.on('click', this.handleVideo.bind(this)); |
| 134 | this.elements.$playIcon.on('keydown', event => { |
| 135 | const playKeys = [13, // Enter key. |
| 136 | 32 // Space bar key. |
| 137 | ]; |
| 138 | |
| 139 | if (playKeys.includes(event.keyCode)) { |
| 140 | this.handleVideo(); |
| 141 | } |
| 142 | }); |
| 143 | } |
| 144 | |
| 145 | onInit() { |
| 146 | super.onInit(); |
| 147 | const elementSettings = this.getElementSettings(); |
| 148 | |
| 149 | if (elementorFrontend.utils[elementSettings.video_type]) { |
| 150 | this.apiProvider = elementorFrontend.utils[elementSettings.video_type]; |
| 151 | } else { |
| 152 | this.apiProvider = elementorFrontend.utils.baseVideoLoader; |
| 153 | } |
| 154 | |
| 155 | if ('youtube' !== elementSettings.video_type) { |
| 156 | // Currently the only API integration in the Video widget is for the YT API |
| 157 | return; |
| 158 | } |
| 159 | |
| 160 | this.videoID = this.apiProvider.getVideoIDFromURL(elementSettings.youtube_url); // If there is an image overlay, the YouTube video prep method will be triggered on click |
| 161 | |
| 162 | if (!this.videoID) { |
| 163 | return; |
| 164 | } // If the user is using an image overlay, loading the API happens on overlay click instead of on init. |
| 165 | |
| 166 | |
| 167 | if (elementSettings.show_image_overlay && elementSettings.image_overlay.url) { |
| 168 | return; |
| 169 | } |
| 170 | |
| 171 | if (elementSettings.lazy_load) { |
| 172 | this.intersectionObserver = elementorModules.utils.Scroll.scrollObserver({ |
| 173 | callback: event => { |
| 174 | if (event.isInViewport) { |
| 175 | this.intersectionObserver.unobserve(this.elements.$video.parent()[0]); |
| 176 | this.apiProvider.onApiReady(apiObject => this.prepareYTVideo(apiObject)); |
| 177 | } |
| 178 | } |
| 179 | }); // We observe the parent, since the video container has a height of 0. |
| 180 | |
| 181 | this.intersectionObserver.observe(this.elements.$video.parent()[0]); |
| 182 | return; |
| 183 | } // When Optimized asset loading is set to off, the video type is set to 'Youtube', and 'Privacy Mode' is set |
| 184 | // to 'On', there might be a conflict with other videos that are loaded WITHOUT privacy mode, such as a |
| 185 | // video bBackground in a section. In these cases, to avoid the conflict, a timeout is added to postpone the |
| 186 | // initialization of the Youtube API object. |
| 187 | |
| 188 | |
| 189 | if (!elementorFrontend.config.experimentalFeatures['e_optimized_assets_loading']) { |
| 190 | setTimeout(() => { |
| 191 | this.apiProvider.onApiReady(apiObject => this.prepareYTVideo(apiObject)); |
| 192 | }, 0); |
| 193 | } else { |
| 194 | this.apiProvider.onApiReady(apiObject => this.prepareYTVideo(apiObject)); |
| 195 | } |
| 196 | } |
| 197 | |
| 198 | onElementChange(propertyName) { |
| 199 | if (0 === propertyName.indexOf('lightbox_content_animation')) { |
| 200 | this.animateVideo(); |
| 201 | return; |
| 202 | } |
| 203 | |
| 204 | const isLightBoxEnabled = this.getElementSettings('lightbox'); |
| 205 | |
| 206 | if ('lightbox' === propertyName && !isLightBoxEnabled) { |
| 207 | this.hideLightbox(); |
| 208 | return; |
| 209 | } |
| 210 | |
| 211 | if ('aspect_ratio' === propertyName && isLightBoxEnabled) { |
| 212 | this.handleAspectRatio(); |
| 213 | } |
| 214 | } |
| 215 | |
| 216 | } |
| 217 | |
| 218 | exports["default"] = Video; |
| 219 | |
| 220 | /***/ }) |
| 221 | |
| 222 | }]); |
| 223 | //# sourceMappingURL=video.255c225d20f04576d1bf.bundle.js.map |