<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">{"version":3,"file":"jarallax-video.min.js","sources":["../node_modules/video-worker/dist/video-worker.esm.js","../src/utils/global.js","../src/utils/ready.js","../src/ext-video.js","../src/ext-video.umd.js"],"sourcesContent":["/*!\n * Name    : Video Worker\n * Version : 2.0.0\n * Author  : nK &lt;https://nkdev.info&gt;\n * GitHub  : https://github.com/nk-o/video-worker\n */\n\n/* eslint-disable import/no-mutable-exports */\n\n/* eslint-disable no-restricted-globals */\nlet win;\n\nif (typeof window !== 'undefined') {\n  win = window;\n} else if (typeof global !== 'undefined') {\n  win = global;\n} else if (typeof self !== 'undefined') {\n  win = self;\n} else {\n  win = {};\n}\n\nvar global$1 = win;\n\n// Deferred\n// thanks http://stackoverflow.com/questions/18096715/implement-deferred-object-without-using-jquery\nfunction Deferred() {\n  this.doneCallbacks = [];\n  this.failCallbacks = [];\n}\n\nDeferred.prototype = {\n  execute(list, args) {\n    let i = list.length; // eslint-disable-next-line no-param-reassign\n\n    args = Array.prototype.slice.call(args);\n\n    while (i) {\n      i -= 1;\n      list[i].apply(null, args);\n    }\n  },\n\n  resolve(...args) {\n    this.execute(this.doneCallbacks, args);\n  },\n\n  reject(...args) {\n    this.execute(this.failCallbacks, args);\n  },\n\n  done(callback) {\n    this.doneCallbacks.push(callback);\n  },\n\n  fail(callback) {\n    this.failCallbacks.push(callback);\n  }\n\n};\n\nlet ID = 0;\nlet YoutubeAPIadded = 0;\nlet VimeoAPIadded = 0;\nlet loadingYoutubePlayer = 0;\nlet loadingVimeoPlayer = 0;\nconst loadingYoutubeDefer = /*#__PURE__*/new Deferred();\nconst loadingVimeoDefer = /*#__PURE__*/new Deferred();\n\nclass VideoWorker {\n  constructor(url, options) {\n    const self = this;\n    self.url = url;\n    self.options_default = {\n      autoplay: false,\n      loop: false,\n      mute: false,\n      volume: 100,\n      showControls: true,\n      accessibilityHidden: false,\n      // start / end video time in seconds\n      startTime: 0,\n      endTime: 0\n    };\n    self.options = self.extend({}, self.options_default, options); // Fix wrong option name.\n    // Thanks to https://github.com/nk-o/video-worker/issues/13.\n\n    if (typeof self.options.showContols !== 'undefined') {\n      self.options.showControls = self.options.showContols;\n      delete self.options.showContols;\n    } // check URL\n\n\n    self.videoID = self.parseURL(url); // init\n\n    if (self.videoID) {\n      self.ID = ID;\n      ID += 1;\n      self.loadAPI();\n      self.init();\n    }\n  } // Extend like jQuery.extend\n  // eslint-disable-next-line class-methods-use-this\n\n\n  extend(...args) {\n    const out = args[0] || {};\n    Object.keys(args).forEach(i =&gt; {\n      if (!args[i]) {\n        return;\n      }\n\n      Object.keys(args[i]).forEach(key =&gt; {\n        out[key] = args[i][key];\n      });\n    });\n    return out;\n  }\n\n  parseURL(url) {\n    // parse youtube ID\n    function getYoutubeID(ytUrl) {\n      // eslint-disable-next-line no-useless-escape\n      const regExp = /.*(?:youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=)([^#\\&amp;\\?]*).*/;\n      const match = ytUrl.match(regExp);\n      return match &amp;&amp; match[1].length === 11 ? match[1] : false;\n    } // parse vimeo ID\n\n\n    function getVimeoID(vmUrl) {\n      // eslint-disable-next-line no-useless-escape\n      const regExp = /https?:\\/\\/(?:www\\.|player\\.)?vimeo.com\\/(?:channels\\/(?:\\w+\\/)?|groups\\/([^/]*)\\/videos\\/|album\\/(\\d+)\\/video\\/|video\\/|)(\\d+)(?:$|\\/|\\?)/;\n      const match = vmUrl.match(regExp);\n      return match &amp;&amp; match[3] ? match[3] : false;\n    } // parse local string\n\n\n    function getLocalVideos(locUrl) {\n      // eslint-disable-next-line no-useless-escape\n      const videoFormats = locUrl.split(/,(?=mp4\\:|webm\\:|ogv\\:|ogg\\:)/);\n      const result = {};\n      let ready = 0;\n      videoFormats.forEach(val =&gt; {\n        // eslint-disable-next-line no-useless-escape\n        const match = val.match(/^(mp4|webm|ogv|ogg)\\:(.*)/);\n\n        if (match &amp;&amp; match[1] &amp;&amp; match[2]) {\n          // eslint-disable-next-line prefer-destructuring\n          result[match[1] === 'ogv' ? 'ogg' : match[1]] = match[2];\n          ready = 1;\n        }\n      });\n      return ready ? result : false;\n    }\n\n    const Youtube = getYoutubeID(url);\n    const Vimeo = getVimeoID(url);\n    const Local = getLocalVideos(url);\n\n    if (Youtube) {\n      this.type = 'youtube';\n      return Youtube;\n    }\n\n    if (Vimeo) {\n      this.type = 'vimeo';\n      return Vimeo;\n    }\n\n    if (Local) {\n      this.type = 'local';\n      return Local;\n    }\n\n    return false;\n  }\n\n  isValid() {\n    return !!this.videoID;\n  } // events\n\n\n  on(name, callback) {\n    this.userEventsList = this.userEventsList || []; // add new callback in events list\n\n    (this.userEventsList[name] || (this.userEventsList[name] = [])).push(callback);\n  }\n\n  off(name, callback) {\n    if (!this.userEventsList || !this.userEventsList[name]) {\n      return;\n    }\n\n    if (!callback) {\n      delete this.userEventsList[name];\n    } else {\n      this.userEventsList[name].forEach((val, key) =&gt; {\n        if (val === callback) {\n          this.userEventsList[name][key] = false;\n        }\n      });\n    }\n  }\n\n  fire(name, ...args) {\n    if (this.userEventsList &amp;&amp; typeof this.userEventsList[name] !== 'undefined') {\n      this.userEventsList[name].forEach(val =&gt; {\n        // call with all arguments\n        if (val) {\n          val.apply(this, args);\n        }\n      });\n    }\n  }\n\n  play(start) {\n    const self = this;\n\n    if (!self.player) {\n      return;\n    }\n\n    if (self.type === 'youtube' &amp;&amp; self.player.playVideo) {\n      if (typeof start !== 'undefined') {\n        self.player.seekTo(start || 0);\n      }\n\n      if (global$1.YT.PlayerState.PLAYING !== self.player.getPlayerState()) {\n        self.player.playVideo();\n      }\n    }\n\n    if (self.type === 'vimeo') {\n      if (typeof start !== 'undefined') {\n        self.player.setCurrentTime(start);\n      }\n\n      self.player.getPaused().then(paused =&gt; {\n        if (paused) {\n          self.player.play();\n        }\n      });\n    }\n\n    if (self.type === 'local') {\n      if (typeof start !== 'undefined') {\n        self.player.currentTime = start;\n      }\n\n      if (self.player.paused) {\n        self.player.play();\n      }\n    }\n  }\n\n  pause() {\n    const self = this;\n\n    if (!self.player) {\n      return;\n    }\n\n    if (self.type === 'youtube' &amp;&amp; self.player.pauseVideo) {\n      if (global$1.YT.PlayerState.PLAYING === self.player.getPlayerState()) {\n        self.player.pauseVideo();\n      }\n    }\n\n    if (self.type === 'vimeo') {\n      self.player.getPaused().then(paused =&gt; {\n        if (!paused) {\n          self.player.pause();\n        }\n      });\n    }\n\n    if (self.type === 'local') {\n      if (!self.player.paused) {\n        self.player.pause();\n      }\n    }\n  }\n\n  mute() {\n    const self = this;\n\n    if (!self.player) {\n      return;\n    }\n\n    if (self.type === 'youtube' &amp;&amp; self.player.mute) {\n      self.player.mute();\n    }\n\n    if (self.type === 'vimeo' &amp;&amp; self.player.setVolume) {\n      self.player.setVolume(0);\n    }\n\n    if (self.type === 'local') {\n      self.$video.muted = true;\n    }\n  }\n\n  unmute() {\n    const self = this;\n\n    if (!self.player) {\n      return;\n    }\n\n    if (self.type === 'youtube' &amp;&amp; self.player.mute) {\n      self.player.unMute();\n    }\n\n    if (self.type === 'vimeo' &amp;&amp; self.player.setVolume) {\n      self.player.setVolume(self.options.volume);\n    }\n\n    if (self.type === 'local') {\n      self.$video.muted = false;\n    }\n  }\n\n  setVolume(volume = false) {\n    const self = this;\n\n    if (!self.player || !volume) {\n      return;\n    }\n\n    if (self.type === 'youtube' &amp;&amp; self.player.setVolume) {\n      self.player.setVolume(volume);\n    }\n\n    if (self.type === 'vimeo' &amp;&amp; self.player.setVolume) {\n      self.player.setVolume(volume);\n    }\n\n    if (self.type === 'local') {\n      self.$video.volume = volume / 100;\n    }\n  }\n\n  getVolume(callback) {\n    const self = this;\n\n    if (!self.player) {\n      callback(false);\n      return;\n    }\n\n    if (self.type === 'youtube' &amp;&amp; self.player.getVolume) {\n      callback(self.player.getVolume());\n    }\n\n    if (self.type === 'vimeo' &amp;&amp; self.player.getVolume) {\n      self.player.getVolume().then(volume =&gt; {\n        callback(volume);\n      });\n    }\n\n    if (self.type === 'local') {\n      callback(self.$video.volume * 100);\n    }\n  }\n\n  getMuted(callback) {\n    const self = this;\n\n    if (!self.player) {\n      callback(null);\n      return;\n    }\n\n    if (self.type === 'youtube' &amp;&amp; self.player.isMuted) {\n      callback(self.player.isMuted());\n    }\n\n    if (self.type === 'vimeo' &amp;&amp; self.player.getVolume) {\n      self.player.getVolume().then(volume =&gt; {\n        callback(!!volume);\n      });\n    }\n\n    if (self.type === 'local') {\n      callback(self.$video.muted);\n    }\n  }\n\n  getImageURL(callback) {\n    const self = this;\n\n    if (self.videoImage) {\n      callback(self.videoImage);\n      return;\n    }\n\n    if (self.type === 'youtube') {\n      const availableSizes = ['maxresdefault', 'sddefault', 'hqdefault', '0'];\n      let step = 0;\n      const tempImg = new Image();\n\n      tempImg.onload = function () {\n        // if no thumbnail, youtube add their own image with width = 120px\n        if ((this.naturalWidth || this.width) !== 120 || step === availableSizes.length - 1) {\n          // ok\n          self.videoImage = `https://img.youtube.com/vi/${self.videoID}/${availableSizes[step]}.jpg`;\n          callback(self.videoImage);\n        } else {\n          // try another size\n          step += 1;\n          this.src = `https://img.youtube.com/vi/${self.videoID}/${availableSizes[step]}.jpg`;\n        }\n      };\n\n      tempImg.src = `https://img.youtube.com/vi/${self.videoID}/${availableSizes[step]}.jpg`;\n    }\n\n    if (self.type === 'vimeo') {\n      let request = new XMLHttpRequest(); // https://vimeo.com/api/oembed.json?url=https://vimeo.com/235212527\n\n      request.open('GET', `https://vimeo.com/api/oembed.json?url=${self.url}`, true);\n\n      request.onreadystatechange = function () {\n        if (this.readyState === 4) {\n          if (this.status &gt;= 200 &amp;&amp; this.status &lt; 400) {\n            // Success!\n            const response = JSON.parse(this.responseText);\n\n            if (response.thumbnail_url) {\n              self.videoImage = response.thumbnail_url;\n              callback(self.videoImage);\n            }\n          }\n        }\n      };\n\n      request.send();\n      request = null;\n    }\n  } // fallback to the old version.\n\n\n  getIframe(callback) {\n    this.getVideo(callback);\n  }\n\n  getVideo(callback) {\n    const self = this; // return generated video block\n\n    if (self.$video) {\n      callback(self.$video);\n      return;\n    } // generate new video block\n\n\n    self.onAPIready(() =&gt; {\n      let hiddenDiv;\n\n      if (!self.$video) {\n        hiddenDiv = document.createElement('div');\n        hiddenDiv.style.display = 'none';\n      } // Youtube\n\n\n      if (self.type === 'youtube') {\n        self.playerOptions = {\n          // GDPR Compliance.\n          host: 'https://www.youtube-nocookie.com',\n          videoId: self.videoID,\n          playerVars: {\n            autohide: 1,\n            rel: 0,\n            autoplay: 0,\n            // autoplay enable on mobile devices\n            playsinline: 1\n          }\n        }; // hide controls\n\n        if (!self.options.showControls) {\n          self.playerOptions.playerVars.iv_load_policy = 3;\n          self.playerOptions.playerVars.modestbranding = 1;\n          self.playerOptions.playerVars.controls = 0;\n          self.playerOptions.playerVars.showinfo = 0;\n          self.playerOptions.playerVars.disablekb = 1;\n        } // events\n\n\n        let ytStarted;\n        let ytProgressInterval;\n        self.playerOptions.events = {\n          onReady(e) {\n            // mute\n            if (self.options.mute) {\n              e.target.mute();\n            } else if (self.options.volume) {\n              e.target.setVolume(self.options.volume);\n            } // autoplay\n\n\n            if (self.options.autoplay) {\n              self.play(self.options.startTime);\n            }\n\n            self.fire('ready', e); // For seamless loops, set the endTime to 0.1 seconds less than the video's duration\n            // https://github.com/nk-o/video-worker/issues/2\n\n            if (self.options.loop &amp;&amp; !self.options.endTime) {\n              const secondsOffset = 0.1;\n              self.options.endTime = self.player.getDuration() - secondsOffset;\n            } // volumechange\n\n\n            setInterval(() =&gt; {\n              self.getVolume(volume =&gt; {\n                if (self.options.volume !== volume) {\n                  self.options.volume = volume;\n                  self.fire('volumechange', e);\n                }\n              });\n            }, 150);\n          },\n\n          onStateChange(e) {\n            // loop\n            if (self.options.loop &amp;&amp; e.data === global$1.YT.PlayerState.ENDED) {\n              self.play(self.options.startTime);\n            }\n\n            if (!ytStarted &amp;&amp; e.data === global$1.YT.PlayerState.PLAYING) {\n              ytStarted = 1;\n              self.fire('started', e);\n            }\n\n            if (e.data === global$1.YT.PlayerState.PLAYING) {\n              self.fire('play', e);\n            }\n\n            if (e.data === global$1.YT.PlayerState.PAUSED) {\n              self.fire('pause', e);\n            }\n\n            if (e.data === global$1.YT.PlayerState.ENDED) {\n              self.fire('ended', e);\n            } // progress check\n\n\n            if (e.data === global$1.YT.PlayerState.PLAYING) {\n              ytProgressInterval = setInterval(() =&gt; {\n                self.fire('timeupdate', e); // check for end of video and play again or stop\n\n                if (self.options.endTime &amp;&amp; self.player.getCurrentTime() &gt;= self.options.endTime) {\n                  if (self.options.loop) {\n                    self.play(self.options.startTime);\n                  } else {\n                    self.pause();\n                  }\n                }\n              }, 150);\n            } else {\n              clearInterval(ytProgressInterval);\n            }\n          },\n\n          onError(e) {\n            self.fire('error', e);\n          }\n\n        };\n        const firstInit = !self.$video;\n\n        if (firstInit) {\n          const div = document.createElement('div');\n          div.setAttribute('id', self.playerID);\n          hiddenDiv.appendChild(div);\n          document.body.appendChild(hiddenDiv);\n        }\n\n        self.player = self.player || new global$1.YT.Player(self.playerID, self.playerOptions);\n\n        if (firstInit) {\n          self.$video = document.getElementById(self.playerID); // add accessibility attributes\n\n          if (self.options.accessibilityHidden) {\n            self.$video.setAttribute('tabindex', '-1');\n            self.$video.setAttribute('aria-hidden', 'true');\n          } // get video width and height\n\n\n          self.videoWidth = parseInt(self.$video.getAttribute('width'), 10) || 1280;\n          self.videoHeight = parseInt(self.$video.getAttribute('height'), 10) || 720;\n        }\n      } // Vimeo\n\n\n      if (self.type === 'vimeo') {\n        self.playerOptions = {\n          // GDPR Compliance.\n          dnt: 1,\n          id: self.videoID,\n          autopause: 0,\n          transparent: 0,\n          autoplay: self.options.autoplay ? 1 : 0,\n          loop: self.options.loop ? 1 : 0,\n          muted: self.options.mute ? 1 : 0\n        };\n\n        if (self.options.volume) {\n          self.playerOptions.volume = self.options.volume;\n        } // hide controls\n\n\n        if (!self.options.showControls) {\n          self.playerOptions.badge = 0;\n          self.playerOptions.byline = 0;\n          self.playerOptions.portrait = 0;\n          self.playerOptions.title = 0;\n          self.playerOptions.background = 1;\n        }\n\n        if (!self.$video) {\n          let playerOptionsString = '';\n          Object.keys(self.playerOptions).forEach(key =&gt; {\n            if (playerOptionsString !== '') {\n              playerOptionsString += '&amp;';\n            }\n\n            playerOptionsString += `${key}=${encodeURIComponent(self.playerOptions[key])}`;\n          }); // we need to create iframe manually because when we create it using API\n          // js events won't triggers after iframe moved to another place\n\n          self.$video = document.createElement('iframe');\n          self.$video.setAttribute('id', self.playerID);\n          self.$video.setAttribute('src', `https://player.vimeo.com/video/${self.videoID}?${playerOptionsString}`);\n          self.$video.setAttribute('frameborder', '0');\n          self.$video.setAttribute('mozallowfullscreen', '');\n          self.$video.setAttribute('allowfullscreen', '');\n          self.$video.setAttribute('title', 'Vimeo video player'); // add accessibility attributes\n\n          if (self.options.accessibilityHidden) {\n            self.$video.setAttribute('tabindex', '-1');\n            self.$video.setAttribute('aria-hidden', 'true');\n          }\n\n          hiddenDiv.appendChild(self.$video);\n          document.body.appendChild(hiddenDiv);\n        }\n\n        self.player = self.player || new global$1.Vimeo.Player(self.$video, self.playerOptions); // set current time for autoplay\n\n        if (self.options.startTime &amp;&amp; self.options.autoplay) {\n          self.player.setCurrentTime(self.options.startTime);\n        } // get video width and height\n\n\n        self.player.getVideoWidth().then(width =&gt; {\n          self.videoWidth = width || 1280;\n        });\n        self.player.getVideoHeight().then(height =&gt; {\n          self.videoHeight = height || 720;\n        }); // events\n\n        let vmStarted;\n        self.player.on('timeupdate', e =&gt; {\n          if (!vmStarted) {\n            self.fire('started', e);\n            vmStarted = 1;\n          }\n\n          self.fire('timeupdate', e); // check for end of video and play again or stop\n\n          if (self.options.endTime) {\n            if (self.options.endTime &amp;&amp; e.seconds &gt;= self.options.endTime) {\n              if (self.options.loop) {\n                self.play(self.options.startTime);\n              } else {\n                self.pause();\n              }\n            }\n          }\n        });\n        self.player.on('play', e =&gt; {\n          self.fire('play', e); // check for the start time and start with it\n\n          if (self.options.startTime &amp;&amp; e.seconds === 0) {\n            self.play(self.options.startTime);\n          }\n        });\n        self.player.on('pause', e =&gt; {\n          self.fire('pause', e);\n        });\n        self.player.on('ended', e =&gt; {\n          self.fire('ended', e);\n        });\n        self.player.on('loaded', e =&gt; {\n          self.fire('ready', e);\n        });\n        self.player.on('volumechange', e =&gt; {\n          self.fire('volumechange', e);\n        });\n        self.player.on('error', e =&gt; {\n          self.fire('error', e);\n        });\n      } // Local\n\n\n      function addSourceToLocal(element, src, type) {\n        const source = document.createElement('source');\n        source.src = src;\n        source.type = type;\n        element.appendChild(source);\n      }\n\n      if (self.type === 'local') {\n        if (!self.$video) {\n          self.$video = document.createElement('video'); // show controls\n\n          if (self.options.showControls) {\n            self.$video.controls = true;\n          } // mute\n\n\n          if (self.options.mute) {\n            self.$video.muted = true;\n          } else if (self.$video.volume) {\n            self.$video.volume = self.options.volume / 100;\n          } // loop\n\n\n          if (self.options.loop) {\n            self.$video.loop = true;\n          } // autoplay enable on mobile devices\n\n\n          self.$video.setAttribute('playsinline', '');\n          self.$video.setAttribute('webkit-playsinline', ''); // add accessibility attributes\n\n          if (self.options.accessibilityHidden) {\n            self.$video.setAttribute('tabindex', '-1');\n            self.$video.setAttribute('aria-hidden', 'true');\n          }\n\n          self.$video.setAttribute('id', self.playerID);\n          hiddenDiv.appendChild(self.$video);\n          document.body.appendChild(hiddenDiv);\n          Object.keys(self.videoID).forEach(key =&gt; {\n            addSourceToLocal(self.$video, self.videoID[key], `video/${key}`);\n          });\n        }\n\n        self.player = self.player || self.$video;\n        let locStarted;\n        self.player.addEventListener('playing', e =&gt; {\n          if (!locStarted) {\n            self.fire('started', e);\n          }\n\n          locStarted = 1;\n        });\n        self.player.addEventListener('timeupdate', function (e) {\n          self.fire('timeupdate', e); // check for end of video and play again or stop\n\n          if (self.options.endTime) {\n            if (self.options.endTime &amp;&amp; this.currentTime &gt;= self.options.endTime) {\n              if (self.options.loop) {\n                self.play(self.options.startTime);\n              } else {\n                self.pause();\n              }\n            }\n          }\n        });\n        self.player.addEventListener('play', e =&gt; {\n          self.fire('play', e);\n        });\n        self.player.addEventListener('pause', e =&gt; {\n          self.fire('pause', e);\n        });\n        self.player.addEventListener('ended', e =&gt; {\n          self.fire('ended', e);\n        });\n        self.player.addEventListener('loadedmetadata', function () {\n          // get video width and height\n          self.videoWidth = this.videoWidth || 1280;\n          self.videoHeight = this.videoHeight || 720;\n          self.fire('ready'); // autoplay\n\n          if (self.options.autoplay) {\n            self.play(self.options.startTime);\n          }\n        });\n        self.player.addEventListener('volumechange', e =&gt; {\n          self.getVolume(volume =&gt; {\n            self.options.volume = volume;\n          });\n          self.fire('volumechange', e);\n        });\n        self.player.addEventListener('error', e =&gt; {\n          self.fire('error', e);\n        });\n      }\n\n      callback(self.$video);\n    });\n  }\n\n  init() {\n    const self = this;\n    self.playerID = `VideoWorker-${self.ID}`;\n  }\n\n  loadAPI() {\n    const self = this;\n\n    if (YoutubeAPIadded &amp;&amp; VimeoAPIadded) {\n      return;\n    }\n\n    let src = ''; // load Youtube API\n\n    if (self.type === 'youtube' &amp;&amp; !YoutubeAPIadded) {\n      YoutubeAPIadded = 1;\n      src = 'https://www.youtube.com/iframe_api';\n    } // load Vimeo API\n\n\n    if (self.type === 'vimeo' &amp;&amp; !VimeoAPIadded) {\n      VimeoAPIadded = 1; // Useful when Vimeo API added using RequireJS https://github.com/nk-o/video-worker/pull/7\n\n      if (typeof global$1.Vimeo !== 'undefined') {\n        return;\n      }\n\n      src = 'https://player.vimeo.com/api/player.js';\n    }\n\n    if (!src) {\n      return;\n    } // add script in head section\n\n\n    let tag = document.createElement('script');\n    let head = document.getElementsByTagName('head')[0];\n    tag.src = src;\n    head.appendChild(tag);\n    head = null;\n    tag = null;\n  }\n\n  onAPIready(callback) {\n    const self = this; // Youtube\n\n    if (self.type === 'youtube') {\n      // Listen for global YT player callback\n      if ((typeof global$1.YT === 'undefined' || global$1.YT.loaded === 0) &amp;&amp; !loadingYoutubePlayer) {\n        // Prevents Ready event from being called twice\n        loadingYoutubePlayer = 1; // Creates deferred so, other players know when to wait.\n\n        global$1.onYouTubeIframeAPIReady = function () {\n          global$1.onYouTubeIframeAPIReady = null;\n          loadingYoutubeDefer.resolve('done');\n          callback();\n        };\n      } else if (typeof global$1.YT === 'object' &amp;&amp; global$1.YT.loaded === 1) {\n        callback();\n      } else {\n        loadingYoutubeDefer.done(() =&gt; {\n          callback();\n        });\n      }\n    } // Vimeo\n\n\n    if (self.type === 'vimeo') {\n      if (typeof global$1.Vimeo === 'undefined' &amp;&amp; !loadingVimeoPlayer) {\n        loadingVimeoPlayer = 1;\n        const vimeoInterval = setInterval(() =&gt; {\n          if (typeof global$1.Vimeo !== 'undefined') {\n            clearInterval(vimeoInterval);\n            loadingVimeoDefer.resolve('done');\n            callback();\n          }\n        }, 20);\n      } else if (typeof global$1.Vimeo !== 'undefined') {\n        callback();\n      } else {\n        loadingVimeoDefer.done(() =&gt; {\n          callback();\n        });\n      }\n    } // Local\n\n\n    if (self.type === 'local') {\n      callback();\n    }\n  }\n\n}\n\nexport { VideoWorker as default };\n//# sourceMappingURL=video-worker.esm.js.map\n","/* eslint-disable import/no-mutable-exports */\n/* eslint-disable no-restricted-globals */\nlet win;\n\nif ('undefined' !== typeof window) {\n  win = window;\n} else if ('undefined' !== typeof global) {\n  win = global;\n} else if ('undefined' !== typeof self) {\n  win = self;\n} else {\n  win = {};\n}\n\nexport default win;\n","function ready(callback) {\n  if ('complete' === document.readyState || 'interactive' === document.readyState) {\n    // Already ready or interactive, execute callback\n    callback();\n  } else {\n    document.addEventListener('DOMContentLoaded', callback, {\n      capture: true,\n      once: true,\n      passive: true,\n    });\n  }\n}\n\nexport default ready;\n","import VideoWorker from 'video-worker';\n\nimport global from './utils/global';\n\nfunction jarallaxVideo(jarallax = global.jarallax) {\n  if ('undefined' === typeof jarallax) {\n    return;\n  }\n\n  const Jarallax = jarallax.constructor;\n\n  // append video after when block will be visible.\n  const defOnScroll = Jarallax.prototype.onScroll;\n  Jarallax.prototype.onScroll = function () {\n    const self = this;\n\n    defOnScroll.apply(self);\n\n    const isReady =\n      !self.isVideoInserted &amp;&amp;\n      self.video &amp;&amp;\n      (!self.options.videoLazyLoading || self.isElementInViewport) &amp;&amp;\n      !self.options.disableVideo();\n\n    if (isReady) {\n      self.isVideoInserted = true;\n\n      self.video.getVideo((video) =&gt; {\n        const $parent = video.parentNode;\n        self.css(video, {\n          position: self.image.position,\n          top: '0px',\n          left: '0px',\n          right: '0px',\n          bottom: '0px',\n          width: '100%',\n          height: '100%',\n          maxWidth: 'none',\n          maxHeight: 'none',\n          pointerEvents: 'none',\n          transformStyle: 'preserve-3d',\n          backfaceVisibility: 'hidden',\n          margin: 0,\n          zIndex: -1,\n        });\n        self.$video = video;\n\n        // add Poster attribute to self-hosted video\n        if ('local' === self.video.type) {\n          if (self.image.src) {\n            self.$video.setAttribute('poster', self.image.src);\n          } else if (\n            self.image.$item &amp;&amp;\n            'IMG' === self.image.$item.tagName &amp;&amp;\n            self.image.$item.src\n          ) {\n            self.$video.setAttribute('poster', self.image.$item.src);\n          }\n        }\n\n        // insert video tag\n        self.image.$container.appendChild(video);\n\n        // remove parent video element (created by VideoWorker)\n        $parent.parentNode.removeChild($parent);\n\n        // call onVideoInsert event\n        if (self.options.onVideoInsert) {\n          self.options.onVideoInsert.call(self);\n        }\n      });\n    }\n  };\n\n  // cover video\n  const defCoverImage = Jarallax.prototype.coverImage;\n  Jarallax.prototype.coverImage = function () {\n    const self = this;\n    const imageData = defCoverImage.apply(self);\n    const node = self.image.$item ? self.image.$item.nodeName : false;\n\n    if (imageData &amp;&amp; self.video &amp;&amp; node &amp;&amp; ('IFRAME' === node || 'VIDEO' === node)) {\n      let h = imageData.image.height;\n      let w = (h * self.image.width) / self.image.height;\n      let ml = (imageData.container.width - w) / 2;\n      let mt = imageData.image.marginTop;\n\n      if (imageData.container.width &gt; w) {\n        w = imageData.container.width;\n        h = (w * self.image.height) / self.image.width;\n        ml = 0;\n        mt += (imageData.image.height - h) / 2;\n      }\n\n      // add video height over than need to hide controls\n      if ('IFRAME' === node) {\n        h += 400;\n        mt -= 200;\n      }\n\n      self.css(self.$video, {\n        width: `${w}px`,\n        marginLeft: `${ml}px`,\n        height: `${h}px`,\n        marginTop: `${mt}px`,\n      });\n    }\n\n    return imageData;\n  };\n\n  // init video\n  const defInitImg = Jarallax.prototype.initImg;\n  Jarallax.prototype.initImg = function () {\n    const self = this;\n    const defaultResult = defInitImg.apply(self);\n\n    if (!self.options.videoSrc) {\n      self.options.videoSrc = self.$item.getAttribute('data-jarallax-video') || null;\n    }\n\n    if (self.options.videoSrc) {\n      self.defaultInitImgResult = defaultResult;\n      return true;\n    }\n\n    return defaultResult;\n  };\n\n  const defCanInitParallax = Jarallax.prototype.canInitParallax;\n  Jarallax.prototype.canInitParallax = function () {\n    const self = this;\n    let defaultResult = defCanInitParallax.apply(self);\n\n    if (!self.options.videoSrc) {\n      return defaultResult;\n    }\n\n    // Init video api\n    const video = new VideoWorker(self.options.videoSrc, {\n      autoplay: true,\n      loop: self.options.videoLoop,\n      showControls: false,\n      accessibilityHidden: true,\n      startTime: self.options.videoStartTime || 0,\n      endTime: self.options.videoEndTime || 0,\n      mute: self.options.videoVolume ? 0 : 1,\n      volume: self.options.videoVolume || 0,\n    });\n\n    // call onVideoWorkerInit event\n    if (self.options.onVideoWorkerInit) {\n      self.options.onVideoWorkerInit.call(self, video);\n    }\n\n    function resetDefaultImage() {\n      if (self.image.$default_item) {\n        self.image.$item = self.image.$default_item;\n        self.image.$item.style.display = 'block';\n\n        // set image width and height\n        self.coverImage();\n        self.onScroll();\n      }\n    }\n\n    if (video.isValid()) {\n      // Force enable parallax.\n      // When the parallax disabled on mobile devices, we still need to display videos.\n      // https://github.com/nk-o/jarallax/issues/159\n      if (this.options.disableParallax()) {\n        defaultResult = true;\n        self.image.position = 'absolute';\n        self.options.type = 'scroll';\n        self.options.speed = 1;\n      }\n\n      // if parallax will not be inited, we can add thumbnail on background.\n      if (!defaultResult) {\n        if (!self.defaultInitImgResult) {\n          video.getImageURL((url) =&gt; {\n            // save default user styles\n            const curStyle = self.$item.getAttribute('style');\n            if (curStyle) {\n              self.$item.setAttribute('data-jarallax-original-styles', curStyle);\n            }\n\n            // set new background\n            self.css(self.$item, {\n              'background-image': `url(\"${url}\")`,\n              'background-position': 'center',\n              'background-size': 'cover',\n            });\n          });\n        }\n\n        // init video\n      } else {\n        video.on('ready', () =&gt; {\n          if (self.options.videoPlayOnlyVisible) {\n            const oldOnScroll = self.onScroll;\n            self.onScroll = function () {\n              oldOnScroll.apply(self);\n              if (\n                !self.videoError &amp;&amp;\n                (self.options.videoLoop || (!self.options.videoLoop &amp;&amp; !self.videoEnded))\n              ) {\n                if (self.isVisible()) {\n                  video.play();\n                } else {\n                  video.pause();\n                }\n              }\n            };\n          } else {\n            video.play();\n          }\n        });\n        video.on('started', () =&gt; {\n          self.image.$default_item = self.image.$item;\n          self.image.$item = self.$video;\n\n          // set video width and height\n          self.image.width = self.video.videoWidth || 1280;\n          self.image.height = self.video.videoHeight || 720;\n          self.coverImage();\n          self.onScroll();\n\n          // hide image\n          if (self.image.$default_item) {\n            self.image.$default_item.style.display = 'none';\n          }\n        });\n\n        video.on('ended', () =&gt; {\n          self.videoEnded = true;\n\n          if (!self.options.videoLoop) {\n            // show default image if Loop disabled.\n            resetDefaultImage();\n          }\n        });\n        video.on('error', () =&gt; {\n          self.videoError = true;\n\n          // show default image if video loading error.\n          resetDefaultImage();\n        });\n\n        self.video = video;\n\n        // set image if not exists\n        if (!self.defaultInitImgResult) {\n          // set empty image on self-hosted video if not defined\n          self.image.src =\n            'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';\n\n          if ('local' !== video.type) {\n            video.getImageURL((url) =&gt; {\n              self.image.bgImage = `url(\"${url}\")`;\n              self.init();\n            });\n\n            return false;\n          }\n        }\n      }\n    }\n\n    return defaultResult;\n  };\n\n  // Destroy video parallax\n  const defDestroy = Jarallax.prototype.destroy;\n  Jarallax.prototype.destroy = function () {\n    const self = this;\n\n    if (self.image.$default_item) {\n      self.image.$item = self.image.$default_item;\n      delete self.image.$default_item;\n    }\n\n    defDestroy.apply(self);\n  };\n}\n\nexport default jarallaxVideo;\n","import VideoWorker from 'video-worker';\n\nimport domReady from './utils/ready';\nimport global from './utils/global';\nimport jarallaxVideo from './ext-video';\n\njarallaxVideo();\n\n// data-jarallax-video initialization\ndomReady(() =&gt; {\n  if ('undefined' !== typeof global.jarallax) {\n    global.jarallax(document.querySelectorAll('[data-jarallax-video]'));\n  }\n});\n\n// We should add VideoWorker globally, since some project uses it.\nif (!global.VideoWorker) {\n  global.VideoWorker = VideoWorker;\n}\n\nexport default jarallaxVideo;\n"],"names":["win","window","global","self","callback","global$1","jarallaxVideo","jarallax","Jarallax","constructor","defOnScroll","prototype","onScroll","this","apply","isVideoInserted","video","options","videoLazyLoading","isElementInViewport","disableVideo","getVideo","$parent","parentNode","css","position","image","top","left","right","bottom","width","height","maxWidth","maxHeight","pointerEvents","transformStyle","backfaceVisibility","margin","zIndex","$video","type","src","setAttribute","$item","tagName","$container","appendChild","removeChild","onVideoInsert","call","defCoverImage","coverImage","imageData","node","nodeName","h","w","ml","container","mt","marginTop","marginLeft","defInitImg","initImg","defaultResult","videoSrc","getAttribute","defaultInitImgResult","defCanInitParallax","canInitParallax","VideoWorker","autoplay","loop","videoLoop","showControls","accessibilityHidden","startTime","videoStartTime","endTime","videoEndTime","mute","videoVolume","volume","resetDefaultImage","$default_item","style","display","onVideoWorkerInit","isValid","disableParallax","speed","on","videoPlayOnlyVisible","oldOnScroll","videoError","videoEnded","isVisible","play","pause","videoWidth","videoHeight","getImageURL","url","bgImage","init","curStyle","defDestroy","destroy","document","querySelectorAll","readyState","addEventListener","capture","once","passive"],"mappings":";;;;;;;;;;;KAEA,IAAIA,EAGFA,EADoB,oBAAXC,OACHA,OACqB,oBAAXC,OACVA,OACmB,oBAATC,KACVA,KAE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