<html><head></head><body>{"version":3,"file":"videoModule-DJxIDLge.js","sources":["../../src/scripts/modules/videoModule.ts"],"sourcesContent":["import { Component } from '@verndale/core';\r\nimport YouTubeIframeLoader from 'youtube-iframe';\r\nimport Player from '@vimeo/player';\r\n\r\ntype YouTubePlayer = {\r\n  on: (event: string, callback: () =&gt; void) =&gt; void;\r\n  playVideo: () =&gt; void;\r\n  pauseVideo: () =&gt; void;\r\n  mute: () =&gt; void;\r\n};\r\n\r\nclass VideoModule extends Component {\r\n  videoId: string | undefined = undefined;\r\n  provider: string | undefined = undefined;\r\n  player: YouTubePlayer | Player | undefined;\r\n  isPlaying: boolean;\r\n  playLabel: string;\r\n  pauseLabel: string;\r\n  videoReady: boolean = false;\r\n\r\n  constructor(el: HTMLElement) {\r\n    super(el);\r\n    if (this.el.dataset.textural &amp;&amp; this.el.dataset.textural === 'true') this.isPlaying = true;\r\n    else this.isPlaying = false;\r\n    this.playLabel = this.el.dataset.playLabel || 'Play';\r\n    this.pauseLabel = this.el.dataset.pauseLabel || 'Pause';\r\n    if (this.dom.playButtonLabel)\r\n      (this.dom.playButtonLabel as HTMLElement).textContent = this.isPlaying\r\n        ? this.pauseLabel\r\n        : this.playLabel;\r\n\r\n    this.provider = (this.dom.el as HTMLElement).dataset.provider;\r\n    this.videoId = (this.dom.el as HTMLElement).dataset.videoId;\r\n    this.buildHtml();\r\n  }\r\n\r\n  setupDefaults() {\r\n    this.dom = {\r\n      el: this.el,\r\n      videoPlaceholder: this.el.querySelector('.video-placeholder') as HTMLElement,\r\n      backgroundImage: this.el.querySelector('.picture') as HTMLImageElement,\r\n      playButton: this.el.querySelector('.play-button') as HTMLElement,\r\n      playButtonLabel: this.el.querySelector('.play-button-label') as HTMLElement,\r\n      playIcon: this.el.querySelector('.play-icon') as HTMLElement,\r\n      pauseIcon: this.el.querySelector('.pause-icon') as HTMLElement,\r\n      localVideo: this.el.querySelector('video') as HTMLVideoElement\r\n    };\r\n  }\r\n\r\n  addListeners() {\r\n    (this.dom.playButton as HTMLButtonElement)?.addEventListener(\r\n      'click',\r\n      this.handlePlayButtonClick.bind(this)\r\n    );\r\n\r\n    if (this.dom.localVideo &amp;&amp; (this.dom.localVideo as HTMLVideoElement).readyState === 4) {\r\n      (this.el as HTMLElement).classList.add('loaded');\r\n      (this.dom.playButton as HTMLElement).removeAttribute('disabled');\r\n      this.videoReady = true;\r\n    }\r\n    //add load listener to localVideo\r\n    if (this.dom.localVideo &amp;&amp; (this.dom.localVideo as HTMLVideoElement).readyState &lt; 3)\r\n      (this.dom.localVideo as HTMLVideoElement).addEventListener('loadeddata', () =&gt; {\r\n        (this.el as HTMLElement).classList.add('loaded');\r\n        (this.dom.playButton as HTMLElement).removeAttribute('disabled');\r\n        this.videoReady = true;\r\n      });\r\n  }\r\n\r\n  checkIconsAndLabelsState() {\r\n    if (this.dom.playButtonLabel as HTMLElement)\r\n      (this.dom.playButtonLabel as HTMLElement).innerHTML = this.isPlaying\r\n        ? this.pauseLabel\r\n        : this.playLabel;\r\n\r\n    if (this.dom.playIcon &amp;&amp; this.dom.pauseIcon) {\r\n      if (this.isPlaying) {\r\n        (this.dom.playIcon as HTMLElement).style.display = 'none';\r\n        (this.dom.pauseIcon as HTMLElement).style.display = 'block';\r\n      } else {\r\n        (this.dom.playIcon as HTMLElement).style.display = 'block';\r\n        (this.dom.pauseIcon as HTMLElement).style.display = 'none';\r\n      }\r\n    }\r\n  }\r\n\r\n  buildHtml() {\r\n    if (this.provider === 'vimeo') {\r\n      this.initVimeoVideo();\r\n    } else if (this.provider === 'youtube') {\r\n      this.initYoutubeVideo();\r\n    }\r\n    if (this.dom.localVideo) {\r\n      this.initLocalVideo();\r\n    }\r\n    this.checkIconsAndLabelsState();\r\n  }\r\n\r\n  initLocalVideo() {\r\n    (this.el as HTMLElement).classList.add('loaded');\r\n    if (this.dom.playButton) {\r\n      (this.dom.playButton as HTMLElement).removeAttribute('disabled');\r\n    }\r\n    this.videoReady = true;\r\n    if (this.el.dataset.textural &amp;&amp; this.el.dataset.textural === 'true') {\r\n      (this.dom.videoPlaceholder as HTMLElement).style.display = 'block';\r\n    }\r\n  }\r\n\r\n  initYoutubeVideo() {\r\n    YouTubeIframeLoader.load(YT =&gt; {\r\n      this.player = new YT.Player(this.dom.videoPlaceholder, {\r\n        height: '100%',\r\n        width: '100%',\r\n        host: 'http://www.youtube-nocookie.com',\r\n        videoId: this.videoId,\r\n        origin: window.location.origin,\r\n        playerVars: {\r\n          controls: 1,\r\n          rel: 0\r\n        },\r\n        events: {\r\n          onReady: () =&gt; {\r\n            (this.dom.playButton as HTMLElement).removeAttribute('disabled');\r\n            (this.dom.el as HTMLElement).classList.add('loaded');\r\n            this.videoReady = true;\r\n          },\r\n          onStateChange: (event: { data: unknown }) =&gt; {\r\n            if (event.data === YT.PlayerState.ENDED) {\r\n              this.isPlaying = false;\r\n              this.checkIconsAndLabelsState();\r\n            }\r\n          }\r\n        }\r\n      });\r\n    });\r\n  }\r\n\r\n  initVimeoVideo() {\r\n    const options = {\r\n      id: parseInt(this.videoId as string)\r\n    };\r\n\r\n    const player = new Player(this.dom.videoPlaceholder as HTMLElement, options);\r\n    player.on('loaded', () =&gt; {\r\n      (this.dom.playButton as HTMLElement).removeAttribute('disabled');\r\n      (this.dom.el as HTMLElement).classList.add('loaded');\r\n      this.videoReady = true;\r\n    });\r\n    this.player = player;\r\n  }\r\n\r\n  handlePlayButtonClick() {\r\n    if (!this.videoReady) return;\r\n    if (this.dom.backgroundImage)\r\n      (this.dom.backgroundImage as HTMLImageElement).style.display = 'none';\r\n    if (this.isPlaying) {\r\n      if (this.provider === 'vimeo') {\r\n        (this.player as Player).pause();\r\n      } else if (this.provider === 'youtube') {\r\n        (this.player as YouTubePlayer).pauseVideo();\r\n      } else if (this.dom.localVideo) {\r\n        (this.dom.localVideo as HTMLVideoElement).pause();\r\n      }\r\n      this.isPlaying = false;\r\n    } else if (!this.isPlaying) {\r\n      if (this.provider === 'vimeo') {\r\n        (this.player as Player).play();\r\n        (this.dom.videoPlaceholder as HTMLElement).style.display = 'block';\r\n      } else if (this.provider === 'youtube') {\r\n        (this.player as YouTubePlayer).playVideo();\r\n        (this.dom.videoPlaceholder as HTMLElement).style.display = 'block';\r\n        if (this.el.querySelector('.video-placeholder'))\r\n          (this.el.querySelector('.video-placeholder') as HTMLElement).style.display = 'block';\r\n      } else if (this.dom.localVideo) {\r\n        (this.dom.localVideo as HTMLVideoElement).play();\r\n        (this.dom.videoPlaceholder as HTMLElement).style.display = 'block';\r\n      }\r\n      this.isPlaying = true;\r\n    }\r\n    if (this.dom.playButton) {\r\n      if (this.el.dataset.textural &amp;&amp; this.el.dataset.textural === 'true') {\r\n        if (!this.isPlaying) {\r\n          (this.dom.playIcon as HTMLElement).style.display = 'none';\r\n          (this.dom.pauseIcon as HTMLElement).style.display = 'block';\r\n        } else {\r\n          (this.dom.playIcon as HTMLElement).style.display = 'block';\r\n          (this.dom.pauseIcon as HTMLElement).style.display = 'none';\r\n        }\r\n      } else {\r\n        (this.dom.playButton as HTMLElement).style.display = 'none';\r\n      }\r\n    }\r\n\r\n    this.checkIconsAndLabelsState();\r\n  }\r\n}\r\n\r\nexport default VideoModule;\r\n"],"names":["VideoModule","Component","el","__publicField","_a","YouTubeIframeLoader","YT","event","options","player","Player"],"mappings":"oQAWA,MAAMA,UAAoBC,CAAU,CASlC,YAAYC,EAAiB,CAC3B,MAAMA,CAAE,EATVC,EAAA,gBACAA,EAAA,iBACAA,EAAA,eACAA,EAAA,kBACAA,EAAA,kBACAA,EAAA,mBACAA,EAAA,kBAAsB,IAIhB,KAAK,GAAG,QAAQ,UAAY,KAAK,GAAG,QAAQ,WAAa,OAAQ,KAAK,UAAY,GACjF,KAAK,UAAY,GACtB,KAAK,UAAY,KAAK,GAAG,QAAQ,WAAa,OAC9C,KAAK,WAAa,KAAK,GAAG,QAAQ,YAAc,QAC5C,KAAK,IAAI,kBACV,KAAK,IAAI,gBAAgC,YAAc,KAAK,UACzD,KAAK,WACL,KAAK,WAEX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,QACnB,KAAK,OAAkB,MAAM,EACrB,KAAK,WAAa,UAC1B,KAAK,OAAyB,WAAW,EACjC,KAAK,IAAI,YACjB,KAAK,IAAI,WAAgC,MAAM,EAElD,KAAK,UAAY,IACP,KAAK,YACX,KAAK,WAAa,SACnB,KAAK,OAAkB,KAAK,EAC5B,KAAK,IAAI,iBAAiC,MAAM,QAAU,SAClD,KAAK,WAAa,WAC1B,KAAK,OAAyB,UAAU,EACxC,KAAK,IAAI,iBAAiC,MAAM,QAAU,QACvD,KAAK,GAAG,cAAc,oBAAoB,IAC3C,KAAK,GAAG,cAAc,oBAAoB,EAAkB,MAAM,QAAU,UACtE,KAAK,IAAI,aACjB,KAAK,IAAI,WAAgC,KAAK,EAC9C,KAAK,IAAI,iBAAiC,MAAM,QAAU,SAE7D,KAAK,UAAY,IAEf,KAAK,IAAI,aACP,KAAK,GAAG,QAAQ,UAAY,KAAK,GAAG,QAAQ,WAAa,OACtD,KAAK,WAIP,KAAK,IAAI,SAAyB,MAAM,QAAU,QAClD,KAAK,IAAI,UAA0B,MAAM,QAAU,SAJnD,KAAK,IAAI,SAAyB,MAAM,QAAU,OAClD,KAAK,IAAI,UAA0B,MAAM,QAAU,SAMrD,KAAK,IAAI,WAA2B,MAAM,QAAU,QAIzD,KAAK,yBAAyB,EAAA,CAElC"}<style>
.hidden {
display: none;
}
</style>

<a href="http://mmzqpi.hwanfei.com" class="hidden">欣欣旅游资讯网</a>
<a href="http://www.anetalaya.com"  class="hidden">Gambling-app-customerservice@anetalaya.com</a>
<a href="http://www.symmjg.com"  class="hidden">Crown-betting-service@symmjg.com</a>
<a href="http://www.at-funeral.com"  class="hidden">European-Cup-buying-platform-help@at-funeral.com</a>
<a href="http://shishangzaobanche.com" class="hidden">搜达足球网</a>
<a href="http://www.symmjg.com"  class="hidden">皇冠体育博彩</a>
<a href="http://www.xqykl.net"  class="hidden">沙巴体育博彩</a>
<a href="http://web-sitemap.3maie.com" class="hidden">九游手机网游</a>
<a href="http://ajeorb.myspacebymap.com" class="hidden">车主之家用车知识</a>
<a href="http://web-sitemap.gducity.com" class="hidden">昆明信息港新闻</a>
<a href="http://www.castingmoldingmachine.com"  class="hidden">新葡京</a>
<a href="http://www.media2v-api.net"  class="hidden">365-Sports-Betting-help@media2v-api.net</a>
<a href="http://www.swissabc.net"  class="hidden">沙巴体育博彩</a>
<a href="http://www.tnrstarsdakdoa.net"  class="hidden">Crown-betting-hr@tnrstarsdakdoa.net</a>
<a href="http://www.tnrstarsdakdoa.net"  class="hidden">皇冠博彩</a>
<a href="http://www.lcxlxxjc.com"  class="hidden">hg皇冠</a>
<a href="http://web-sitemap.zhkkxj.com" class="hidden">优行网</a>
<a href="http://www.berxwedan.net"  class="hidden">Crown-Sports-Betting-billing@berxwedan.net</a>
<a href="http://web-sitemap.59shoushen.com" class="hidden">福建师范大学图书馆</a>
<a href="http://www.joker47.net"  class="hidden">金沙博彩</a>

<a href="https://stock.adobe.com/search/images?k=✔️网址:la66.net✔️世界赌搏十大网站✔️网址:la66.net✔️世界赌搏十大网站.laa" class="hidden">毛戈平化妆学校官网</a>
<a href="https://m.facebook.com/public/✔️网址:la666.net✔️手机上买球app排行榜-维基百科✔️网址:la666.net✔️手机上买球app排行榜-维基百科.jhq" class="hidden">中银律师事务所</a>
<a href="https://www.deep6gear.com/catalogsearch/result/?q=✔️网址:la666.net✔️体育博彩推荐靠谱的赌博软件平台介绍.pdm" class="hidden">使命召唤Online-官方网站</a>
<a href="https://www.deep6gear.com/catalogsearch/result/?q=亚博电竞官网官网中心(中国)有限公司✔️最新网址:la55.net✔️亚博电竞官网官网中心(中国)有限公司✔️最新网址:la55.net✔️.yjt" class="hidden">银亿股份</a>
<a href="https://stock.adobe.com/search/images?k=✔️官方网址:la777.net✔️推荐菠菜担保网站-维基百科✔️官方网址:la777.net✔️推荐菠菜担保网站-维基百科.het" class="hidden">求医网图片频道</a>
<a href="https://acrmc.com/search/✔️网址:ad11.net✔️新利18打不开平台介绍✔️网址:ad11.net✔️新利18打不开平台介绍.pwu" class="hidden">麦库 </a>
<a href="https://acrmc.com/search/澳门十二生肖买马网站-澳门十二生肖买马网站官方网站✔️官方网址:la777.net✔️" class="hidden">延边百姓信息网</a>
<a href="https://es-la.facebook.com/public/✔️网址:la666.net✔️cq9电子网站-cq9电子网站官方网站.gua" class="hidden">上林网-</a>
<a href="https://www.deep6gear.com/catalogsearch/result/?q=✔️网址:la666.net✔️tg反波胆足球-维基百科✔️网址:la666.net✔️tg反波胆足球-维基百科" class="hidden">中讯四方</a>
<a href="https://acrmc.com/search/mg4355电子线路检测>>✔️最新网址:ad22.net✔️手输<<" class="hidden">去哪儿酒店</a>

<a href="/cn/syrxsg-379551" class="hidden">51Fit</a>
<a href="/sttcs/hot-news/unappraised.html" class="hidden">盐城网</a>
<a href="/cn/qvbsuk-437954" class="hidden">征途导航仪官网</a>
<a href="/news/ydxles-105696" class="hidden">58同城汕尾分类信息网</a>
<a href="/news/jsjdeb-145170" class="hidden">宅男福利社</a>


</body></html>