@munsonlabs/video-player 0.0.1 → 0.0.2
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.
- package/README.md +32 -1
- package/dist/chunks/brightcove-BjpjJMHX.mjs +1 -0
- package/dist/chunks/brightcove-mjKXQYMp.mjs +1 -0
- package/dist/chunks/constants-DZGeSme4.mjs +1 -0
- package/dist/chunks/dailymotion-B6CwDPyk.mjs +1 -0
- package/dist/chunks/dailymotion-BhvOCSDo.mjs +1 -0
- package/dist/chunks/jwplayer-CNDwSK03.mjs +1 -0
- package/dist/chunks/jwplayer-eDjA1f7V.mjs +1 -0
- package/dist/chunks/tech-DYVa4zaY.mjs +1 -0
- package/dist/chunks/tech-hIKMwrTq.mjs +1 -0
- package/dist/chunks/video.cjs-gZWrkL0e.mjs +239 -0
- package/dist/chunks/videojs.ads-jA_s2l9Y.mjs +3 -0
- package/dist/chunks/videojs.ima-Ccon1y6f.mjs +2 -0
- package/dist/chunks/vimeo-D1LvZaNd.mjs +15 -0
- package/dist/chunks/vimeo-yir3kEbO.mjs +1 -0
- package/dist/chunks/youtube-BE1BWyQG.mjs +1 -0
- package/dist/chunks/youtube-VA8teDMJ.mjs +1 -0
- package/dist/element.d.mts +27 -2
- package/dist/element.mjs +1 -1
- package/dist/index.d.mts +205 -1
- package/dist/index.mjs +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/dist/chunks/VideoItem-C2dc1Nw7.mjs +0 -1
- package/dist/chunks/brightcove-CQ7KZDbD.mjs +0 -1
- package/dist/chunks/dailymotion-BgVShGbi.mjs +0 -1
- package/dist/chunks/index-DCRJ3iTc.d.mts +0 -204
- package/dist/chunks/jwplayer-C3SeHLno.mjs +0 -1
- package/dist/chunks/vimeo-BHc3ewpt.mjs +0 -1
- package/dist/chunks/youtube-CNXFp2IX.mjs +0 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{i as e,n as t,r as n,t as r}from"./video.cjs-gZWrkL0e.mjs";var i=e(((e,i)=>{
|
|
2
|
+
/*! @name videojs-contrib-ads @version 7.5.2 @license Apache-2.0 */
|
|
3
|
+
(function(a,o){typeof e==`object`&&i!==void 0?i.exports=o(r(),n(),t()):typeof define==`function`&&define.amd?define([`video.js`,`global/window`,`global/document`],o):(a||=self,a.videojsContribAds=o(a.videojs,a.window,a.document))})(e,function(e,t,n){e=e&&e.hasOwnProperty(`default`)?e.default:e,t=t&&t.hasOwnProperty(`default`)?t.default:t,n=n&&n.hasOwnProperty(`default`)?n.default:n;var r=`7.5.2`;function i(t){return{disableNextSnapshotRestore:!1,_contentEnding:!1,_contentHasEnded:!1,_hasThereBeenALoadStartDuringPlayerLife:!1,_hasThereBeenALoadedData:!1,_hasThereBeenALoadedMetaData:!1,_inLinearAdMode:!1,_shouldBlockPlay:!1,_playBlocked:!1,_playRequested:!1,_error:null,adType:null,VERSION:r,reset:function(){t.ads.disableNextSnapshotRestore=!1,t.ads._contentEnding=!1,t.ads._contentHasEnded=!1,t.ads.snapshot=null,t.ads.adType=null,t.ads._hasThereBeenALoadedData=!1,t.ads._hasThereBeenALoadedMetaData=!1,t.ads._cancelledPlay=!1,t.ads._shouldBlockPlay=!1,t.ads._playBlocked=!1,t.ads.nopreroll_=!1,t.ads.nopostroll_=!1,t.ads._playRequested=!1,t.ads._error=null},startLinearAdMode:function(){t.ads._state.startLinearAdMode()},endLinearAdMode:function(){t.ads._state.endLinearAdMode()},skipLinearAdMode:function(){t.ads._state.skipLinearAdMode()},stitchedAds:function(t){return t!==void 0&&(e.log.warn(`Using player.ads.stitchedAds() as a setter is deprecated, it should be set as an option upon initialization of contrib-ads.`),this.settings.stitchedAds=!!t),this.settings.stitchedAds},videoElementRecycled:function(){if(t.ads.shouldPlayContentBehindAd(t))return!1;if(!this.snapshot)throw Error(`You cannot use videoElementRecycled while there is no snapshot.`);var e=t.tech_.src()!==this.snapshot.src,n=t.currentSrc()!==this.snapshot.currentSrc;return e||n},isLive:function(n){return n===void 0&&(n=t),typeof n.ads.settings.contentIsLive==`boolean`?n.ads.settings.contentIsLive:n.duration()===1/0?!0:e.browser.IOS_VERSION===`8`&&n.duration()===0},shouldPlayContentBehindAd:function(n){if(n===void 0&&(n=t),!n)throw Error(`shouldPlayContentBehindAd requires a player as a param`);return n.ads.settings.liveCuePoints?!e.browser.IS_IOS&&!e.browser.IS_ANDROID&&n.duration()===1/0:!1},shouldTakeSnapshots:function(e){return e===void 0&&(e=t),!this.shouldPlayContentBehindAd(e)&&!this.stitchedAds()},isInAdMode:function(){return this._state.isAdState()},isWaitingForAdBreak:function(){return this._state.isWaitingForAdBreak()},isContentResuming:function(){return this._state.isContentResuming()},isAdPlaying:function(){return this._state.inAdBreak()},inAdBreak:function(){return this._state.inAdBreak()},removeNativePoster:function(){var e=t.$(`.vjs-tech`);e&&e.removeAttribute(`poster`)},debug:function(){if(this.settings.debug){var t=[...arguments];t.length===1&&typeof t[0]==`string`?e.log(`ADS: `+t[0]):e.log.apply(e,[`ADS:`].concat(t))}},error:function(n){if(n===void 0)return this._error||null;if(n===null||!n.errorType){this._error=null;return}this._error=n,e.log.error(`An error with Ads occured. Type: `+n.errorType+`.`),t.trigger({type:`vjsadserror`,error:this._error})}}}var a=function(e,t){t.isImmediatePropagationStopped=function(){return!0},t.cancelBubble=!0,t.isPropagationStopped=function(){return!0}},o=function(e,t,n){a(e,n),e.trigger({type:t+n.type,originalEvent:n})},s=function(e,t){e.ads.isInAdMode()&&(e.ads.isContentResuming()?e.ads._contentEnding&&o(e,`content`,t):o(e,`ad`,t))},c=function(e,t){e.ads.isInAdMode()?e.ads.isContentResuming()?(a(e,t),e.trigger(`resumeended`)):o(e,`ad`,t):!e.ads._contentHasEnded&&!e.ads.stitchedAds()&&(o(e,`content`,t),e.trigger(`readyforpostroll`))},l=function(e,t){if(!(t.type===`loadstart`&&!e.ads._hasThereBeenALoadStartDuringPlayerLife||t.type===`loadeddata`&&!e.ads._hasThereBeenALoadedData||t.type===`loadedmetadata`&&!e.ads._hasThereBeenALoadedMetaData))if(e.ads.inAdBreak())o(e,`ad`,t);else if(e.currentSrc()!==e.ads.contentSrc)return;else o(e,`content`,t)},u=function(e,t){e.ads.inAdBreak()?o(e,`ad`,t):e.ads.isContentResuming()&&o(e,`content`,t)};function d(e){e.type===`playing`?s(this,e):e.type===`ended`?c(this,e):e.type===`loadstart`||e.type===`loadeddata`||e.type===`loadedmetadata`?l(this,e):e.type===`play`?u(this,e):this.ads.isInAdMode()&&(this.ads.isContentResuming()?o(this,`content`,e):o(this,`ad`,e))}function f(e){e.ads.contentSrc=e.currentSrc(),e.ads._seenInitialLoadstart=!1,e.on(`loadstart`,function(){if(!e.ads.inAdBreak()){var t=e.currentSrc();t!==e.ads.contentSrc&&(e.ads._seenInitialLoadstart&&e.trigger({type:`contentchanged`}),e.trigger({type:`contentupdate`,oldValue:e.ads.contentSrc,newValue:t}),e.ads.contentSrc=t),e.ads._seenInitialLoadstart=!0}})}function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},p.apply(this,arguments)}function m(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,h(e,t)}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}var g={},_=function(n){if(e.dom.isInFrame()&&typeof t.__tcfapi!=`function`){for(var r=t,i,a={};r;){try{if(r.frames.__tcfapiLocator){i=r;break}}catch{}if(r===t.top)break;r=r.parent}if(!i)return;t.__tcfapi=function(e,t,n,r){var o=Math.random()+``,s={__tcfapiCall:{command:e,parameter:r,version:t,callId:o}};a[o]=n,i.postMessage(s,`*`)},t.addEventListener(`message`,function(e){var t={};try{t=typeof e.data==`string`?JSON.parse(e.data):e.data}catch{}var n=t.__tcfapiReturn;n&&typeof a[n.callId]==`function`&&(a[n.callId](n.returnValue,n.success),a[n.callId]=null)},!1)}},v=function(){_(),typeof t.__tcfapi==`function`&&t.__tcfapi(`addEventListener`,2,function(e,t){t&&(g=e)})},y=function(e){for(var t=e.parent;t!==e.top;){try{if(t.frames&&t.frames.__uspapiLocator)return t}catch{}t=t.parent}try{if(e.top.frames&&e.top.frames.__uspapiLocator)return e.top}catch{}return null},b=``,x=function(){return b},S=function(e,n){if(n===void 0&&(n=t),n.__uspapi)n.__uspapi(`getUSPData`,1,function(t,n){var r=n?t.uspString:null;b=r,e(r)});else{var r=y(n);if(!r){e(null);return}var i=Math.random().toString(36).substring(2),a={__uspapiCall:{command:`getUSPData`,version:1,callId:i}};n.addEventListener(`message`,function t(r){if(r&&r.data&&r.data.__uspapiReturn&&r.data.__uspapiReturn.callId===i){n.removeEventListener(`message`,t,!1);var a=r.data.__uspapiReturn,o=a.returnValue,s=a.success?o.uspString:null;b=s,e(s)}},!1),r.postMessage(a,`*`)}},C={AdsBeforePrerollError:`ads-before-preroll-error`,AdsPrerollError:`ads-preroll-error`,AdsMidrollError:`ads-midroll-error`,AdsPostrollError:`ads-postroll-error`,AdsMacroReplacementFailed:`ads-macro-replacement-failed`,AdsResumeContentFailed:`ads-resume-content-failed`},w=function(e,t){return t?encodeURIComponent(e):e},ee=function(e,t,n){if(e&&e[n])for(var r=e[n],i=Object.keys(r),a=0;a<i.length;a++){var o=`{mediainfo.`+n+`.`+i[a]+`}`;t[o]=r[i[a]]}},T=function(e,t){var n={};return[`description`,`tags`,`reference_id`,`ad_keys`].forEach(function(r){e&&e[r]?n[`{mediainfo.`+r+`}`]=e[r]:t[`{mediainfo.`+r+`}`]?n[`{mediainfo.`+r+`}`]=t[`{mediainfo.`+r+`}`]:n[`{mediainfo.`+r+`}`]=``}),[`custom_fields`,`customFields`].forEach(function(t){ee(e,n,t)}),n},E=function(e){var t={};return{defaults:t,modifiedString:e.replace(/{([^}=]+)=([^}]*)}/g,function(e,n,r){return t[`{`+n+`}`]=r,`{`+n+`}`})}},D=function(r){return{"{player.id}":r.options_[`data-player`]||r.id_,"{player.height}":r.currentHeight(),"{player.width}":r.currentWidth(),"{player.heightInt}":Math.round(r.currentHeight()),"{player.widthInt}":Math.round(r.currentWidth()),"{player.autoplay}":+!!r.autoplay(),"{player.muted}":+!!r.muted(),"{player.language}":r.language()||``,"{mediainfo.id}":r.mediainfo?r.mediainfo.id:``,"{mediainfo.name}":r.mediainfo?r.mediainfo.name:``,"{mediainfo.duration}":r.mediainfo?r.mediainfo.duration:``,"{player.duration}":r.duration(),"{player.durationInt}":Math.round(r.duration()),"{player.live}":+(r.duration()===1/0),"{player.pageUrl}":e.dom.isInFrame()?n.referrer:t.location.href,"{playlistinfo.id}":r.playlistinfo?r.playlistinfo.id:``,"{playlistinfo.name}":r.playlistinfo?r.playlistinfo.name:``,"{timestamp}":new Date().getTime(),"{document.referrer}":n.referrer,"{window.location.href}":t.location.href,"{random}":Math.floor(Math.random()*0xe8d4a51000)}},O=function(e){var t={};return Object.keys(e).forEach(function(n){t[`{tcf.`+n+`}`]=e[n]}),t[`{tcf.gdprAppliesInt}`]=+!!e.gdprApplies,t},te=function(){return{"{usp.uspString}":x()}},ne=function(n,r,i){var a=RegExp(`{pageVariable\\.([^}]+)}`,`g`),o={},s=(n.match(a)||[]).concat(Object.keys(i).filter(function(e){return a.test(e)&&n.includes(i[e])}));if(s)return s.forEach(function(n){for(var i=n,a=n.slice(14,-1),s=a.split(`.`),c=t,l,u=0;u<s.length;u++)if(u===s.length-1)l=c[s[u]];else if(c=c[s[u]],c===void 0)break;var d=typeof l;l===null?o[i]=`null`:l===void 0?r[i]?o[i]=r[i]:(e.log.warn(`Page variable "`+a+`" not found`),o[i]=``):d!==`string`&&d!==`number`&&d!==`boolean`?(e.log.warn(`Page variable "`+a+`" is not a supported type`),o[i]=``):o[i]=l}),o},k=function(t,n,r,i,a){for(var o in i===void 0&&(i={}),n){var s=i.hasOwnProperty(o)?i[o]:o;if(s.startsWith(`r:`))try{var c=new RegExp(s.slice(2),`g`);t=t.replace(c,w(n[o],r))}catch(t){a.ads.error({errorType:C.AdsMacroReplacementFailed,macro:o,error:t}),e.log.warn(`Unable to replace macro with regex "`+s+`". The provided regex may be invalid.`)}else t=t.split(s).join(w(n[o],r))}return t};function A(e,t,n){t===void 0&&(t=!1),n===void 0&&(n={});var r=n.disableDefaultMacros||!1,i=n.macroNameOverrides||{};delete n.disableDefaultMacros,delete n.macroNameOverrides;var a=n;if(r)return k(e,a,t,i);var o=E(e),s=o.defaults;for(var c in e=o.modifiedString,p(a,D(this),T(this.mediainfo,s),O(g),te(),ne(e,s,i)),e=k(e,a,t,i,this),s)e=e.replace(c,s[c]);return e}var j={};j.processMetadataTracks=function(e,t){for(var n=e.textTracks(),r=function(n){n.kind===`metadata`&&(e.ads.cueTextTracks.setMetadataTrackMode(n),t(e,n))},i=0;i<n.length;i++)r(n[i]);n.addEventListener(`addtrack`,function(e){r(e.track)})},j.setMetadataTrackMode=function(e){},j.getSupportedAdCue=function(e,t){return t},j.isSupportedAdCue=function(e,t){return!0},j.getCueId=function(e,t){return t.id};var M=function(e,t){return t!==void 0&&e.ads.includedCues[t]},N=function(e,t){t!==void 0&&t!==``&&(e.ads.includedCues[t]=!0)};j.processAdTrack=function(t,n,r,i){t.ads.includedCues={};for(var a=0;a<n.length;a++){var o=n[a],s=this.getSupportedAdCue(t,o);if(!this.isSupportedAdCue(t,o)){e.log.warn(`Skipping as this is not a supported ad cue.`,o);return}var c=this.getCueId(t,o),l=o.startTime;if(M(t,c)){e.log(`Skipping ad already seen with ID `+c);return}i&&i(t,s,c,l),r(t,s,c,l),N(t,c)}};function P(t,n){n&&e.log(`Using cancelContentPlay to block content playback`),t.on(`play`,F)}function F(){this.ads._shouldBlockPlay!==!1&&(this.paused()||(this.ads.debug(`Playback was canceled by cancelContentPlay`),this.pause()),this.ads._cancelledPlay=!0)}var I={},L=e;I.isMiddlewareMediatorSupported=function(){return L.browser.IS_IOS||L.browser.IS_ANDROID?!1:!!(L.use&&L.middleware&&L.middleware.TERMINATOR)},I.playMiddleware=function(t){return{setSource:function(e,t){t(null,e)},callPlay:function(){if(t.ads&&t.ads._shouldBlockPlay===!0)return t.ads.debug(`Using playMiddleware to block content playback`),t.ads._playBlocked=!0,L.middleware.TERMINATOR},play:function(n,r){t.ads&&t.ads._playBlocked&&n?(t.ads.debug(`Play call to Tech was terminated.`),t.trigger(`play`),t.addClass(`vjs-has-started`),t.ads._playBlocked=!1):r&&r.catch&&r.catch(function(n){n.name===`NotAllowedError`&&!e.browser.IS_SAFARI&&t.trigger(`pause`)})}}},I.testHook=function(e){L=e};var R=I.playMiddleware,z=I.isMiddlewareMediatorSupported,B=function(){if(e.getPlugin)return!!e.getPlugin(`ads`);var t=e.getComponent(`Player`);return!!(t&&t.prototype.ads)};function V(t){return B(e)?!1:((e.registerPlugin||e.plugin)(`ads`,t),z()&&!e.usingContribAdsMiddleware_&&(e.use(`*`,R),e.usingContribAdsMiddleware_=!0,e.log.debug(`Play middleware has been registered with videojs`)),!0)}var H={src:`data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAAAxJtZGF03ABMYXZjNjEuMy4xMDAAQiAIwRg4AAACrgYF//+q3EXpvebZSLeWLNgg2SPu73gyNjQgLSBjb3JlIDE2NCByMzEwOCAzMWUxOWY5IC0gSC4yNjQvTVBFRy00IEFWQyBjb2RlYyAtIENvcHlsZWZ0IDIwMDMtMjAyMyAtIGh0dHA6Ly93d3cudmlkZW9sYW4ub3JnL3gyNjQuaHRtbCAtIG9wdGlvbnM6IGNhYmFjPTEgcmVmPTMgZGVibG9jaz0xOjA6MCBhbmFseXNlPTB4MzoweDExMyBtZT1oZXggc3VibWU9NyBwc3k9MSBwc3lfcmQ9MS4wMDowLjAwIG1peGVkX3JlZj0xIG1lX3JhbmdlPTE2IGNocm9tYV9tZT0xIHRyZWxsaXM9MSA4eDhkY3Q9MSBjcW09MCBkZWFkem9uZT0yMSwxMSBmYXN0X3Bza2lwPTEgY2hyb21hX3FwX29mZnNldD0tMiB0aHJlYWRzPTcgbG9va2FoZWFkX3RocmVhZHM9MSBzbGljZWRfdGhyZWFkcz0wIG5yPTAgZGVjaW1hdGU9MSBpbnRlcmxhY2VkPTAgYmx1cmF5X2NvbXBhdD0wIGNvbnN0cmFpbmVkX2ludHJhPTAgYmZyYW1lcz0zIGJfcHlyYW1pZD0yIGJfYWRhcHQ9MSBiX2JpYXM9MCBkaXJlY3Q9MSB3ZWlnaHRiPTEgb3Blbl9nb3A9MCB3ZWlnaHRwPTIga2V5aW50PTI1MCBrZXlpbnRfbWluPTI1IHNjZW5lY3V0PTQwIGludHJhX3JlZnJlc2g9MCByY19sb29rYWhlYWQ9NDAgcmM9Y3JmIG1idHJlZT0xIGNyZj0yMy4wIHFjb21wPTAuNjAgcXBtaW49MCBxcG1heD02OSBxcHN0ZXA9NCBpcF9yYXRpbz0xLjQwIGFxPTE6MS4wMACAAAAAOWWIhAAn//71sXwKaunqigzoMi7hlyTJrrYi4m0AwABFxzcqWKGahTaoBcQAAMWK4AlcFlIICBeldSEQBGCMHAAABVNtb292AAAAbG12aGQAAAAAAAAAAAAAAAAAAAPoAAAAIgABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAACQXRyYWsAAABcdGtoZAAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAIgAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAABQAAAAPAAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAACIAAAAAAAEAAAAAAbltZGlhAAAAIG1kaGQAAAAAAAAAAAAAAAAAADwAAAACAFXEAAAAAAAtaGRscgAAAAAAAAAAdmlkZQAAAAAAAAAAAAAAAFZpZGVvSGFuZGxlcgAAAAFkbWluZgAAABR2bWhkAAAAAQAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAABJHN0YmwAAADAc3RzZAAAAAAAAAABAAAAsGF2YzEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAABQADwAEgAAABIAAAAAAAAAAEUTGF2YzYxLjMuMTAwIGxpYngyNjQAAAAAAAAAAAAAAAAY//8AAAA2YXZjQwFkAA3/4QAZZ2QADazZQUH7ARAAAAMAEAAAAwPA8UKZYAEABmjr48siwP34+AAAAAAQcGFzcAAAAAEAAAABAAAAFGJ0cnQAAAAAAALAEAACwBAAAAAYc3R0cwAAAAAAAAABAAAAAQAAAgAAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAEAAAABAAAAFHN0c3oAAAAAAAAC7wAAAAEAAAAUc3RjbwAAAAAAAAABAAAARQAAAj10cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAACAAAAAAAAABgAAAAAAAAAAAAAAAEBAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAAXAAAEAAABAAAAAAG1bWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAACsRAAACABVxAAAAAAALWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABTb3VuZEhhbmRsZXIAAAABYG1pbmYAAAAQc21oZAAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAABJHN0YmwAAAB+c3RzZAAAAAAAAAABAAAAbm1wNGEAAAAAAAAAAQAAAAAAAAAAAAIAEAAAAACsRAAAAAAANmVzZHMAAAAAA4CAgCUAAgAEgICAF0AVAAAAAAH0AAAAEisFgICABRIQVuUABoCAgAECAAAAFGJ0cnQAAAAAAAH0AAAAEisAAAAYc3R0cwAAAAAAAAABAAAAAgAABAAAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAEAAAABAAAAHHN0c3oAAAAAAAAAAAAAAAIAAAAVAAAABgAAABhzdGNvAAAAAAAAAAIAAAAwAAADNAAAABpzZ3BkAQAAAHJvbGwAAAACAAAAAf//AAAAHHNiZ3AAAAAAcm9sbAAAAAEAAAACAAAAAQAAAGF1ZHRhAAAAWW1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALGlsc3QAAAAkqXRvbwAAABxkYXRhAAAAAQAAAABMYXZmNjEuMS4xMDA=`,type:`video/mp4`},U=function(){function e(){}return e.getState=function(t){if(t&&e.states_&&e.states_[t])return e.states_[t]},e.registerState=function(t,n){if(typeof t!=`string`||!t)throw Error(`Illegal state name, "`+t+`"; must be a non-empty string.`);return e.states_||={},e.states_[t]=n,n},e}(),W=function(){t._getName=function(){return`Anonymous State`};function t(e){this.player=e}var n=t.prototype;return n.transitionTo=function(e){var t=this.player;this.cleanup(t);var n=new e(t);t.ads._state=n,t.ads.debug(this.constructor._getName()+` -> `+n.constructor._getName());var r=[...arguments].slice(1);n.init.apply(n,[t].concat(r))},n.init=function(){},n.cleanup=function(){},n.onPlay=function(){},n.onPlaying=function(){},n.onEnded=function(){},n.onAdEnded=function(){},n.onAdsReady=function(){e.log.warn(`Unexpected adsready event`)},n.onAdsError=function(){},n.onAdsCanceled=function(){},n.onAdTimeout=function(){},n.onAdStarted=function(){},n.onAdSkipped=function(){},n.onContentChanged=function(){},n.onContentResumed=function(){},n.onReadyForPostroll=function(){e.log.warn(`Unexpected readyforpostroll event`)},n.onNoPreroll=function(){},n.onNoPostroll=function(){},n.startLinearAdMode=function(){e.log.warn(`Unexpected startLinearAdMode invocation (State via `+this.constructor._getName()+`)`)},n.endLinearAdMode=function(){e.log.warn(`Unexpected endLinearAdMode invocation (State via `+this.constructor._getName()+`)`)},n.skipLinearAdMode=function(){e.log.warn(`Unexpected skipLinearAdMode invocation (State via `+this.constructor._getName()+`)`)},n.isAdState=function(){throw Error(`isAdState unimplemented for `+this.constructor._getName())},n.isWaitingForAdBreak=function(){return!1},n.isContentResuming=function(){return!1},n.inAdBreak=function(){return!1},n.handleEvent=function(e){var t=this.player;e===`play`?this.onPlay(t):e===`adsready`?this.onAdsReady(t):e===`adserror`?this.onAdsError(t):e===`adscanceled`?this.onAdsCanceled(t):e===`adtimeout`?this.onAdTimeout(t):e===`ads-ad-started`?this.onAdStarted(t):e===`ads-ad-skipped`?this.onAdSkipped(t):e===`contentchanged`?this.onContentChanged(t):e===`contentresumed`?this.onContentResumed(t):e===`readyforpostroll`?this.onReadyForPostroll(t):e===`playing`?this.onPlaying(t):e===`ended`?this.onEnded(t):e===`nopreroll`?this.onNoPreroll(t):e===`nopostroll`?this.onNoPostroll(t):e===`adended`&&this.onAdEnded(t)},t}();U.registerState(`State`,W);var G=function(e){m(t,e);function t(t){var n=e.call(this,t)||this;return n.contentResuming=!1,n.waitingForAdBreak=!1,n}var n=t.prototype;return n.isAdState=function(){return!0},n.onPlaying=function(){var e=U.getState(`ContentPlayback`);this.contentResuming&&this.transitionTo(e)},n.onContentResumed=function(){var e=U.getState(`ContentPlayback`);this.contentResuming&&this.transitionTo(e)},n.isWaitingForAdBreak=function(){return this.waitingForAdBreak},n.isContentResuming=function(){return this.contentResuming},n.inAdBreak=function(){return this.player.ads._inLinearAdMode===!0},t}(W);U.registerState(`AdState`,G);var K=function(e){m(t,e);function t(){return e.apply(this,arguments)||this}var n=t.prototype;return n.isAdState=function(){return!1},n.onContentChanged=function(e){var t=U.getState(`BeforePreroll`),n=U.getState(`Preroll`);e.ads.debug(`Received contentchanged event (ContentState)`),e.paused()?this.transitionTo(t):(this.transitionTo(n,!1),e.pause(),e.ads._pausedOnContentupdate=!0)},t}(W);U.registerState(`ContentState`,K);var q=function(t){m(n,t);function n(){return t.apply(this,arguments)||this}n._getName=function(){return`AdsDone`};var r=n.prototype;return r.init=function(e){e.ads._contentHasEnded=!0,e.trigger(`ended`)},r.startLinearAdMode=function(){e.log.warn(`Unexpected startLinearAdMode invocation (AdsDone)`)},n}(U.getState(`ContentState`));U.registerState(`AdsDone`,q);var J;function Y(t){var n=e.browser.IS_IOS&&t.ads.isLive(t)&&t.seekable().length>0?t.currentTime()-t.seekable().end(0):t.currentTime(),r=t.$(`.vjs-tech`),i=t.textTracks?t.textTracks():[],a=[],o={ended:t.ended(),currentSrc:t.currentSrc(),sources:t.currentSources(),src:t.tech_.src(),currentTime:n,type:t.currentType()};r&&(o.style=r.getAttribute(`style`));for(var s=0;s<i.length;s++){var c=i[s];a.push({track:c,mode:c.mode}),c.mode=`disabled`}return o.suppressedTracks=a,o}function X(t,n){var r=t.ads.snapshot;if(n===void 0&&(n=function(){}),t.ads.disableNextSnapshotRestore===!0){t.ads.disableNextSnapshotRestore=!1,delete t.ads.snapshot,n();return}var i=t.$(`.vjs-tech`),a=20,o=r.suppressedTracks,s,c=function(){for(var e=0;e<o.length;e++)s=o[e],s.track.mode=s.mode},l=function(){var n;if(e.browser.IS_IOS&&t.ads.isLive(t)){if(r.currentTime<0&&(n=t.seekable().length>0?t.seekable().end(0)+r.currentTime:t.currentTime(),t.currentTime(n)),t.paused()){var i=t.play();i&&i.catch&&i.catch(function(t){e.log.warn(`Play promise rejected in IOS snapshot resume`,t)})}}else if(r.ended)t.currentTime(t.duration());else{t.currentTime(r.currentTime);var a=t.play();a&&a.catch&&a.catch(function(t){e.log.warn(`Play promise rejected in snapshot resume`,t)})}t.ads.shouldRemoveAutoplay_&&(t.autoplay(!1),t.ads.shouldRemoveAutoplay_=!1)},u=function n(){if(t.off(`contentcanplay`,n),J&&t.clearTimeout(J),i=t.el().querySelector(`.vjs-tech`),i.readyState>1||i.seekable===void 0||i.seekable.length>0)return l();if(a--)t.setTimeout(n,50);else try{l()}catch(n){t.ads.error({errorType:C.AdsResumeContentFailed,error:n}),e.log.warn(`Failed to resume the content after an advertisement`,n)}};if(`style`in r&&i.setAttribute(`style`,r.style||``),t.ads.videoElementRecycled())t.one(`resumeended`,function(){delete t.ads.snapshot,n()}),t.one(`contentloadedmetadata`,c),e.browser.IS_IOS&&!t.autoplay()&&typeof t.techCall_==`function`&&(t.techCall_(`setAutoplay`,!0),t.ads.shouldRemoveAutoplay_=!0),t.src(r.sources),t.one(`contentcanplay`,u),J=t.setTimeout(u,2e3);else{if(c(),!t.ended()){var d=t.play();d&&d.catch&&d.catch(function(t){e.log.warn(`Play promise rejected in snapshot restore`,t)})}delete t.ads.snapshot,n()}}function Z(e){e.ads.debug(`Starting ad break`),e.ads._inLinearAdMode=!0,e.trigger(`adstart`),e.ads.shouldTakeSnapshots()&&(e.ads.snapshot=Y(e)),e.ads.shouldPlayContentBehindAd(e)&&!e.ads.settings.stitchedAds&&(e.ads.preAdVolume_=e.volume(),e.volume(0)),e.addClass(`vjs-ad-playing`),e.hasClass(`vjs-live`)&&e.removeClass(`vjs-live`),e.ads.removeNativePoster(),e.ads.preAdPlaybackRate_=e.playbackRate(),e.playbackRate(1),e.controlBar&&e.controlBar.playbackRateMenuButton&&e.controlBar.playbackRateMenuButton.playbackRateSupported&&!e.controlBar.playbackRateMenuButton.hasClass(`vjs-hidden`)?(e.controlBar.playbackRateMenuButton.hide(),e.ads.showPlaybackMenuOnAdEnd_=!0):e.ads.showPlaybackMenuOnAdEnd_=!1}function re(e,t){e.ads.debug(`Ending ad break`),t===void 0&&(t=function(){}),e.ads.adType=null,e.ads._inLinearAdMode=!1,e.trigger(`adend`),e.removeClass(`vjs-ad-playing`),e.ads.isLive(e)&&e.addClass(`vjs-live`),e.ads.shouldTakeSnapshots()?X(e,t):(e.ads.preAdVolume_&&e.volume(e.ads.preAdVolume_),t()),e.playbackRate(e.ads.preAdPlaybackRate_),e.ads.showPlaybackMenuOnAdEnd_&&e.controlBar.playbackRateMenuButton.show()}var Q={start:Z,end:re},ie=function(t){m(n,t);function n(){return t.apply(this,arguments)||this}n._getName=function(){return`Preroll`};var r=n.prototype;return r.init=function(e,t,n){if(this.waitingForAdBreak=!0,e.addClass(`vjs-ad-loading`),n||e.ads.nopreroll_)return this.resumeAfterNoPreroll(e);var r=e.ads.settings.timeout;typeof e.ads.settings.prerollTimeout==`number`&&(r=e.ads.settings.prerollTimeout),this._timeout=e.setTimeout(function(){e.trigger(`adtimeout`)},r),t?this.handleAdsReady():this.adsReady=!1},r.onAdsReady=function(t){t.ads.inAdBreak()?e.log.warn(`Unexpected adsready event (Preroll)`):(t.ads.debug(`Received adsready event (Preroll)`),this.handleAdsReady())},r.handleAdsReady=function(){this.adsReady=!0,this.readyForPreroll()},r.afterLoadStart=function(e){var t=this.player;t.ads._hasThereBeenALoadStartDuringPlayerLife?e():(t.ads.debug(`Waiting for loadstart...`),t.one(`loadstart`,function(){t.ads.debug(`Received loadstart event`),e()}))},r.noPreroll=function(){var e=this;this.afterLoadStart(function(){e.player.ads.debug(`Skipping prerolls due to nopreroll event (Preroll)`),e.resumeAfterNoPreroll(e.player)})},r.readyForPreroll=function(){var e=this.player;this.afterLoadStart(function(){e.ads.debug(`Triggered readyforpreroll event (Preroll)`),e.trigger(`readyforpreroll`)})},r.onAdsCanceled=function(e){var t=this;e.ads.debug(`adscanceled (Preroll)`),this.afterLoadStart(function(){t.resumeAfterNoPreroll(e)})},r.onAdsError=function(t){var n=this;e.log(`adserror (Preroll)`),t.ads.error({errorType:C.AdsPrerollError}),this.inAdBreak()?t.ads.endLinearAdMode():this.afterLoadStart(function(){n.resumeAfterNoPreroll(t)})},r.startLinearAdMode=function(){var t=this.player;this.adsReady&&!t.ads.inAdBreak()&&!this.isContentResuming()?(this.clearTimeout(t),t.ads.adType=`preroll`,this.waitingForAdBreak=!1,Q.start(t),t.ads._shouldBlockPlay=!1):e.log.warn(`Unexpected startLinearAdMode invocation (Preroll)`)},r.onAdStarted=function(e){e.removeClass(`vjs-ad-loading`)},r.endLinearAdMode=function(){var e=this.player;this.inAdBreak()&&(e.removeClass(`vjs-ad-loading`),e.addClass(`vjs-ad-content-resuming`),this.contentResuming=!0,Q.end(e))},r.skipLinearAdMode=function(){var t=this,n=this.player;n.ads.inAdBreak()||this.isContentResuming()?e.log.warn(`Unexpected skipLinearAdMode invocation`):this.afterLoadStart(function(){n.trigger(`adskip`),n.ads.debug(`skipLinearAdMode (Preroll)`),t.resumeAfterNoPreroll(n)})},r.onAdTimeout=function(e){var t=this;this.afterLoadStart(function(){e.ads.debug(`adtimeout (Preroll)`),t.resumeAfterNoPreroll(e)})},r.onNoPreroll=function(t){t.ads.inAdBreak()||this.isContentResuming()?e.log.warn(`Unexpected nopreroll event (Preroll)`):this.noPreroll()},r.resumeAfterNoPreroll=function(e){if(this.contentResuming=!0,e.ads._shouldBlockPlay=!1,this.cleanupPartial(e),e.ads._playRequested||e.ads._pausedOnContentupdate)if(e.paused()){e.ads.debug(`resumeAfterNoPreroll: attempting to resume playback (Preroll)`);var t=e.play();t&&t.then&&t.then(null,function(e){})}else e.ads.debug(`resumeAfterNoPreroll: already playing (Preroll)`),e.trigger(`play`),e.trigger(`playing`)},r.cleanup=function(t){t.ads._hasThereBeenALoadStartDuringPlayerLife||e.log.warn(`Leaving Preroll state before loadstart event can cause issues.`),this.cleanupPartial(t)},r.cleanupPartial=function(e){e.removeClass(`vjs-ad-loading`),e.removeClass(`vjs-ad-content-resuming`),this.clearTimeout(e)},r.clearTimeout=function(e){e.clearTimeout(this._timeout),this._timeout=null},n}(U.getState(`AdState`));U.registerState(`Preroll`,ie);var ae=function(e){m(t,e);function t(){return e.apply(this,arguments)||this}t._getName=function(){return`BeforePreroll`};var n=t.prototype;return n.init=function(e){this.adsReady=!1,this.shouldResumeToContent=!1,e.ads._shouldBlockPlay=e.ads.settings.allowVjsAutoplay?!e.autoplay():!0},n.onAdsReady=function(e){e.ads.debug(`Received adsready event (BeforePreroll)`),this.adsReady=!0},n.onPlay=function(e){var t=U.getState(`Preroll`);e.ads.debug(`Received play event (BeforePreroll)`),this.transitionTo(t,this.adsReady,this.shouldResumeToContent)},n.onAdsCanceled=function(e){e.ads.debug(`adscanceled (BeforePreroll)`),this.shouldResumeToContent=!0},n.onAdsError=function(){this.player.ads.debug(`adserror (BeforePreroll)`),this.player.ads.error({errorType:C.AdsBeforePrerollError}),this.shouldResumeToContent=!0},n.onNoPreroll=function(){this.player.ads.debug(`Skipping prerolls due to nopreroll event (BeforePreroll)`),this.shouldResumeToContent=!0},n.skipLinearAdMode=function(){var e=this.player;e.trigger(`adskip`),e.ads.debug(`skipLinearAdMode (BeforePreroll)`),this.shouldResumeToContent=!0},n.onContentChanged=function(){this.init(this.player)},t}(U.getState(`ContentState`));U.registerState(`BeforePreroll`,ae);var oe=function(e){m(t,e);function t(){return e.apply(this,arguments)||this}t._getName=function(){return`Midroll`};var n=t.prototype;return n.init=function(e){e.ads.adType=`midroll`,Q.start(e),e.addClass(`vjs-ad-loading`)},n.onAdStarted=function(e){e.removeClass(`vjs-ad-loading`)},n.endLinearAdMode=function(){var e=this.player;this.inAdBreak()&&(this.contentResuming=!0,e.addClass(`vjs-ad-content-resuming`),e.removeClass(`vjs-ad-loading`),Q.end(e))},n.onAdsError=function(e){e.ads.error({errorType:C.AdsMidrollError}),this.inAdBreak()&&e.ads.endLinearAdMode()},n.cleanup=function(e){e.removeClass(`vjs-ad-loading`),e.removeClass(`vjs-ad-content-resuming`)},t}(U.getState(`AdState`));U.registerState(`Midroll`,oe);var se=function(t){m(n,t);function n(){return t.apply(this,arguments)||this}n._getName=function(){return`Postroll`};var r=n.prototype;return r.init=function(e){if(this.waitingForAdBreak=!0,e.ads._contentEnding=!0,e.ads.nopostroll_){this.resumeContent(e);var t=U.getState(`AdsDone`);this.transitionTo(t)}else{e.addClass(`vjs-ad-loading`);var n=e.ads.settings.timeout;typeof e.ads.settings.postrollTimeout==`number`&&(n=e.ads.settings.postrollTimeout),this._postrollTimeout=e.setTimeout(function(){e.trigger(`adtimeout`)},n)}},r.startLinearAdMode=function(){var t=this.player;!t.ads.inAdBreak()&&!this.isContentResuming()?(t.ads.adType=`postroll`,t.clearTimeout(this._postrollTimeout),this.waitingForAdBreak=!1,Q.start(t)):e.log.warn(`Unexpected startLinearAdMode invocation (Postroll)`)},r.onAdStarted=function(e){e.removeClass(`vjs-ad-loading`)},r.endLinearAdMode=function(){var e=this,t=this.player,n=U.getState(`AdsDone`);this.inAdBreak()&&(t.removeClass(`vjs-ad-loading`),this.resumeContent(t),Q.end(t,function(){e.transitionTo(n)}))},r.skipLinearAdMode=function(){var t=this.player;t.ads.inAdBreak()||this.isContentResuming()?e.log.warn(`Unexpected skipLinearAdMode invocation`):(t.ads.debug(`Postroll abort (skipLinearAdMode)`),t.trigger(`adskip`),this.abort(t))},r.onAdTimeout=function(e){e.ads.debug(`Postroll abort (adtimeout)`),this.abort(e)},r.onAdsError=function(e){e.ads.debug(`Postroll abort (adserror)`),e.ads.error({errorType:C.AdsPostrollError}),e.ads.inAdBreak()?e.ads.endLinearAdMode():this.abort(e)},r.onContentChanged=function(e){if(this.isContentResuming()){var t=U.getState(`BeforePreroll`);this.transitionTo(t)}else if(!this.inAdBreak()){var n=U.getState(`Preroll`);this.transitionTo(n)}},r.onNoPostroll=function(t){!this.isContentResuming()&&!this.inAdBreak()?this.abort(t):e.log.warn(`Unexpected nopostroll event (Postroll)`)},r.resumeContent=function(e){this.contentResuming=!0,e.addClass(`vjs-ad-content-resuming`)},r.abort=function(e){var t=U.getState(`AdsDone`);this.resumeContent(e),e.removeClass(`vjs-ad-loading`),this.transitionTo(t)},r.cleanup=function(e){e.removeClass(`vjs-ad-content-resuming`),e.clearTimeout(this._postrollTimeout),e.ads._contentEnding=!1},n}(U.getState(`AdState`));U.registerState(`Postroll`,se);var ce=function(e){m(t,e);function t(){return e.apply(this,arguments)||this}t._getName=function(){return`ContentPlayback`};var n=t.prototype;return n.init=function(e){e.ads._shouldBlockPlay=!1},n.onAdsReady=function(e){e.ads.debug(`Received adsready event (ContentPlayback)`),e.ads.nopreroll_||(e.ads.debug(`Triggered readyforpreroll event (ContentPlayback)`),e.trigger(`readyforpreroll`))},n.onReadyForPostroll=function(e){var t=U.getState(`Postroll`);e.ads.debug(`Received readyforpostroll event`),this.transitionTo(t)},n.startLinearAdMode=function(){var e=U.getState(`Midroll`);this.transitionTo(e)},t}(U.getState(`ContentState`));U.registerState(`ContentPlayback`,ce);var le=function(e){m(t,e);function t(){return e.apply(this,arguments)||this}t._getName=function(){return`StitchedContentPlayback`};var n=t.prototype;return n.init=function(){this.player.ads._shouldBlockPlay=!1},n.onContentChanged=function(){this.player.ads.debug(`Received contentchanged event (`+this.constructor._getName()+`)`)},n.startLinearAdMode=function(){var e=U.getState(`StitchedAdRoll`);this.transitionTo(e)},t}(U.getState(`ContentState`));U.registerState(`StitchedContentPlayback`,le);var ue=function(e){m(t,e);function t(){return e.apply(this,arguments)||this}t._getName=function(){return`StitchedAdRoll`};var n=t.prototype;return n.init=function(){this.waitingForAdBreak=!1,this.contentResuming=!1,this.player.ads.adType=`stitched`,Q.start(this.player)},n.onPlaying=function(){},n.onContentResumed=function(){},n.onAdEnded=function(){this.endLinearAdMode(),this.player.trigger(`ended`)},n.endLinearAdMode=function(){var e=U.getState(`StitchedContentPlayback`);Q.end(this.player),this.transitionTo(e)},t}(U.getState(`AdState`));U.registerState(`StitchedAdRoll`,ue);var de=function(e){m(t,e);function t(){return e.apply(this,arguments)||this}t._getName=function(){return`OutstreamPending`};var n=t.prototype;return n.init=function(e){this.adsReady=!1},n.onPlay=function(e){var t=U.getState(`OutstreamPlayback`);e.ads.debug(`Received play event (OutstreamPending)`),this.transitionTo(t,this.adsReady)},n.onAdsReady=function(e){e.ads.debug(`Received adsready event (OutstreamPending)`),this.adsReady=!0},n.onAdsError=function(){this.player.ads.debug(`adserror (OutstreamPending)`),this.adsReady=!1},t}(U.getState(`AdState`));U.registerState(`OutstreamPending`,de);var fe=function(t){m(n,t);function n(){return t.apply(this,arguments)||this}n._getName=function(){return`OutstreamPlayback`};var r=n.prototype;return r.init=function(e,t){e.addClass(`vjs-ad-loading`),t?this.handleAdsReady():this.abort(e)},r.onAdsReady=function(t){t.ads.inAdBreak()?e.log.warn(`Unexpected adsready event (Preroll)`):(t.ads.debug(`Received adsready event (Preroll)`),this.handleAdsReady())},r.abort=function(e){var t=U.getState(`OutstreamDone`);e.removeClass(`vjs-ad-loading`),this.transitionTo(t)},r.onAdStarted=function(e){e.removeClass(`vjs-ad-loading`)},r.handleAdsReady=function(){this.adsReady=!0,this.readyForOutstreamPlayback()},r.readyForOutstreamPlayback=function(){var e=this.player;this.afterLoadStart(function(){e.trigger(`readyforoutstream`)})},r.startLinearAdMode=function(){var e=this.player;this.adsReady&&!e.ads.inAdBreak()&&Q.start(e)},r.cleanup=function(t){t.ads._hasThereBeenALoadStartDuringPlayerLife||e.log.warn(`Leaving OutstreamPlayback state before loadstart event can cause issues.`),this.cleanupPartial(t)},r.cleanupPartial=function(e){e.removeClass(`vjs-ad-loading`),e.removeClass(`vjs-ad-content-resuming`),this.clearTimeout(e)},r.clearTimeout=function(e){e.clearTimeout(this._timeout),this._timeout=null},r.onAdStarted=function(e){e.removeClass(`vjs-ad-loading`)},r.onAdsError=function(t){var n=this;e.log(`adserror (OutstreamPlayback)`),this.inAdBreak()?t.ads.endLinearAdMode():this.afterLoadStart(function(){n.abort(t)})},r.onAdTimeout=function(e){var t=this;this.afterLoadStart(function(){e.ads.debug(`adtimeout (OutstreamPlayback)`),t.abort(e)})},r.onAdsCanceled=function(e){var t=this;e.ads.debug(`adscanceled (OutstreamPlaybac)`),this.afterLoadStart(function(){t.abort(e)})},r.endLinearAdMode=function(){var e=this;if(this.inAdBreak()){this.player.removeClass(`vjs-ad-loading`);var t=U.getState(`OutstreamDone`);Q.end(this.player,function(){e.transitionTo(t)})}},r.afterLoadStart=function(e){var t=this.player;t.ads._hasThereBeenALoadStartDuringPlayerLife?e():(t.ads.debug(`Waiting for loadstart...`),t.one(`loadstart`,function(){t.ads.debug(`Received loadstart event`),e()}))},r.skipLinearAdMode=function(){var t=this,n=this.player,r=U.getState(`OutstreamDone`);this.inAdBreak()?e.log.warn(`Unexpected skipLinearAdMode invocation`):this.afterLoadStart(function(){n.trigger(`adskip`),n.ads.debug(`skipLinearAdMode (OutstreamPlayback)`),t.transitionTo(r)})},n}(U.getState(`AdState`));U.registerState(`OutstreamPlayback`,fe);var pe=function(t){m(n,t);function n(){return t.apply(this,arguments)||this}n._getName=function(){return`OutstreamDone`};var r=n.prototype;return r.init=function(e){e.trigger(`ended`)},r.startLinearAdMode=function(){e.log.warn(`Unexpected startLinearAdMode invocation (OutstreamDone)`)},n}(U.getState(`AdState`));U.registerState(`OutstreamDone`,pe);var me=I.isMiddlewareMediatorSupported,he=e.getTech(`Html5`).Events,ge={timeout:5e3,prerollTimeout:void 0,postrollTimeout:void 0,debug:!1,stitchedAds:!1,contentIsLive:void 0,liveCuePoints:!0,allowVjsAutoplay:e.options.normalizeAutoplay||!1},$=function(t){var n=this,r=e.obj.merge(ge,t),a=[];he.concat([`firstplay`,`loadedalldata`]).forEach(function(e){a.indexOf(e)===-1&&a.push(e)}),n.on(a,d),me()||P(n,r.debug),n.setTimeout(function(){!n.ads._hasThereBeenALoadStartDuringPlayerLife&&n.src()!==``&&e.log.error(`videojs-contrib-ads has not seen a loadstart event 5 seconds after being initialized, but a source is present. This indicates that videojs-contrib-ads was initialized too late. It must be initialized immediately after video.js in the same tick. As a result, some ads will not play and some media events will be incorrect. For more information, see http://videojs.github.io/videojs-contrib-ads/integrator/getting-started.html`)},5e3),n.on(`ended`,function(){n.hasClass(`vjs-has-started`)||n.addClass(`vjs-has-started`)}),n.on(`contenttimeupdate`,function(){n.removeClass(`vjs-waiting`)}),n.on([`addurationchange`,`adcanplay`],function(){if(!n.ads.settings.stitchedAds&&!n.hasStarted()&&!(n.ads.snapshot&&n.currentSrc()===n.ads.snapshot.currentSrc)&&n.ads.inAdBreak()){var t=n.play();t&&t.catch&&t.catch(function(t){e.log.warn(`Play promise rejected when playing ad`,t)})}}),n.on(`nopreroll`,function(){n.ads.debug(`Received nopreroll event`),n.ads.nopreroll_=!0}),n.on(`nopostroll`,function(){n.ads.debug(`Received nopostroll event`),n.ads.nopostroll_=!0}),n.on(`playing`,function(){n.ads._cancelledPlay=!1,n.ads._pausedOnContentupdate=!1}),n.on(`play`,function(){n.ads._playRequested=!0}),n.one(`loadstart`,function(){n.ads._hasThereBeenALoadStartDuringPlayerLife=!0}),n.on(`loadeddata`,function(){n.ads._hasThereBeenALoadedData=!0}),n.on(`loadedmetadata`,function(){n.ads._hasThereBeenALoadedMetaData=!0}),n.ads=i(n),n.ads.settings=r,r.stitchedAds=!!r.stitchedAds,r.playerMode===`outstream`?(n.src(H),n.ads._state=new(U.getState(`OutstreamPending`))(n)):r.stitchedAds?n.ads._state=new(U.getState(`StitchedContentPlayback`))(n):n.ads._state=new(U.getState(`BeforePreroll`))(n),n.ads._state.init(n),n.ads.cueTextTracks=j,n.ads.adMacroReplacement=A.bind(n),f(n),n.on(`contentchanged`,n.ads.reset);var o=function(){return!n.ads.shouldPlayContentBehindAd(n)&&n.ads.inAdBreak()&&n.tech_.featuresNativeTextTracks&&e.browser.IS_IOS&&!Array.isArray(n.textTracks())},s=function(){var e=n.textTracks();if(o())for(var t=0;t<e.length;t++){var r=e[t];r.mode===`showing`&&(r.mode=`disabled`)}};n.ready(function(){n.textTracks().addEventListener(`change`,s)}),n.on([`play`,`playing`,`ended`,`adsready`,`adscanceled`,`adskip`,`adserror`,`adtimeout`,`adended`,`ads-ad-started`,`ads-ad-skipped`,`contentchanged`,`dispose`,`contentresumed`,`readyforpostroll`,`nopreroll`,`nopostroll`],function(e){n.ads._state.handleEvent(e.type)}),n.on(`dispose`,function(){n.ads.reset(),n.textTracks().removeEventListener(`change`,s)}),v(),S(function(){}),n.ads.listenToTcf=v,n.ads.updateUsPrivacyString=function(e){return S(e)}};return $.Error=C,$.VERSION=r,V($),$})}));export default i();export{};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as e,t}from"./video.cjs-gZWrkL0e.mjs";var n=e(((e,n)=>{(function(r,i){typeof e==`object`&&n!==void 0?i(e,t()):typeof define==`function`&&define.amd?define([`exports`,`video.js`],i):(r=typeof globalThis<`u`?globalThis:r||self,i(r.videojsIma={},r.videojs))})(e,(function(e,t){function n(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function r(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function i(e,t,n){return Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=u(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function o(e,t,n){return(t=c(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function c(e){var t=s(e,`string`);return typeof t==`symbol`?t:t+``}function l(e){"@babel/helpers - typeof";return l=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},l(e)}function u(e,t){if(e){if(typeof e==`string`)return n(e,t);var r={}.toString.call(e).slice(8,-1);return r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`?Array.from(e):r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}var d=function(e,t,n){this.vjsPlayer=e,this.controller=n,this.contentTrackingTimer=null,this.contentComplete=!1,this.updateTimeIntervalHandle=null,this.updateTimeInterval=1e3,this.seekCheckIntervalHandle=null,this.seekCheckInterval=1e3,this.resizeCheckIntervalHandle=null,this.resizeCheckInterval=250,this.seekThreshold=100,this.contentEndedListeners=[],this.contentSource=``,this.contentSourceType=``,this.contentPlayheadTracker={currentTime:0,previousTime:0,seeking:!1,duration:0},this.vjsPlayerDimensions={width:this.getPlayerWidth(),height:this.getPlayerHeight()},this.vjsControls=this.vjsPlayer.getChild(`controlBar`),this.h5Player=null,this.vjsPlayer.one(`play`,this.setUpPlayerIntervals.bind(this)),this.boundContentEndedListener=this.localContentEndedListener.bind(this),this.vjsPlayer.on(`readyforpostroll`,this.boundContentEndedListener),this.vjsPlayer.on(`dispose`,this.playerDisposedListener.bind(this)),this.vjsPlayer.on(`readyforpreroll`,this.onReadyForPreroll.bind(this)),this.vjsPlayer.on(`adtimeout`,this.onAdTimeout.bind(this)),this.vjsPlayer.ready(this.onPlayerReady.bind(this)),this.controller.getSettings().requestMode===`onPlay`&&this.vjsPlayer.one(`play`,this.controller.requestAds.bind(this.controller)),this.vjsPlayer.ads||window.console.warn(`You may be using a version of videojs-contrib-ads that is not compatible with your version of video.js.`),this.vjsPlayer.ads(t)};d.prototype.setUpPlayerIntervals=function(){this.updateTimeIntervalHandle&&clearInterval(this.updateTimeIntervalHandle),this.seekCheckIntervalHandle&&clearInterval(this.seekCheckIntervalHandle),this.resizeCheckIntervalHandle&&clearInterval(this.resizeCheckIntervalHandle),this.updateTimeIntervalHandle=setInterval(this.updateCurrentTime.bind(this),this.updateTimeInterval),this.seekCheckIntervalHandle=setInterval(this.checkForSeeking.bind(this),this.seekCheckInterval),this.resizeCheckIntervalHandle=setInterval(this.checkForResize.bind(this),this.resizeCheckInterval)},d.prototype.updateCurrentTime=function(){this.contentPlayheadTracker.seeking||(this.contentPlayheadTracker.currentTime=this.vjsPlayer.currentTime())},d.prototype.checkForSeeking=function(){var e=(this.vjsPlayer.currentTime()-this.contentPlayheadTracker.previousTime)*1e3;Math.abs(e)>this.seekCheckInterval+this.seekThreshold?this.contentPlayheadTracker.seeking=!0:this.contentPlayheadTracker.seeking=!1,this.contentPlayheadTracker.previousTime=this.vjsPlayer.currentTime()},d.prototype.checkForResize=function(){var e=this.getPlayerWidth(),t=this.getPlayerHeight();(e!=this.vjsPlayerDimensions.width||t!=this.vjsPlayerDimensions.height)&&(this.vjsPlayerDimensions.width=e,this.vjsPlayerDimensions.height=t,this.controller.onPlayerResize(e,t))},d.prototype.localContentEndedListener=function(){for(var e in this.contentComplete||(this.contentComplete=!0,this.controller.onContentComplete()),this.contentEndedListeners)typeof this.contentEndedListeners[e]==`function`&&this.contentEndedListeners[e]();this.vjsPlayer.el()&&this.vjsPlayer.one(`play`,this.setUpPlayerIntervals.bind(this))},d.prototype.onNoPostroll=function(){this.vjsPlayer.trigger(`nopostroll`)},d.prototype.playerDisposedListener=function(){this.contentEndedListeners=[],this.controller.onPlayerDisposed(),this.contentComplete=!0,this.vjsPlayer.off(`readyforpostroll`,this.boundContentEndedListener),this.vjsPlayer.ads.adTimeoutTimeout&&clearTimeout(this.vjsPlayer.ads.adTimeoutTimeout);var e=[this.updateTimeIntervalHandle,this.seekCheckIntervalHandle,this.resizeCheckIntervalHandle];for(var t in e)e[t]&&clearInterval(e[t])},d.prototype.onReadyForPreroll=function(){this.controller.onPlayerReadyForPreroll()},d.prototype.onAdTimeout=function(){this.controller.onAdTimeout()},d.prototype.onPlayerReady=function(){this.h5Player=document.getElementById(this.getPlayerId()).getElementsByClassName(`vjs-tech`)[0],this.h5Player.hasAttribute(`autoplay`)&&this.controller.setSetting(`adWillAutoPlay`,!0),this.onVolumeChange(),this.vjsPlayer.on(`fullscreenchange`,this.onFullscreenChange.bind(this)),this.vjsPlayer.on(`volumechange`,this.onVolumeChange.bind(this)),this.controller.onPlayerReady()},d.prototype.onFullscreenChange=function(){this.vjsPlayer.isFullscreen()?this.controller.onPlayerEnterFullscreen():this.controller.onPlayerExitFullscreen()},d.prototype.onVolumeChange=function(){var e=this.vjsPlayer.muted()?0:this.vjsPlayer.volume();this.controller.onPlayerVolumeChanged(e)},d.prototype.injectAdContainerDiv=function(e){this.vjsControls.el().parentNode.appendChild(e)},d.prototype.getContentPlayer=function(){return this.h5Player},d.prototype.getVolume=function(){return this.vjsPlayer.muted()?0:this.vjsPlayer.volume()},d.prototype.setVolume=function(e){this.vjsPlayer.volume(e),e==0?this.vjsPlayer.muted(!0):this.vjsPlayer.muted(!1)},d.prototype.unmute=function(){this.vjsPlayer.muted(!1)},d.prototype.mute=function(){this.vjsPlayer.muted(!0)},d.prototype.play=function(){this.vjsPlayer.play()},d.prototype.togglePlayback=function(){this.vjsPlayer.paused()?this.vjsPlayer.play():this.vjsPlayer.pause()},d.prototype.getPlayerWidth=function(){var e=(getComputedStyle(this.vjsPlayer.el())||{}).width;return(!e||parseFloat(e)===0)&&(e=(this.vjsPlayer.el().getBoundingClientRect()||{}).width),parseFloat(e)||this.vjsPlayer.width()},d.prototype.getPlayerHeight=function(){var e=(getComputedStyle(this.vjsPlayer.el())||{}).height;return(!e||parseFloat(e)===0)&&(e=(this.vjsPlayer.el().getBoundingClientRect()||{}).height),parseFloat(e)||this.vjsPlayer.height()},d.prototype.getPlayerOptions=function(){return this.vjsPlayer.options_},d.prototype.getPlayerId=function(){return this.vjsPlayer.id()},d.prototype.toggleFullscreen=function(){this.vjsPlayer.isFullscreen()?this.vjsPlayer.exitFullscreen():this.vjsPlayer.requestFullscreen()},d.prototype.getContentPlayheadTracker=function(){return this.contentPlayheadTracker},d.prototype.onAdError=function(e){this.vjsControls.show();var t=e.getError===void 0?e.stack:e.getError();this.vjsPlayer.trigger({type:`adserror`,data:{AdError:t,AdErrorEvent:e}})},d.prototype.onAdLog=function(e){var t=e.getAdData(),n=t.adError===void 0?void 0:t.adError.getMessage();this.vjsPlayer.trigger({type:`adslog`,data:{AdError:n,AdEvent:e}})},d.prototype.onAdBreakStart=function(){this.contentSource=this.vjsPlayer.currentSrc(),this.contentSourceType=this.vjsPlayer.currentType(),this.vjsPlayer.off(`readyforpostroll`,this.boundContentEndedListener),this.vjsPlayer.ads.startLinearAdMode(),this.vjsControls.hide(),this.vjsPlayer.pause()},d.prototype.onAdBreakEnd=function(){this.vjsPlayer.on(`readyforpostroll`,this.boundContentEndedListener),this.vjsPlayer.ads.inAdBreak()&&this.vjsPlayer.ads.endLinearAdMode(),this.vjsControls.show()},d.prototype.onAdStart=function(){this.vjsPlayer.trigger(`ads-ad-started`)},d.prototype.onAllAdsCompleted=function(){this.contentComplete==1&&(this.contentSource&&this.vjsPlayer.currentSrc()!=this.contentSource&&this.vjsPlayer.src({src:this.contentSource,type:this.contentSourceType}),this.controller.onContentAndAdsCompleted())},d.prototype.onAdsReady=function(){this.vjsPlayer.trigger(`adsready`)},d.prototype.changeSource=function(e){this.vjsPlayer.currentSrc()&&(this.vjsPlayer.currentTime(0),this.vjsPlayer.pause()),e&&this.vjsPlayer.src(e),this.vjsPlayer.one(`loadedmetadata`,this.seekContentToZero.bind(this))},d.prototype.seekContentToZero=function(){this.vjsPlayer.currentTime(0)},d.prototype.triggerPlayerEvent=function(e,t){this.vjsPlayer.trigger(e,t)},d.prototype.addContentEndedListener=function(e){this.contentEndedListeners.push(e)},d.prototype.reset=function(){this.vjsPlayer.off(`readyforpostroll`,this.boundContentEndedListener),this.vjsPlayer.on(`readyforpostroll`,this.boundContentEndedListener),this.vjsControls.show(),this.vjsPlayer.ads.inAdBreak()&&this.vjsPlayer.ads.endLinearAdMode(),this.contentPlayheadTracker.currentTime=0,this.contentComplete=!1};var f=function(e){this.controller=e,this.adContainerDiv=document.createElement(`div`),this.controlsDiv=document.createElement(`div`),this.countdownDiv=document.createElement(`div`),this.seekBarDiv=document.createElement(`div`),this.progressDiv=document.createElement(`div`),this.playPauseDiv=document.createElement(`div`),this.muteDiv=document.createElement(`div`),this.sliderDiv=document.createElement(`div`),this.sliderLevelDiv=document.createElement(`div`),this.fullscreenDiv=document.createElement(`div`),this.boundOnMouseUp=this.onMouseUp.bind(this),this.boundOnMouseMove=this.onMouseMove.bind(this),this.adPlayheadTracker={currentTime:0,duration:0,isPod:!1,adPosition:0,totalAds:0},this.controlPrefix=this.controller.getPlayerId()+`_`,this.showCountdown=!0,this.controller.getSettings().showCountdown===!1&&(this.showCountdown=!1),this.isAdNonlinear=!1,this.createAdContainer()};f.prototype.createAdContainer=function(){this.assignControlAttributes(this.adContainerDiv,`ima-ad-container`),this.adContainerDiv.classList.add(`hide-ad-container`),this.adContainerDiv.addEventListener(`mouseenter`,this.showAdControls.bind(this),!1),this.adContainerDiv.addEventListener(`mouseleave`,this.hideAdControls.bind(this),!1),this.adContainerDiv.addEventListener(`click`,this.onAdContainerClick.bind(this),!1),this.createControls(),this.controller.injectAdContainerDiv(this.adContainerDiv)},f.prototype.createControls=function(){this.assignControlAttributes(this.controlsDiv,`ima-controls-div`),this.controlsDiv.style.width=`100%`,this.controller.getIsMobile()?this.countdownDiv.style.display=`none`:(this.assignControlAttributes(this.countdownDiv,`ima-countdown-div`),this.countdownDiv.innerHTML=this.controller.getSettings().adLabel,this.countdownDiv.style.display=this.showCountdown?`block`:`none`),this.assignControlAttributes(this.seekBarDiv,`ima-seek-bar-div`),this.seekBarDiv.style.width=`100%`,this.assignControlAttributes(this.progressDiv,`ima-progress-div`),this.assignControlAttributes(this.playPauseDiv,`ima-play-pause-div`),this.addClass(this.playPauseDiv,`ima-playing`),this.playPauseDiv.addEventListener(`click`,this.onAdPlayPauseClick.bind(this),!1),this.assignControlAttributes(this.muteDiv,`ima-mute-div`),this.addClass(this.muteDiv,`ima-non-muted`),this.muteDiv.addEventListener(`click`,this.onAdMuteClick.bind(this),!1),this.assignControlAttributes(this.sliderDiv,`ima-slider-div`),this.sliderDiv.addEventListener(`mousedown`,this.onAdVolumeSliderMouseDown.bind(this),!1),this.controller.getIsIos()&&(this.sliderDiv.style.display=`none`),this.assignControlAttributes(this.sliderLevelDiv,`ima-slider-level-div`),this.assignControlAttributes(this.fullscreenDiv,`ima-fullscreen-div`),this.addClass(this.fullscreenDiv,`ima-non-fullscreen`),this.fullscreenDiv.addEventListener(`click`,this.onAdFullscreenClick.bind(this),!1),this.adContainerDiv.appendChild(this.controlsDiv),this.controlsDiv.appendChild(this.countdownDiv),this.controlsDiv.appendChild(this.seekBarDiv),this.controlsDiv.appendChild(this.playPauseDiv),this.controlsDiv.appendChild(this.muteDiv),this.controlsDiv.appendChild(this.sliderDiv),this.controlsDiv.appendChild(this.fullscreenDiv),this.seekBarDiv.appendChild(this.progressDiv),this.sliderDiv.appendChild(this.sliderLevelDiv)},f.prototype.onAdPlayPauseClick=function(){this.controller.onAdPlayPauseClick()},f.prototype.onAdMuteClick=function(){this.controller.onAdMuteClick()},f.prototype.onAdFullscreenClick=function(){this.controller.toggleFullscreen()},f.prototype.onAdsPaused=function(){this.controller.sdkImpl.adPlaying=!1,this.addClass(this.playPauseDiv,`ima-paused`),this.removeClass(this.playPauseDiv,`ima-playing`),this.showAdControls()},f.prototype.onAdsResumed=function(){this.onAdsPlaying(),this.showAdControls()},f.prototype.onAdsPlaying=function(){this.controller.sdkImpl.adPlaying=!0,this.addClass(this.playPauseDiv,`ima-playing`),this.removeClass(this.playPauseDiv,`ima-paused`)},f.prototype.updateAdUi=function(e,t,n,r,i){var a=Math.floor(t/60),o=Math.floor(t%60);o.toString().length<2&&(o=`0`+o);var s=`: `;i>1&&(s=` (`+r+` `+this.controller.getSettings().adLabelNofN+` `+i+`): `),this.countdownDiv.innerHTML=this.controller.getSettings().adLabel+s+a+`:`+o;var c=e/n*100;this.progressDiv.style.width=c+`%`},f.prototype.unmute=function(){this.addClass(this.muteDiv,`ima-non-muted`),this.removeClass(this.muteDiv,`ima-muted`),this.sliderLevelDiv.style.width=this.controller.getPlayerVolume()*100+`%`},f.prototype.mute=function(){this.addClass(this.muteDiv,`ima-muted`),this.removeClass(this.muteDiv,`ima-non-muted`),this.sliderLevelDiv.style.width=`0%`},f.prototype.onAdVolumeSliderMouseDown=function(){document.addEventListener(`mouseup`,this.boundOnMouseUp,!1),document.addEventListener(`mousemove`,this.boundOnMouseMove,!1)},f.prototype.onMouseMove=function(e){this.changeVolume(e)},f.prototype.onMouseUp=function(e){this.changeVolume(e),document.removeEventListener(`mouseup`,this.boundOnMouseUp),document.removeEventListener(`mousemove`,this.boundOnMouseMove)},f.prototype.changeVolume=function(e){var t=(e.clientX-this.sliderDiv.getBoundingClientRect().left)/this.sliderDiv.offsetWidth;t*=100,t=Math.min(Math.max(t,0),100),this.sliderLevelDiv.style.width=t+`%`,this.percent==0?(this.addClass(this.muteDiv,`ima-muted`),this.removeClass(this.muteDiv,`ima-non-muted`)):(this.addClass(this.muteDiv,`ima-non-muted`),this.removeClass(this.muteDiv,`ima-muted`)),this.controller.setVolume(t/100)},f.prototype.showAdContainer=function(){this.adContainerDiv.classList.remove(`hide-ad-container`)},f.prototype.hideAdContainer=function(){this.adContainerDiv.classList.add(`hide-ad-container`)},f.prototype.onAdContainerClick=function(){this.isAdNonlinear&&this.controller.togglePlayback()},f.prototype.reset=function(){this.hideAdContainer()},f.prototype.onAdError=function(){this.hideAdContainer()},f.prototype.onAdBreakStart=function(e){this.showAdContainer(),e.getAd().getContentType()===`application/javascript`&&!this.controller.getSettings().showControlsForJSAds?this.controlsDiv.style.display=`none`:this.controlsDiv.style.display=`block`,this.onAdsPlaying(),this.hideAdControls()},f.prototype.onAdBreakEnd=function(){var e=this.controller.getCurrentAd();(e==null||e.isLinear())&&this.hideAdContainer(),this.controlsDiv.style.display=`none`,this.countdownDiv.innerHTML=``},f.prototype.onAllAdsCompleted=function(){this.hideAdContainer()},f.prototype.onLinearAdStart=function(){this.removeClass(this.adContainerDiv,`bumpable-ima-ad-container`),this.isAdNonlinear=!1},f.prototype.onNonLinearAdLoad=function(){this.addClass(this.adContainerDiv,`bumpable-ima-ad-container`),this.isAdNonlinear=!0},f.prototype.onPlayerEnterFullscreen=function(){this.addClass(this.fullscreenDiv,`ima-fullscreen`),this.removeClass(this.fullscreenDiv,`ima-non-fullscreen`)},f.prototype.onPlayerExitFullscreen=function(){this.addClass(this.fullscreenDiv,`ima-non-fullscreen`),this.removeClass(this.fullscreenDiv,`ima-fullscreen`)},f.prototype.onPlayerVolumeChanged=function(e){e==0?(this.addClass(this.muteDiv,`ima-muted`),this.removeClass(this.muteDiv,`ima-non-muted`),this.sliderLevelDiv.style.width=`0%`):(this.addClass(this.muteDiv,`ima-non-muted`),this.removeClass(this.muteDiv,`ima-muted`),this.sliderLevelDiv.style.width=e*100+`%`)},f.prototype.showAdControls=function(){this.controller.getSettings().disableAdControls||this.addClass(this.controlsDiv,`ima-controls-div-showing`)},f.prototype.hideAdControls=function(){this.removeClass(this.controlsDiv,`ima-controls-div-showing`)},f.prototype.assignControlAttributes=function(e,t){e.id=this.controlPrefix+t,e.className=this.controlPrefix+t+` `+t},f.prototype.getClassRegexp=function(e){return RegExp(`(^|[^A-Za-z-])`+e+`((?![A-Za-z-])|$)`,`gi`)},f.prototype.elementHasClass=function(e,t){return this.getClassRegexp(t).test(e.className)},f.prototype.addClass=function(e,t){e.className=e.className.trim()+` `+t},f.prototype.removeClass=function(e,t){var n=this.getClassRegexp(t);e.className=e.className.trim().replace(n,``)},f.prototype.getAdContainerDiv=function(){return this.adContainerDiv},f.prototype.setShowCountdown=function(e){this.showCountdown=e,this.countdownDiv.style.display=this.showCountdown?`block`:`none`};var p={version:`2.6.0`},m=function(e){this.controller=e,this.adDisplayContainer=null,this.adDisplayContainerInitialized=!1,this.adsLoader=null,this.adsManager=null,this.adsRenderingSettings=null,this.adsResponse=null,this.currentAd=null,this.adTrackingTimer=null,this.allAdsCompleted=!1,this.adsActive=!1,this.adPlaying=!1,this.adMuted=!1,this.adBreakReadyListener=void 0,this.contentCompleteCalled=!1,this.isAdTimedOut=!1,this.adsManagerDimensions={width:0,height:0},this.autoPlayAdBreaks=!0,this.controller.getSettings().autoPlayAdBreaks===!1&&(this.autoPlayAdBreaks=!1),this.controller.getSettings().locale&&google.ima.settings.setLocale(this.controller.getSettings().locale),this.controller.getSettings().disableFlashAds&&google.ima.settings.setDisableFlashAds(this.controller.getSettings().disableFlashAds),this.controller.getSettings().disableCustomPlaybackForIOS10Plus&&google.ima.settings.setDisableCustomPlaybackForIOS10Plus(this.controller.getSettings().disableCustomPlaybackForIOS10Plus),this.controller.getSettings().ppid&&google.ima.settings.setPpid(this.controller.getSettings().ppid),this.controller.getSettings().featureFlags&&google.ima.settings.setFeatureFlags(this.controller.getSettings().featureFlags)};m.prototype.initAdObjects=function(){this.adDisplayContainer=new google.ima.AdDisplayContainer(this.controller.getAdContainerDiv(),this.controller.getContentPlayer()),this.adsLoader=new google.ima.AdsLoader(this.adDisplayContainer),this.adsLoader.getSettings().setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED),this.controller.getSettings().vpaidAllowed==0&&this.adsLoader.getSettings().setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.DISABLED),this.controller.getSettings().vpaidMode!==void 0&&this.adsLoader.getSettings().setVpaidMode(this.controller.getSettings().vpaidMode),this.controller.getSettings().locale&&this.adsLoader.getSettings().setLocale(this.controller.getSettings().locale),this.controller.getSettings().numRedirects&&this.adsLoader.getSettings().setNumRedirects(this.controller.getSettings().numRedirects),this.controller.getSettings().sessionId&&this.adsLoader.getSettings().setSessionId(this.controller.getSettings().sessionId),this.adsLoader.getSettings().setPlayerType(`videojs-ima`),this.adsLoader.getSettings().setPlayerVersion(p.version),this.adsLoader.getSettings().setAutoPlayAdBreaks(this.autoPlayAdBreaks),this.adsLoader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.onAdsManagerLoaded.bind(this),!1),this.adsLoader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this.onAdsLoaderError.bind(this),!1),this.controller.playerWrapper.vjsPlayer.trigger({type:`ads-loader`,adsLoader:this.adsLoader})},m.prototype.requestAds=function(){var e=new google.ima.AdsRequest;if(this.controller.getSettings().adTagUrl?e.adTagUrl=this.controller.getSettings().adTagUrl:e.adsResponse=this.controller.getSettings().adsResponse,this.controller.getSettings().forceNonLinearFullSlot&&(e.forceNonLinearFullSlot=!0),this.controller.getSettings().vastLoadTimeout&&(e.vastLoadTimeout=this.controller.getSettings().vastLoadTimeout),this.controller.getSettings().omidMode&&window.console.warn("The additional setting `omidMode` has been removed. Use `omidVendorAccess` instead."),this.controller.getSettings().omidVendorAccess){e.omidAccessModeRules={};var t=this.controller.getSettings().omidVendorAccess;Object.keys(t).forEach(function(n){e.omidAccessModeRules[n]=t[n]})}e.linearAdSlotWidth=this.controller.getPlayerWidth(),e.linearAdSlotHeight=this.controller.getPlayerHeight(),e.nonLinearAdSlotWidth=this.controller.getSettings().nonLinearWidth||this.controller.getPlayerWidth(),e.nonLinearAdSlotHeight=this.controller.getSettings().nonLinearHeight||this.controller.getPlayerHeight(),e.setAdWillAutoPlay(this.controller.adsWillAutoplay()),e.setAdWillPlayMuted(this.controller.adsWillPlayMuted());var n=this.controller.getSettings().adsRequest;n&&l(n)===`object`&&Object.keys(n).forEach(function(t){e[t]=n[t]}),this.adsLoader.requestAds(e),this.controller.playerWrapper.vjsPlayer.trigger({type:`ads-request`,AdsRequest:e})},m.prototype.onAdsManagerLoaded=function(e){this.createAdsRenderingSettings(),this.adsManager=e.getAdsManager(this.controller.getContentPlayheadTracker(),this.adsRenderingSettings),this.adsManager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this.onAdError.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.AD_BREAK_READY,this.onAdBreakReady.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,this.onContentPauseRequested.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,this.onContentResumeRequested.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.ALL_ADS_COMPLETED,this.onAllAdsCompleted.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.LOADED,this.onAdLoaded.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.STARTED,this.onAdStarted.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,this.onAdComplete.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.SKIPPED,this.onAdComplete.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.LOG,this.onAdLog.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.PAUSED,this.onAdPaused.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.RESUMED,this.onAdResumed.bind(this)),this.controller.playerWrapper.vjsPlayer.trigger({type:`ads-manager`,adsManager:this.adsManager}),this.autoPlayAdBreaks||this.initAdsManager();var t=this.controller.getSettings().preventLateAdStart;t?t&&!this.isAdTimedOut&&this.controller.onAdsReady():this.controller.onAdsReady(),this.controller.getSettings().adsManagerLoadedCallback&&this.controller.getSettings().adsManagerLoadedCallback()},m.prototype.onAdsLoaderError=function(e){window.console.warn(`AdsLoader error: `+e.getError()),this.controller.onErrorLoadingAds(e),this.adsManager&&this.adsManager.destroy()},m.prototype.initAdsManager=function(){try{var e=this.controller.getPlayerWidth(),t=this.controller.getPlayerHeight();this.adsManagerDimensions.width=e,this.adsManagerDimensions.height=t,this.adsManager.init(e,t),this.adsManager.setVolume(this.controller.getPlayerVolume()),this.initializeAdDisplayContainer()}catch(e){this.onAdError(e)}},m.prototype.createAdsRenderingSettings=function(){if(this.adsRenderingSettings=new google.ima.AdsRenderingSettings,this.adsRenderingSettings.restoreCustomPlaybackStateOnAdBreakComplete=!0,this.controller.getSettings().adsRenderingSettings)for(var e in this.controller.getSettings().adsRenderingSettings)e!==``&&(this.adsRenderingSettings[e]=this.controller.getSettings().adsRenderingSettings[e])},m.prototype.onAdError=function(e){var t=e.getError===void 0?e.stack:e.getError();window.console.warn(`Ad error: `+t),this.adsManager.destroy(),this.controller.onAdError(e),this.adsActive=!1,this.adPlaying=!1},m.prototype.onAdBreakReady=function(e){this.adBreakReadyListener(e)},m.prototype.onContentPauseRequested=function(e){this.adsActive=!0,this.adPlaying=!0,this.controller.onAdBreakStart(e)},m.prototype.onContentResumeRequested=function(e){this.adsActive=!1,this.adPlaying=!1,this.controller.onAdBreakEnd()},m.prototype.onAllAdsCompleted=function(e){this.allAdsCompleted=!0,this.controller.onAllAdsCompleted()},m.prototype.onAdLoaded=function(e){e.getAd().isLinear()||(this.controller.onNonLinearAdLoad(),this.controller.playContent())},m.prototype.onAdStarted=function(e){this.currentAd=e.getAd(),this.currentAd.isLinear()?(this.adTrackingTimer=setInterval(this.onAdPlayheadTrackerInterval.bind(this),250),this.controller.onLinearAdStart()):this.controller.onNonLinearAdStart()},m.prototype.onAdPaused=function(){this.controller.onAdsPaused()},m.prototype.onAdResumed=function(e){this.controller.onAdsResumed()},m.prototype.onAdComplete=function(){this.currentAd.isLinear()&&clearInterval(this.adTrackingTimer)},m.prototype.onAdLog=function(e){this.controller.onAdLog(e)},m.prototype.onAdPlayheadTrackerInterval=function(){if(this.adsManager!==null){var e=this.adsManager.getRemainingTime(),t=this.currentAd.getDuration(),n=t-e;n=n>0?n:0;var r=0,i;this.currentAd.getAdPodInfo()&&(i=this.currentAd.getAdPodInfo().getAdPosition(),r=this.currentAd.getAdPodInfo().getTotalAds()),this.controller.onAdPlayheadUpdated(n,e,t,i,r)}},m.prototype.onContentComplete=function(){this.adsLoader&&(this.adsLoader.contentComplete(),this.contentCompleteCalled=!0),(this.adsManager&&this.adsManager.getCuePoints()&&!this.adsManager.getCuePoints().includes(-1)||!this.adsManager)&&this.controller.onNoPostroll(),this.allAdsCompleted&&this.controller.onContentAndAdsCompleted()},m.prototype.onPlayerDisposed=function(){this.adTrackingTimer&&clearInterval(this.adTrackingTimer),this.adsManager&&=(this.adsManager.destroy(),null)},m.prototype.onPlayerReadyForPreroll=function(){if(this.autoPlayAdBreaks){this.initAdsManager();try{this.controller.showAdContainer(),this.adsManager.setVolume(this.controller.getPlayerVolume()),this.adsManager.start()}catch(e){this.onAdError(e)}}},m.prototype.onAdTimeout=function(){this.isAdTimedOut=!0},m.prototype.onPlayerReady=function(){this.initAdObjects(),(this.controller.getSettings().adTagUrl||this.controller.getSettings().adsResponse)&&this.controller.getSettings().requestMode===`onLoad`&&this.requestAds()},m.prototype.onPlayerEnterFullscreen=function(){this.adsManager&&this.adsManager.resize(window.screen.width,window.screen.height)},m.prototype.onPlayerExitFullscreen=function(){this.adsManager&&this.adsManager.resize(this.controller.getPlayerWidth(),this.controller.getPlayerHeight())},m.prototype.onPlayerVolumeChanged=function(e){this.adsManager&&this.adsManager.setVolume(e),e==0?this.adMuted=!0:this.adMuted=!1},m.prototype.onPlayerResize=function(e,t){this.adsManager&&(this.adsManagerDimensions.width=e,this.adsManagerDimensions.height=t,this.adsManager.resize(e,t))},m.prototype.getCurrentAd=function(){return this.currentAd},m.prototype.setAdBreakReadyListener=function(e){this.adBreakReadyListener=e},m.prototype.isAdPlaying=function(){return this.adPlaying},m.prototype.isAdMuted=function(){return this.adMuted},m.prototype.pauseAds=function(){this.adsManager.pause(),this.adPlaying=!1},m.prototype.resumeAds=function(){this.adsManager.resume(),this.adPlaying=!0},m.prototype.unmute=function(){this.adsManager.setVolume(1),this.adMuted=!1},m.prototype.mute=function(){this.adsManager.setVolume(0),this.adMuted=!0},m.prototype.setVolume=function(e){this.adsManager.setVolume(e),e==0?this.adMuted=!0:this.adMuted=!1},m.prototype.initializeAdDisplayContainer=function(){this.adDisplayContainer&&(this.adDisplayContainerInitialized||=(this.adDisplayContainer.initialize(),!0))},m.prototype.playAdBreak=function(){this.autoPlayAdBreaks||(this.controller.showAdContainer(),this.adsManager.setVolume(this.controller.getPlayerVolume()),this.adsManager.start())},m.prototype.addEventListener=function(e,t){this.adsManager&&this.adsManager.addEventListener(e,t)},m.prototype.getAdsManager=function(){return this.adsManager},m.prototype.reset=function(){this.adsActive=!1,this.adPlaying=!1,this.adTrackingTimer&&clearInterval(this.adTrackingTimer),this.adsManager&&=(this.adsManager.destroy(),null),this.adsLoader&&!this.contentCompleteCalled&&this.adsLoader.contentComplete(),this.contentCompleteCalled=!1,this.allAdsCompleted=!1};var h=function(e,t){this.settings={},this.contentAndAdsEndedListeners=[],this.isMobile=navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i),this.isIos=navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i),this.initWithSettings(t);var n={debug:this.settings.debug,timeout:this.settings.timeout,prerollTimeout:this.settings.prerollTimeout},r=Object.assign({},n,t.contribAdsSettings||{});this.playerWrapper=new d(e,r,this),this.adUi=new f(this),this.sdkImpl=new m(this)};h.IMA_DEFAULTS={adLabel:`Advertisement`,adLabelNofN:`of`,debug:!1,disableAdControls:!1,prerollTimeout:1e3,preventLateAdStart:!1,requestMode:`onLoad`,showControlsForJSAds:!0,timeout:5e3},h.prototype.initWithSettings=function(e){this.settings=Object.assign({},h.IMA_DEFAULTS,e||{}),this.warnAboutDeprecatedSettings(),this.showCountdown=!0,this.settings.showCountdown===!1&&(this.showCountdown=!1)},h.prototype.warnAboutDeprecatedSettings=function(){var e=this;[`adWillAutoplay`,`adsWillAutoplay`,`adWillPlayMuted`,`adsWillPlayMuted`].forEach(function(t){e.settings[t]!==void 0&&console.warn(`WARNING: videojs.ima setting `+t+` is deprecated`)})},h.prototype.getSettings=function(){return this.settings},h.prototype.getIsMobile=function(){return this.isMobile},h.prototype.getIsIos=function(){return this.isIos},h.prototype.injectAdContainerDiv=function(e){this.playerWrapper.injectAdContainerDiv(e)},h.prototype.getAdContainerDiv=function(){return this.adUi.getAdContainerDiv()},h.prototype.getContentPlayer=function(){return this.playerWrapper.getContentPlayer()},h.prototype.getContentPlayheadTracker=function(){return this.playerWrapper.getContentPlayheadTracker()},h.prototype.requestAds=function(){this.sdkImpl.requestAds()},h.prototype.setSetting=function(e,t){this.settings[e]=t},h.prototype.onErrorLoadingAds=function(e){this.adUi.onAdError(),this.playerWrapper.onAdError(e)},h.prototype.onAdPlayPauseClick=function(){this.sdkImpl.isAdPlaying()?(this.adUi.onAdsPaused(),this.sdkImpl.pauseAds()):(this.adUi.onAdsPlaying(),this.sdkImpl.resumeAds())},h.prototype.onAdMuteClick=function(){this.sdkImpl.isAdMuted()?(this.playerWrapper.unmute(),this.adUi.unmute(),this.sdkImpl.unmute()):(this.playerWrapper.mute(),this.adUi.mute(),this.sdkImpl.mute())},h.prototype.setVolume=function(e){this.playerWrapper.setVolume(e),this.sdkImpl.setVolume(e)},h.prototype.getPlayerVolume=function(){return this.playerWrapper.getVolume()},h.prototype.toggleFullscreen=function(){this.playerWrapper.toggleFullscreen()},h.prototype.onAdError=function(e){this.adUi.onAdError(),this.playerWrapper.onAdError(e)},h.prototype.onAdBreakStart=function(e){this.playerWrapper.onAdBreakStart(),this.adUi.onAdBreakStart(e)},h.prototype.showAdContainer=function(){this.adUi.showAdContainer()},h.prototype.onAdBreakEnd=function(){this.playerWrapper.onAdBreakEnd(),this.adUi.onAdBreakEnd()},h.prototype.onAllAdsCompleted=function(){this.adUi.onAllAdsCompleted(),this.playerWrapper.onAllAdsCompleted()},h.prototype.onAdsPaused=function(){this.adUi.onAdsPaused()},h.prototype.onAdsResumed=function(){this.adUi.onAdsResumed()},h.prototype.onAdPlayheadUpdated=function(e,t,n,r,i){this.adUi.updateAdUi(e,t,n,r,i)},h.prototype.onAdLog=function(e){this.playerWrapper.onAdLog(e)},h.prototype.getCurrentAd=function(){return this.sdkImpl.getCurrentAd()},h.prototype.playContent=function(){this.playerWrapper.play()},h.prototype.onLinearAdStart=function(){this.adUi.onLinearAdStart(),this.playerWrapper.onAdStart()},h.prototype.onNonLinearAdLoad=function(){this.adUi.onNonLinearAdLoad()},h.prototype.onNonLinearAdStart=function(){this.adUi.onNonLinearAdLoad(),this.playerWrapper.onAdStart()},h.prototype.getPlayerWidth=function(){return this.playerWrapper.getPlayerWidth()},h.prototype.getPlayerHeight=function(){return this.playerWrapper.getPlayerHeight()},h.prototype.onAdsReady=function(){this.playerWrapper.onAdsReady()},h.prototype.onPlayerResize=function(e,t){this.sdkImpl.onPlayerResize(e,t)},h.prototype.onContentComplete=function(){this.sdkImpl.onContentComplete()},h.prototype.onNoPostroll=function(){this.playerWrapper.onNoPostroll()},h.prototype.onContentAndAdsCompleted=function(){for(var e in this.contentAndAdsEndedListeners)typeof this.contentAndAdsEndedListeners[e]==`function`&&this.contentAndAdsEndedListeners[e]()},h.prototype.onPlayerDisposed=function(){this.contentAndAdsEndedListeners=[],this.sdkImpl.onPlayerDisposed()},h.prototype.onPlayerReadyForPreroll=function(){this.sdkImpl.onPlayerReadyForPreroll()},h.prototype.onAdTimeout=function(){this.sdkImpl.onAdTimeout()},h.prototype.onPlayerReady=function(){this.sdkImpl.onPlayerReady()},h.prototype.onPlayerEnterFullscreen=function(){this.adUi.onPlayerEnterFullscreen(),this.sdkImpl.onPlayerEnterFullscreen()},h.prototype.onPlayerExitFullscreen=function(){this.adUi.onPlayerExitFullscreen(),this.sdkImpl.onPlayerExitFullscreen()},h.prototype.onPlayerVolumeChanged=function(e){this.adUi.onPlayerVolumeChanged(e),this.sdkImpl.onPlayerVolumeChanged(e)},h.prototype.setContentWithAdTag=function(e,t){this.reset(),this.settings.adTagUrl=t||this.settings.adTagUrl,this.playerWrapper.changeSource(e)},h.prototype.setContentWithAdsResponse=function(e,t){this.reset(),this.settings.adsResponse=t||this.settings.adsResponse,this.playerWrapper.changeSource(e)},h.prototype.setContentWithAdsRequest=function(e,t){this.reset(),this.settings.adsRequest=t||this.settings.adsRequest,this.playerWrapper.changeSource(e)},h.prototype.reset=function(){this.sdkImpl.reset(),this.playerWrapper.reset(),this.adUi.reset()},h.prototype.addContentEndedListener=function(e){this.playerWrapper.addContentEndedListener(e)},h.prototype.addContentAndAdsEndedListener=function(e){this.contentAndAdsEndedListeners.push(e)},h.prototype.setAdBreakReadyListener=function(e){this.sdkImpl.setAdBreakReadyListener(e)},h.prototype.setShowCountdown=function(e){this.adUi.setShowCountdown(e),this.showCountdown=e,this.adUi.countdownDiv.style.display=this.showCountdown?`block`:`none`},h.prototype.initializeAdDisplayContainer=function(){this.sdkImpl.initializeAdDisplayContainer()},h.prototype.playAdBreak=function(){this.sdkImpl.playAdBreak()},h.prototype.addEventListener=function(e,t){this.sdkImpl.addEventListener(e,t)},h.prototype.getAdsManager=function(){return this.sdkImpl.getAdsManager()},h.prototype.getPlayerId=function(){return this.playerWrapper.getPlayerId()},h.prototype.changeAdTag=function(e){this.reset(),this.settings.adTagUrl=e},h.prototype.pauseAd=function(){this.adUi.onAdsPaused(),this.sdkImpl.pauseAds()},h.prototype.resumeAd=function(){this.adUi.onAdsPlaying(),this.sdkImpl.resumeAds()},h.prototype.togglePlayback=function(){this.playerWrapper.togglePlayback()},h.prototype.adsWillAutoplay=function(){return this.settings.adsWillAutoplay===void 0?this.settings.adWillAutoplay===void 0?!!this.playerWrapper.getPlayerOptions().autoplay:this.settings.adWillAutoplay:this.settings.adsWillAutoplay},h.prototype.adsWillPlayMuted=function(){return this.settings.adsWillPlayMuted===void 0?this.settings.adWillPlayMuted===void 0?this.playerWrapper.getPlayerOptions().muted===void 0?this.playerWrapper.getVolume()==0:this.playerWrapper.getPlayerOptions().muted:this.settings.adWillPlayMuted:this.settings.adsWillPlayMuted},h.prototype.triggerPlayerEvent=function(e,t){this.playerWrapper.triggerPlayerEvent(e,t)};var g=function(e,t,n){this.vjsPlayer=e,this.daiController=n,this.vjsControls=this.vjsPlayer.getChild(`controlBar`),this.h5Player=null,this.vjsPlayer.on(`dispose`,this.playerDisposedListener.bind(this)),this.vjsPlayer.on(`pause`,this.onPause.bind(this)),this.vjsPlayer.on(`play`,this.onPlay.bind(this)),this.vjsPlayer.on(`seeked`,this.onSeekEnd.bind(this)),this.vjsPlayer.ready(this.onPlayerReady.bind(this)),this.vjsPlayer.ads||window.console.warn(`You may be using a version of videojs-contrib-ads that is not compatible with your version of video.js.`),this.vjsPlayer.ads(t)};g.prototype.playerDisposedListener=function(){this.contentEndedListeners=[],this.daiController.onPlayerDisposed()},g.prototype.onPause=function(){this.daiController.isInAdBreak()&&this.vjsControls.show()},g.prototype.onPlay=function(){this.daiController.isInAdBreak()&&this.vjsControls.hide()},g.prototype.onSeekEnd=function(){this.daiController.onSeekEnd(this.vjsPlayer.currentTime())},g.prototype.onPlayerReady=function(){this.h5Player=document.getElementById(this.getPlayerId()).getElementsByClassName(`vjs-tech`)[0],this.daiController.onPlayerReady()},g.prototype.getStreamPlayer=function(){return this.h5Player},g.prototype.getVjsPlayer=function(){return this.vjsPlayer},g.prototype.getPlayerOptions=function(){return this.vjsPlayer.options_},g.prototype.getPlayerId=function(){return this.vjsPlayer.id()},g.prototype.onAdError=function(e){this.vjsControls.show();var t=e.getError===void 0?e.stack:e.getError();this.vjsPlayer.trigger({type:`adserror`,data:{AdError:t,AdErrorEvent:e}})},g.prototype.onAdBreakStart=function(){this.vjsControls.hide()},g.prototype.onAdBreakEnd=function(){this.vjsControls.show()},g.prototype.reset=function(){this.vjsControls.show()};var _=`TXXX`,v=function(e){this.daiController=e,this.streamPlayer=null,this.vjsPlayer=null,this.streamManager=null,this.uiSettings=new google.ima.dai.api.UiSettings,this.isAdBreak=!1,this.isSnapback=!1,this.snapForwardTime=0,this.timedMetadata,this.metadataLoaded={},this.SOURCE_TYPES={hls:`application/x-mpegURL`,dash:`application/dash+xml`}};v.prototype.initImaDai=function(){var e=this;this.streamPlayer=this.daiController.getStreamPlayer(),this.vjsPlayer=this.daiController.getVjsPlayer(),this.createAdUiDiv(),this.daiController.getSettings().locale&&this.uiSettings.setLocale(this.daiController.getSettings().locale),this.streamManager=new google.ima.dai.api.StreamManager(this.streamPlayer,this.adUiDiv,this.uiSettings),this.streamPlayer.addEventListener(`pause`,this.onStreamPause),this.streamPlayer.addEventListener(`play`,this.onStreamPlay),[google.ima.dai.api.StreamEvent.Type.LOADED,google.ima.dai.api.StreamEvent.Type.ERROR,google.ima.dai.api.StreamEvent.Type.AD_BREAK_STARTED,google.ima.dai.api.StreamEvent.Type.AD_BREAK_ENDED].forEach(function(t){e.streamManager.addEventListener(t,e.onStreamEvent.bind(e))}),this.vjsPlayer.textTracks().onaddtrack=this.onAddTrack.bind(this),this.vjsPlayer.trigger({type:`stream-manager`,StreamManager:this.streamManager}),this.requestStream()},v.prototype.onAddTrack=function(e){var t=this,n=e.track;n.kind===`metadata`&&(n.mode=`hidden`,n.addEventListener(`cuechange`,function(e){var r=n.activeCues_||n.activeCues;if(r){var i=a(r),s;try{for(i.s();!(s=i.n()).done;){var c=s.value;c.value&&c.value.key===_&&t.streamManager.onTimedMetadata(o({},_,c.value.data))}}catch(e){i.e(e)}finally{i.f()}}}))},v.prototype.createAdUiDiv=function(){var e=document.createElement(`div`);e.id=`ad-ui`,e.style.height=`calc(100% - 3em)`,this.streamPlayer.parentNode.appendChild(e),this.adUiDiv=e},v.prototype.onStreamPause=function(){this.isAdBreak&&(this.adUiDiv.style.display=`none`)},v.prototype.onStreamPlay=function(){this.isAdBreak&&(this.adUiDiv.style.display=`block`)},v.prototype.onSeekEnd=function(e){if(this.daiController.getSettings().streamType!==`live`){if(this.isSnapback){this.isSnapback=!1;return}var t=this.streamManager.previousCuePointForStreamTime(e);t&&!t.played&&(this.isSnapback=!0,this.snapForwardTime=e,this.vjsPlayer.currentTime(t.start))}},v.prototype.onStreamEvent=function(e){switch(e.type){case google.ima.dai.api.StreamEvent.Type.LOADED:this.loadUrl(e.getStreamData().url);break;case google.ima.dai.api.StreamEvent.Type.ERROR:window.console.warn(`Error loading stream, attempting to play backup stream. `+e.getStreamData().errorMessage),this.daiController.onErrorLoadingAds(e),this.daiController.getSettings().fallbackStreamUrl&&this.loadUrl(this.daiController.getSettings().fallbackStreamUrl);break;case google.ima.dai.api.StreamEvent.Type.AD_BREAK_STARTED:this.isAdBreak=!0,this.adUiDiv.style.display=`block`,this.daiController.onAdBreakStart();break;case google.ima.dai.api.StreamEvent.Type.AD_BREAK_ENDED:this.isAdBreak=!1,this.adUiDiv.style.display=`none`,this.daiController.onAdBreakEnd(),this.snapForwardTime&&this.snapForwardTime>this.vjsPlayer.currentTime()&&(this.vjsPlayer.currentTime(this.snapForwardTime),this.snapForwardTime=0);break}},v.prototype.loadUrl=function(e){this.vjsPlayer.ready(function(){var t=this.daiController.getSettings().streamFormat;this.vjsPlayer.src({src:e,type:this.SOURCE_TYPES[t]});var n=this.daiController.getSettings().bookmarkTime;if(n){var r=this.streamManager.streamTimeForContentTime(n);this.isSnapback=!0,this.vjsPlayer.currentTime(r)}}.bind(this))},v.prototype.requestStream=function(){var e,t=this.daiController.getSettings().streamType;if(t===`vod`?(e=new google.ima.dai.api.VODStreamRequest,e.contentSourceId=this.daiController.getSettings().cmsId,e.videoId=this.daiController.getSettings().videoId):t===`live`?(e=new google.ima.dai.api.LiveStreamRequest,e.assetKey=this.daiController.getSettings().assetKey):window.console.warn(`No valid stream type selected`),e.format=this.daiController.getSettings().streamFormat,this.daiController.getSettings().apiKey&&(e.apiKey=this.daiController.getSettings().apiKey),this.daiController.getSettings().authToken&&(e.authToken=this.daiController.getSettings().authToken),this.daiController.getSettings().adTagParameters&&(e.adTagParameters=this.daiController.getSettings().adTagParameters),this.daiController.getSettings().streamActivityMonitorId&&(e.streamActivityMonitorId=this.daiController.getSettings().streamActivityMonitorId),this.daiController.getSettings().omidMode){e.omidAccessModeRules={};var n=this.daiController.getSettings().omidMode;n.FULL&&(e.omidAccessModeRules[google.ima.OmidAccessMode.FULL]=n.FULL),n.DOMAIN&&(e.omidAccessModeRules[google.ima.OmidAccessMode.DOMAIN]=n.DOMAIN),n.LIMITED&&(e.omidAccessModeRules[google.ima.OmidAccessMode.LIMITED]=n.LIMITED)}this.streamManager.requestStream(e),this.vjsPlayer.trigger({type:`stream-request`,StreamRequest:e})},v.prototype.onPlayerReady=function(){this.initImaDai()},v.prototype.onPlayerDisposed=function(){this.streamManager&&this.streamManager.reset()},v.prototype.addEventListener=function(e,t){this.streamManager&&this.streamManager.addEventListener(e,t)},v.prototype.getStreamManager=function(){return this.streamManager},v.prototype.reset=function(){this.streamManager&&this.streamManager.reset()};var y=function(e,t){this.inAdBreak=!1,this.settings={},this.isMobile=navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i),this.isIos=navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i),this.initWithSettings(t);var n={debug:this.settings.debug,timeout:this.settings.timeout,prerollTimeout:this.settings.prerollTimeout},r=Object.assign({},n,t.contribAdsSettings||{});this.playerWrapper=new g(e,r,this),this.sdkImpl=new v(this)};y.IMA_DEFAULTS={adLabel:`Advertisement`,adLabelNofN:`of`,debug:!1,disableAdControls:!1,showControlsForJSAds:!0},y.prototype.initWithSettings=function(e){this.settings=Object.assign({},y.IMA_DEFAULTS,e||{}),this.warnAboutDeprecatedSettings(),this.showCountdown=!0,this.settings.showCountdown===!1&&(this.showCountdown=!1)},y.prototype.warnAboutDeprecatedSettings=function(){var e=this;[].forEach(function(t){e.settings[t]!==void 0&&console.warn(`WARNING: videojs.imaDai setting `+t+` is deprecated`)})},y.prototype.getSettings=function(){return this.settings},y.prototype.getIsMobile=function(){return this.isMobile},y.prototype.getIsIos=function(){return this.isIos},y.prototype.getStreamPlayer=function(){return this.playerWrapper.getStreamPlayer()},y.prototype.getVjsPlayer=function(){return this.playerWrapper.getVjsPlayer()},y.prototype.requestStream=function(){this.sdkImpl.requestStream()},y.prototype.setSetting=function(e,t){this.settings[e]=t},y.prototype.onErrorLoadingAds=function(e){this.playerWrapper.onAdError(e)},y.prototype.onAdError=function(e){this.playerWrapper.onAdError(e)},y.prototype.onAdBreakStart=function(){this.inAdBreak=!0,this.playerWrapper.onAdBreakStart()},y.prototype.onAdBreakEnd=function(){this.inAdBreak=!1,this.playerWrapper.onAdBreakEnd()},y.prototype.onPlayerDisposed=function(){this.contentAndAdsEndedListeners=[],this.sdkImpl.onPlayerDisposed()},y.prototype.isInAdBreak=function(){return this.inAdBreak},y.prototype.onSeekEnd=function(e){this.sdkImpl.onSeekEnd(e)},y.prototype.onPlayerReady=function(){this.sdkImpl.onPlayerReady()},y.prototype.reset=function(){this.sdkImpl.reset(),this.playerWrapper.reset()},y.prototype.addEventListener=function(e,t){this.sdkImpl.addEventListener(e,t)},y.prototype.getStreamManager=function(){return this.sdkImpl.getStreamManager()},y.prototype.getPlayerId=function(){return this.playerWrapper.getPlayerId()},y.prototype.streamWillAutoplay=function(){return this.settings.streamWillAutoplay===void 0?!!this.playerWrapper.getPlayerOptions().autoplay:this.settings.streamWillAutoplay},y.prototype.triggerPlayerEvent=function(e,t){this.playerWrapper.triggerPlayerEvent(e,t)};var b=function(e,t){this.controller=new h(e,t),this.addContentAndAdsEndedListener=function(e){this.controller.addContentAndAdsEndedListener(e)}.bind(this),this.addContentEndedListener=function(e){this.controller.addContentEndedListener(e)}.bind(this),this.addEventListener=function(e,t){this.controller.addEventListener(e,t)}.bind(this),this.changeAdTag=function(e){this.controller.changeAdTag(e)}.bind(this),this.getAdsManager=function(){return this.controller.getAdsManager()}.bind(this),this.initializeAdDisplayContainer=function(){this.controller.initializeAdDisplayContainer()}.bind(this),this.pauseAd=function(){this.controller.pauseAd()}.bind(this),this.playAdBreak=function(){this.controller.playAdBreak()}.bind(this),this.requestAds=function(){this.controller.requestAds()}.bind(this),this.resumeAd=function(){this.controller.resumeAd()}.bind(this),this.setAdBreakReadyListener=function(e){this.controller.setAdBreakReadyListener(e)}.bind(this),this.setContentWithAdTag=function(e,t){this.controller.setContentWithAdTag(e,t)}.bind(this),this.setContentWithAdsResponse=function(e,t){this.controller.setContentWithAdsResponse(e,t)}.bind(this),this.setContentWithAdsRequest=function(e,t){this.controller.setContentWithAdsRequest(e,t)}.bind(this),this.setShowCountdown=function(e){this.controller.setShowCountdown(e)}.bind(this)},x=function(e,t){this.controller=new y(e,t),this.streamEndedListener=function(e){this.controller.addStreamEndedListener(e)}.bind(this),this.addEventListener=function(e,t){this.controller.addEventListener(e,t)}.bind(this),this.getStreamManager=function(){return this.controller.getStreamManager()}.bind(this)},S=function(e){this.ima=new b(this,e)},C=i(function e(t,n){if(r(this,e),t=t.toLowerCase(),t!==`hls`&&t!==`dash`){window.console.error(`VodStream error: incorrect streamFormat.`);return}else if(t===`dash`){window.console.error(`streamFormat error: DASH streams are notcurrently supported by this plugin.`);return}else if(typeof n!=`string`){window.console.error(`assetKey error: value must be string.`);return}this.streamFormat=t,this.assetKey=n}),w=i(function e(t,n,i){if(r(this,e),t=t.toLowerCase(),t!==`hls`&&t!==`dash`){window.console.error(`VodStream error: incorrect streamFormat.`);return}else if(t===`dash`){window.console.error(`streamFormat error: DASH streams are notcurrently supported by this plugin.`);return}else if(typeof n!=`string`){window.console.error(`cmsId error: value must be string.`);return}else if(typeof i!=`string`){window.console.error(`videoId error: value must be string.`);return}this.streamFormat=t,this.cmsId=n,this.videoId=i}),T=function(e,t){if(e instanceof C)t.streamType=`live`,t.assetKey=e.assetKey;else if(e instanceof w)t.streamType=`vod`,t.cmsId=e.cmsId,t.videoId=e.videoId;else{window.console.error(`initDai() first parameter must be an instance of LiveStream or VodStream.`);return}t.streamFormat=e.streamFormat,this.imaDai=new x(this,t)},E=t.registerPlugin||t.plugin;E(`ima`,S),E(`imaDai`,T),e.LiveStream=C,e.VodStream=w,e.default=b,Object.defineProperty(e,"__esModule",{value:!0})}))}));export default n();export{};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import{a as e,i as t,t as n}from"./video.cjs-gZWrkL0e.mjs";import{c as r,o as i,s as a,t as o}from"./tech-hIKMwrTq.mjs";var s=t(((e,t)=>{
|
|
2
|
+
/*! @vimeo/player v2.30.4 | (c) 2026 Vimeo | MIT License | https://github.com/vimeo/player.js */
|
|
3
|
+
(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self,n.Vimeo=n.Vimeo||{},n.Vimeo.Player=r())})(e,(function(){let e=typeof global<`u`&&{}.toString.call(global)===`[object global]`,t=typeof Bun<`u`,n=typeof Deno<`u`,r=typeof WebSocketPair==`function`&&caches?.default!==void 0,i=e||t||n||r;function a(e,t){return e.indexOf(t.toLowerCase())===0?e:`${t.toLowerCase()}${e.substr(0,1).toUpperCase()}${e.substr(1)}`}function o(e){return!!(e&&e.nodeType===1&&`nodeName`in e&&e.ownerDocument&&e.ownerDocument.defaultView)}function s(e){return!isNaN(parseFloat(e))&&isFinite(e)&&Math.floor(e)==e}function c(e){return/^(https?:)?\/\/((((player|www)\.)?vimeo\.com)|((player\.)?[a-zA-Z0-9-]+\.(videoji\.(hk|cn)|vimeo\.work)))(?=$|\/)/.test(e)}function l(e){return/^https:\/\/player\.((vimeo\.com)|([a-zA-Z0-9-]+\.(videoji\.(hk|cn)|vimeo\.work)))\/video\/\d+/.test(e)}function u(e){let t=(e||``).match(/^(?:https?:)?(?:\/\/)?([^/?]+)/),n=(t&&t[1]||``).replace(`player.`,``);for(let e of[`.videoji.hk`,`.vimeo.work`,`.videoji.cn`])if(n.endsWith(e))return n;return`vimeo.com`}function d(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.id,n=e.url,r=t||n;if(!r)throw Error(`An id or url must be passed, either in an options object or as a data-vimeo-id or data-vimeo-url attribute.`);if(s(r))return`https://vimeo.com/${r}`;if(c(r))return r.replace(`http:`,`https:`);throw TypeError(t?`“${t}” is not a valid video id.`:`“${r}” is not a vimeo.com url.`)}let f=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`addEventListener`,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:`removeEventListener`,a=typeof t==`string`?[t]:t;return a.forEach(t=>{e[r](t,n)}),{cancel:()=>a.forEach(t=>e[i](t,n))}};function p(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:document;if(!e||!t||typeof t.querySelectorAll!=`function`)return null;let n=t.querySelectorAll(`iframe`);for(let t=0;t<n.length;t++)if(n[t]&&n[t].contentWindow===e)return n[t];return null}let m=Array.prototype.indexOf!==void 0,h=typeof window<`u`&&window.postMessage!==void 0;if(!i&&(!m||!h))throw Error(`Sorry, the Vimeo Player API is not available in this browser.`);var g=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function _(e,t){return t={exports:{}},e(t,t.exports),t.exports}
|
|
4
|
+
/*!
|
|
5
|
+
* weakmap-polyfill v2.0.4 - ECMAScript6 WeakMap polyfill
|
|
6
|
+
* https://github.com/polygonplanet/weakmap-polyfill
|
|
7
|
+
* Copyright (c) 2015-2021 polygonplanet <polygon.planet.aqua@gmail.com>
|
|
8
|
+
* @license MIT
|
|
9
|
+
*/
|
|
10
|
+
(function(e){if(e.WeakMap)return;var t=Object.prototype.hasOwnProperty,n=Object.defineProperty&&function(){try{return Object.defineProperty({},"x",{value:1}).x===1}catch{}}(),r=function(e,t,r){n?Object.defineProperty(e,t,{configurable:!0,writable:!0,value:r}):e[t]=r};e.WeakMap=function(){function e(){if(this===void 0)throw TypeError(`Constructor WeakMap requires 'new'`);if(r(this,`_id`,a(`_WeakMap`)),arguments.length>0)throw TypeError(`WeakMap iterable is not supported`)}r(e.prototype,`delete`,function(e){if(n(this,`delete`),!i(e))return!1;var t=e[this._id];return t&&t[0]===e?(delete e[this._id],!0):!1}),r(e.prototype,`get`,function(e){if(n(this,`get`),i(e)){var t=e[this._id];if(t&&t[0]===e)return t[1]}}),r(e.prototype,`has`,function(e){if(n(this,`has`),!i(e))return!1;var t=e[this._id];return!!(t&&t[0]===e)}),r(e.prototype,`set`,function(e,t){if(n(this,`set`),!i(e))throw TypeError(`Invalid value used as weak map key`);var a=e[this._id];return a&&a[0]===e?(a[1]=t,this):(r(e,this._id,[e,t]),this)});function n(e,n){if(!i(e)||!t.call(e,`_id`))throw TypeError(n+` method called on incompatible receiver `+typeof e)}function a(e){return e+`_`+o()+`.`+o()}function o(){return Math.random().toString().substring(2)}return r(e,`_polyfill`,!0),e}();function i(e){return Object(e)===e}})(typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:g);var v=_(function(e){
|
|
11
|
+
/*! Native Promise Only
|
|
12
|
+
v0.8.1 (c) Kyle Simpson
|
|
13
|
+
MIT License: http://getify.mit-license.org
|
|
14
|
+
*/
|
|
15
|
+
(function(t,n,r){n[t]=n[t]||r(),e.exports&&=n[t]})(`Promise`,g,function(){var e,t,n,r=Object.prototype.toString,i=typeof setImmediate<`u`?function(e){return setImmediate(e)}:setTimeout;try{Object.defineProperty({},"x",{}),e=function(e,t,n,r){return Object.defineProperty(e,t,{value:n,writable:!0,configurable:r!==!1})}}catch{e=function(e,t,n){return e[t]=n,e}}n=function(){var e,n,r;function i(e,t){this.fn=e,this.self=t,this.next=void 0}return{add:function(t,a){r=new i(t,a),n?n.next=r:e=r,n=r,r=void 0},drain:function(){var r=e;for(e=n=t=void 0;r;)r.fn.call(r.self),r=r.next}}}();function a(e,r){n.add(e,r),t||=i(n.drain)}function o(e){var t,n=typeof e;return e!=null&&(n==`object`||n==`function`)&&(t=e.then),typeof t==`function`?t:!1}function s(){for(var e=0;e<this.chain.length;e++)c(this,this.state===1?this.chain[e].success:this.chain[e].failure,this.chain[e]);this.chain.length=0}function c(e,t,n){var r,i;try{t===!1?n.reject(e.msg):(r=t===!0?e.msg:t.call(void 0,e.msg),r===n.promise?n.reject(TypeError(`Promise-chain cycle`)):(i=o(r))?i.call(r,n.resolve,n.reject):n.resolve(r))}catch(e){n.reject(e)}}function l(e){var t,n=this;if(!n.triggered){n.triggered=!0,n.def&&(n=n.def);try{(t=o(e))?a(function(){var r=new f(n);try{t.call(e,function(){l.apply(r,arguments)},function(){u.apply(r,arguments)})}catch(e){u.call(r,e)}}):(n.msg=e,n.state=1,n.chain.length>0&&a(s,n))}catch(e){u.call(new f(n),e)}}}function u(e){var t=this;t.triggered||(t.triggered=!0,t.def&&(t=t.def),t.msg=e,t.state=2,t.chain.length>0&&a(s,t))}function d(e,t,n,r){for(var i=0;i<t.length;i++)(function(i){e.resolve(t[i]).then(function(e){n(i,e)},r)})(i)}function f(e){this.def=e,this.triggered=!1}function p(e){this.promise=e,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function m(e){if(typeof e!=`function`)throw TypeError(`Not a function`);if(this.__NPO__!==0)throw TypeError(`Not a promise`);this.__NPO__=1;var t=new p(this);this.then=function(e,n){var r={success:typeof e==`function`?e:!0,failure:typeof n==`function`?n:!1};return r.promise=new this.constructor(function(e,t){if(typeof e!=`function`||typeof t!=`function`)throw TypeError(`Not a function`);r.resolve=e,r.reject=t}),t.chain.push(r),t.state!==0&&a(s,t),r.promise},this.catch=function(e){return this.then(void 0,e)};try{e.call(void 0,function(e){l.call(t,e)},function(e){u.call(t,e)})}catch(e){u.call(t,e)}}var h=e({},`constructor`,m,!1);return m.prototype=h,e(h,`__NPO__`,0,!1),e(m,`resolve`,function(e){var t=this;return e&&typeof e==`object`&&e.__NPO__===1?e:new t(function(t,n){if(typeof t!=`function`||typeof n!=`function`)throw TypeError(`Not a function`);t(e)})}),e(m,`reject`,function(e){return new this(function(t,n){if(typeof t!=`function`||typeof n!=`function`)throw TypeError(`Not a function`);n(e)})}),e(m,`all`,function(e){var t=this;return r.call(e)==`[object Array]`?e.length===0?t.resolve([]):new t(function(n,r){if(typeof n!=`function`||typeof r!=`function`)throw TypeError(`Not a function`);var i=e.length,a=Array(i),o=0;d(t,e,function(e,t){a[e]=t,++o===i&&n(a)},r)}):t.reject(TypeError(`Not an array`))}),e(m,`race`,function(e){var t=this;return r.call(e)==`[object Array]`?new t(function(n,r){if(typeof n!=`function`||typeof r!=`function`)throw TypeError(`Not a function`);d(t,e,function(e,t){n(t)},r)}):t.reject(TypeError(`Not an array`))}),m})});let y=new WeakMap;function b(e,t,n){let r=y.get(e.element)||{};t in r||(r[t]=[]),r[t].push(n),y.set(e.element,r)}function x(e,t){return(y.get(e.element)||{})[t]||[]}function S(e,t,n){let r=y.get(e.element)||{};if(!r[t])return!0;if(!n)return r[t]=[],y.set(e.element,r),!0;let i=r[t].indexOf(n);return i!==-1&&r[t].splice(i,1),y.set(e.element,r),r[t]&&r[t].length===0}function C(e,t){let n=x(e,t);if(n.length<1)return!1;let r=n.shift();return S(e,t,r),r}function w(e,t){let n=y.get(e);y.set(t,n),y.delete(e)}function T(e){if(typeof e==`string`)try{e=JSON.parse(e)}catch(e){return console.warn(e),{}}return e}function E(e,t,n){if(!e.element.contentWindow||!e.element.contentWindow.postMessage)return;let r={method:t};n!==void 0&&(r.value=n);let i=parseFloat(navigator.userAgent.toLowerCase().replace(/^.*msie (\d+).*$/,`$1`));i>=8&&i<10&&(r=JSON.stringify(r)),e.element.contentWindow.postMessage(r,e.origin)}function D(e,t){t=T(t);let n=[],r;if(t.event)t.event===`error`&&x(e,t.data.method).forEach(n=>{let r=Error(t.data.message);r.name=t.data.name,n.reject(r),S(e,t.data.method,n)}),n=x(e,`event:${t.event}`),r=t.data;else if(t.method){let i=C(e,t.method);i&&(n.push(i),r=t.value)}n.forEach(t=>{try{if(typeof t==`function`){t.call(e,r);return}t.resolve(r)}catch{}})}let O=`airplay.audio_tracks.audiotrack.autopause.autoplay.background.byline.cc.chapter_id.chapters.chromecast.color.colors.controls.disable_context_menu.dnt.end_time.fullscreen.height.id.initial_quality.interactive_params.keyboard.loop.maxheight.max_quality.maxwidth.min_quality.muted.play_button_position.playsinline.portrait.preload.progress_bar.quality.quality_selector.responsive.skipping_forward.speed.start_time.texttrack.thumbnail_id.title.transcript.transparent.unmute_button.url.vimeo_logo.volume.watch_full_video.width`.split(`.`);function k(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return O.reduce((t,n)=>{let r=e.getAttribute(`data-vimeo-${n}`);return(r||r===``)&&(t[n]=r===``?1:r),t},t)}function A(e,t){let{html:n}=e;if(!t)throw TypeError(`An element must be provided`);if(t.getAttribute(`data-vimeo-initialized`)!==null)return t.querySelector(`iframe`);let r=document.createElement(`div`);return r.innerHTML=n,t.appendChild(r.firstChild),t.setAttribute(`data-vimeo-initialized`,`true`),t.querySelector(`iframe`)}function j(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return new Promise((r,i)=>{if(!c(e))throw TypeError(`“${e}” is not a vimeo.com url.`);let a=`https://${u(e)}/api/oembed.json?url=${encodeURIComponent(e)}`;for(let e in t)t.hasOwnProperty(e)&&(a+=`&${e}=${encodeURIComponent(t[e])}`);let o=`XDomainRequest`in window?new XDomainRequest:new XMLHttpRequest;o.open(`GET`,a,!0),o.onload=function(){if(o.status===404){i(Error(`“${e}” was not found.`));return}if(o.status===403){i(Error(`“${e}” is not embeddable.`));return}try{let t=JSON.parse(o.responseText);if(t.domain_status_code===403){A(t,n),i(Error(`“${e}” is not embeddable.`));return}r(t)}catch(e){i(e)}},o.onerror=function(){let e=o.status?` (${o.status})`:``;i(Error(`There was an error fetching the embed code from Vimeo${e}.`))},o.send()})}function M(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document,t=[].slice.call(e.querySelectorAll(`[data-vimeo-id], [data-vimeo-url]`)),n=e=>{`console`in window&&console.error&&console.error(`There was an error creating an embed: ${e}`)};t.forEach(e=>{try{if(e.getAttribute(`data-vimeo-defer`)!==null)return;let t=k(e);j(d(t),t,e).then(t=>A(t,e)).catch(n)}catch(e){n(e)}})}function N(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;window.VimeoPlayerResizeEmbeds_||(window.VimeoPlayerResizeEmbeds_=!0,window.addEventListener(`message`,t=>{if(!c(t.origin)||!t.data||t.data.event!==`spacechange`)return;let n=t.source?p(t.source,e):null;if(n){let e=n.parentElement;e.style.paddingBottom=`${t.data.data[0].bottom}px`}}))}function P(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;window.VimeoSeoMetadataAppended||(window.VimeoSeoMetadataAppended=!0,window.addEventListener(`message`,t=>{if(!c(t.origin))return;let n=T(t.data);if(!n||n.event!==`ready`)return;let r=t.source?p(t.source,e):null;r&&l(r.src)&&new U(r).callMethod(`appendVideoMetadata`,window.location.href)}))}function F(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;if(window.VimeoCheckedUrlTimeParam)return;window.VimeoCheckedUrlTimeParam=!0;let t=e=>{`console`in window&&console.error&&console.error(`There was an error getting video Id: ${e}`)};window.addEventListener(`message`,n=>{if(!c(n.origin))return;let r=T(n.data);if(!r||r.event!==`ready`)return;let i=n.source?p(n.source,e):null;if(i&&l(i.src)){let e=new U(i);e.getVideoId().then(t=>{let n=RegExp(`[?&]vimeo_t_${t}=([^&#]*)`).exec(window.location.href);if(n&&n[1]){let t=decodeURI(n[1]);e.setCurrentTime(t)}}).catch(t)}})}function I(){window.VimeoDRMEmbedsUpdated||(window.VimeoDRMEmbedsUpdated=!0,window.addEventListener(`message`,e=>{if(!c(e.origin))return;let t=T(e.data);if(!t||t.event!==`drminitfailed`)return;let n=e.source?p(e.source):null;if(!n)return;let r=n.getAttribute(`allow`)||``;if(!r.includes(`encrypted-media`)){n.setAttribute(`allow`,`${r}; encrypted-media`);let e=new URL(n.getAttribute(`src`));e.searchParams.set(`forcereload`,`drm`),n.setAttribute(`src`,e.toString());return}}))}function L(){let e=function(){let e,t=[[`requestFullscreen`,`exitFullscreen`,`fullscreenElement`,`fullscreenEnabled`,`fullscreenchange`,`fullscreenerror`],[`webkitRequestFullscreen`,`webkitExitFullscreen`,`webkitFullscreenElement`,`webkitFullscreenEnabled`,`webkitfullscreenchange`,`webkitfullscreenerror`],[`webkitRequestFullScreen`,`webkitCancelFullScreen`,`webkitCurrentFullScreenElement`,`webkitCancelFullScreen`,`webkitfullscreenchange`,`webkitfullscreenerror`],[`mozRequestFullScreen`,`mozCancelFullScreen`,`mozFullScreenElement`,`mozFullScreenEnabled`,`mozfullscreenchange`,`mozfullscreenerror`],[`msRequestFullscreen`,`msExitFullscreen`,`msFullscreenElement`,`msFullscreenEnabled`,`MSFullscreenChange`,`MSFullscreenError`]],n=0,r=t.length,i={};for(;n<r;n++)if(e=t[n],e&&e[1]in document){for(n=0;n<e.length;n++)i[t[0][n]]=e[n];return i}return!1}(),t={fullscreenchange:e.fullscreenchange,fullscreenerror:e.fullscreenerror},n={request(t){return new Promise((r,i)=>{let a=function(){n.off(`fullscreenchange`,a),r()};n.on(`fullscreenchange`,a),t||=document.documentElement;let o=t[e.requestFullscreen]();o instanceof Promise&&o.then(a).catch(i)})},exit(){return new Promise((t,r)=>{if(!n.isFullscreen){t();return}let i=function(){n.off(`fullscreenchange`,i),t()};n.on(`fullscreenchange`,i);let a=document[e.exitFullscreen]();a instanceof Promise&&a.then(i).catch(r)})},on(e,n){let r=t[e];r&&document.addEventListener(r,n)},off(e,n){let r=t[e];r&&document.removeEventListener(r,n)}};return Object.defineProperties(n,{isFullscreen:{get(){return!!document[e.fullscreenElement]}},element:{enumerable:!0,get(){return document[e.fullscreenElement]}},isEnabled:{enumerable:!0,get(){return!!document[e.fullscreenEnabled]}}}),n}let R={role:`viewer`,autoPlayMuted:!0,allowedDrift:.3,maxAllowedDrift:1,minCheckInterval:.1,maxRateAdjustment:.2,maxTimeToCatchUp:1};class z extends EventTarget{logger;constructor(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;super(),this.logger=r,this.init(t,e,{...R,...n})}disconnect(){this.dispatchEvent(new Event(`disconnect`))}async init(e,t,n){if(await this.waitForTOReadyState(e,`open`),n.role===`viewer`){await this.updatePlayer(e,t,n);let r=f(e,`change`,()=>this.updatePlayer(e,t,n)),i=this.maintainPlaybackPosition(e,t,n);this.addEventListener(`disconnect`,()=>{i.cancel(),r.cancel()})}else{await this.updateTimingObject(e,t);let n=f(t,[`seeked`,`play`,`pause`,`ratechange`],()=>this.updateTimingObject(e,t),`on`,`off`);this.addEventListener(`disconnect`,()=>n.cancel())}}async updateTimingObject(e,t){let[n,r,i]=await Promise.all([t.getCurrentTime(),t.getPaused(),t.getPlaybackRate()]);e.update({position:n,velocity:r?0:i})}async updatePlayer(e,t,n){let{position:r,velocity:i}=e.query();typeof r==`number`&&t.setCurrentTime(r),typeof i==`number`&&(i===0?await t.getPaused()===!1&&t.pause():i>0&&(await t.getPaused()===!0&&(await t.play().catch(async e=>{e.name===`NotAllowedError`&&n.autoPlayMuted&&(await t.setMuted(!0),await t.play().catch(e=>console.error(`Couldn't play the video from TimingSrcConnector. Error:`,e)))}),this.updatePlayer(e,t,n)),await t.getPlaybackRate()!==i&&t.setPlaybackRate(i)))}maintainPlaybackPosition(e,t,n){let{allowedDrift:r,maxAllowedDrift:i,minCheckInterval:a,maxRateAdjustment:o,maxTimeToCatchUp:s}=n,c=Math.min(s,Math.max(a,i))*1e3,l=async()=>{if(e.query().velocity===0||await t.getPaused()===!0)return;let n=e.query().position-await t.getCurrentTime(),a=Math.abs(n);if(this.log(`Drift: ${n}`),a>i)await this.adjustSpeed(t,0),t.setCurrentTime(e.query().position),this.log(`Resync by currentTime`);else if(a>r){let e=a/s,r=o,i=e<r?(r-e)/2:r;await this.adjustSpeed(t,i*Math.sign(n)),this.log(`Resync by playbackRate`)}},u=setInterval(()=>l(),c);return{cancel:()=>clearInterval(u)}}log(e){this.logger?.(`TimingSrcConnector: ${e}`)}speedAdjustment=0;adjustSpeed=async(e,t)=>{if(this.speedAdjustment===t)return;let n=await e.getPlaybackRate()-this.speedAdjustment+t;this.log(`New playbackRate: ${n}`),await e.setPlaybackRate(n),this.speedAdjustment=t};waitForTOReadyState(e,t){return new Promise(n=>{let r=()=>{e.readyState===t?n():e.addEventListener(`readystatechange`,r,{once:!0})};r()})}}let B=new WeakMap,V=new WeakMap,H={};class U{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(window.jQuery&&e instanceof jQuery&&(e.length>1&&window.console&&console.warn&&console.warn(`A jQuery object with multiple elements was passed, using the first element.`),e=e[0]),typeof document<`u`&&typeof e==`string`&&(e=document.getElementById(e)),!o(e))throw TypeError(`You must pass either a valid element or a valid id.`);if(e.nodeName!==`IFRAME`){let t=e.querySelector(`iframe`);t&&(e=t)}if(e.nodeName===`IFRAME`&&!c(e.getAttribute(`src`)||``))throw Error(`The player element passed isn’t a Vimeo embed.`);if(B.has(e))return B.get(e);this._window=e.ownerDocument.defaultView,this.element=e,this.origin=`*`;let n=new v((n,r)=>{if(this._onMessage=e=>{if(!c(e.origin)||this.element.contentWindow!==e.source)return;this.origin===`*`&&(this.origin=e.origin);let t=T(e.data);if(t&&t.event===`error`&&t.data&&t.data.method===`ready`){let e=Error(t.data.message);e.name=t.data.name,r(e);return}let i=t&&t.event===`ready`,a=t&&t.method===`ping`;if(i||a){this.element.setAttribute(`data-ready`,`true`),n();return}D(this,t)},this._window.addEventListener(`message`,this._onMessage),this.element.nodeName!==`IFRAME`){let n=k(e,t);j(d(n),n,e).then(t=>{let n=A(t,e);return this.element=n,this._originalElement=e,w(e,n),B.set(this.element,this),t}).catch(r)}});if(V.set(this,n),B.set(this.element,this),this.element.nodeName===`IFRAME`&&E(this,`ping`),H.isEnabled){let e=()=>H.exit();this.fullscreenchangeHandler=()=>{H.isFullscreen?b(this,`event:exitFullscreen`,e):S(this,`event:exitFullscreen`,e),this.ready().then(()=>{E(this,`fullscreenchange`,H.isFullscreen)})},H.on(`fullscreenchange`,this.fullscreenchangeHandler)}return this}static isVimeoUrl(e){return c(e)}callMethod(e){var t=[...arguments].slice(1);if(e==null)throw TypeError(`You must pass a method name.`);return new v((n,r)=>this.ready().then(()=>{b(this,e,{resolve:n,reject:r}),t.length===0?t={}:t.length===1&&(t=t[0]),E(this,e,t)}).catch(r))}get(e){return new v((t,n)=>(e=a(e,`get`),this.ready().then(()=>{b(this,e,{resolve:t,reject:n}),E(this,e)}).catch(n)))}set(e,t){return new v((n,r)=>{if(e=a(e,`set`),t==null)throw TypeError(`There must be a value to set.`);return this.ready().then(()=>{b(this,e,{resolve:n,reject:r}),E(this,e,t)}).catch(r)})}on(e,t){if(!e)throw TypeError(`You must pass an event name.`);if(!t)throw TypeError(`You must pass a callback function.`);if(typeof t!=`function`)throw TypeError(`The callback must be a function.`);x(this,`event:${e}`).length===0&&this.callMethod(`addEventListener`,e).catch(()=>{}),b(this,`event:${e}`,t)}off(e,t){if(!e)throw TypeError(`You must pass an event name.`);if(t&&typeof t!=`function`)throw TypeError(`The callback must be a function.`);S(this,`event:${e}`,t)&&this.callMethod(`removeEventListener`,e).catch(e=>{})}loadVideo(e){return this.callMethod(`loadVideo`,e)}ready(){let e=V.get(this)||new v((e,t)=>{t(Error(`Unknown player. Probably unloaded.`))});return v.resolve(e)}addCuePoint(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.callMethod(`addCuePoint`,{time:e,data:t})}removeCuePoint(e){return this.callMethod(`removeCuePoint`,e)}enableTextTrack(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e)throw TypeError(`You must pass a language.`);return this.callMethod(`enableTextTrack`,{language:e,kind:t,showing:n})}disableTextTrack(){return this.callMethod(`disableTextTrack`)}selectAudioTrack(e,t){if(!e)throw TypeError(`You must pass a language.`);return this.callMethod(`selectAudioTrack`,{language:e,kind:t})}selectDefaultAudioTrack(){return this.callMethod(`selectDefaultAudioTrack`)}pause(){return this.callMethod(`pause`)}play(){return this.callMethod(`play`)}requestFullscreen(){return H.isEnabled?H.request(this.element):this.callMethod(`requestFullscreen`)}exitFullscreen(){return H.isEnabled?H.exit():this.callMethod(`exitFullscreen`)}getFullscreen(){return H.isEnabled?v.resolve(H.isFullscreen):this.get(`fullscreen`)}requestPictureInPicture(){return this.callMethod(`requestPictureInPicture`)}exitPictureInPicture(){return this.callMethod(`exitPictureInPicture`)}getPictureInPicture(){return this.get(`pictureInPicture`)}remotePlaybackPrompt(){return this.callMethod(`remotePlaybackPrompt`)}unload(){return this.callMethod(`unload`)}destroy(){return new v(e=>{if(V.delete(this),B.delete(this.element),this._originalElement&&(B.delete(this._originalElement),this._originalElement.removeAttribute(`data-vimeo-initialized`)),this.element&&this.element.nodeName===`IFRAME`&&this.element.parentNode&&(this.element.parentNode.parentNode&&this._originalElement&&this._originalElement!==this.element.parentNode?this.element.parentNode.parentNode.removeChild(this.element.parentNode):this.element.parentNode.removeChild(this.element)),this.element&&this.element.nodeName===`DIV`&&this.element.parentNode){this.element.removeAttribute(`data-vimeo-initialized`);let e=this.element.querySelector(`iframe`);e&&e.parentNode&&(e.parentNode.parentNode&&this._originalElement&&this._originalElement!==e.parentNode?e.parentNode.parentNode.removeChild(e.parentNode):e.parentNode.removeChild(e))}this._window.removeEventListener(`message`,this._onMessage),H.isEnabled&&H.off(`fullscreenchange`,this.fullscreenchangeHandler),e()})}getAutopause(){return this.get(`autopause`)}setAutopause(e){return this.set(`autopause`,e)}getBuffered(){return this.get(`buffered`)}getCameraProps(){return this.get(`cameraProps`)}setCameraProps(e){return this.set(`cameraProps`,e)}getChapters(){return this.get(`chapters`)}getCurrentChapter(){return this.get(`currentChapter`)}getColor(){return this.get(`color`)}getColors(){return v.all([this.get(`colorOne`),this.get(`colorTwo`),this.get(`colorThree`),this.get(`colorFour`)])}setColor(e){return this.set(`color`,e)}setColors(e){if(!Array.isArray(e))return new v((e,t)=>t(TypeError(`Argument must be an array.`)));let t=new v(e=>e(null)),n=[e[0]?this.set(`colorOne`,e[0]):t,e[1]?this.set(`colorTwo`,e[1]):t,e[2]?this.set(`colorThree`,e[2]):t,e[3]?this.set(`colorFour`,e[3]):t];return v.all(n)}getCuePoints(){return this.get(`cuePoints`)}getCurrentTime(){return this.get(`currentTime`)}setCurrentTime(e){return this.set(`currentTime`,e)}getDuration(){return this.get(`duration`)}getEnded(){return this.get(`ended`)}getLoop(){return this.get(`loop`)}setLoop(e){return this.set(`loop`,e)}setMuted(e){return this.set(`muted`,e)}getMuted(){return this.get(`muted`)}getPaused(){return this.get(`paused`)}getPlaybackRate(){return this.get(`playbackRate`)}setPlaybackRate(e){return this.set(`playbackRate`,e)}getPlayed(){return this.get(`played`)}getQualities(){return this.get(`qualities`)}getQuality(){return this.get(`quality`)}setQuality(e){return this.set(`quality`,e)}getRemotePlaybackAvailability(){return this.get(`remotePlaybackAvailability`)}getRemotePlaybackState(){return this.get(`remotePlaybackState`)}getSeekable(){return this.get(`seekable`)}getSeeking(){return this.get(`seeking`)}getTextTracks(){return this.get(`textTracks`)}getAudioTracks(){return this.get(`audioTracks`)}getEnabledAudioTrack(){return this.get(`enabledAudioTrack`)}getDefaultAudioTrack(){return this.get(`defaultAudioTrack`)}getVideoEmbedCode(){return this.get(`videoEmbedCode`)}getVideoId(){return this.get(`videoId`)}getVideoTitle(){return this.get(`videoTitle`)}getVideoWidth(){return this.get(`videoWidth`)}getVideoHeight(){return this.get(`videoHeight`)}getVideoUrl(){return this.get(`videoUrl`)}getVolume(){return this.get(`volume`)}setVolume(e){return this.set(`volume`,e)}async setTimingSrc(e,t){if(!e)throw TypeError(`A Timing Object must be provided.`);await this.ready();let n=new z(this,e,t);return E(this,`notifyTimingObjectConnect`),n.addEventListener(`disconnect`,()=>E(this,`notifyTimingObjectDisconnect`)),n}}return i||(H=L(),M(),N(),P(),F(),I()),U}))})),c=e(n(),1),l=e(s(),1);const u=c.default.getTech(`Tech`);var d=class e extends u{constructor(e,t){super(e,t),this._currentTime=0,this._duration=0,this._volume=1,this._muted=!1,this._paused=!0,this._seeking=!1,this.setSrc(this.options_.source,!0),this.setTimeout(()=>{this.el_&&(this.el_.parentNode.classList.add(`vjs-vimeo`),this.initVimeoPlayer())})}createEl(){let e=document.createElement(`div`);e.setAttribute(`id`,this.options_.techId),e.setAttribute(`style`,`width:100%;height:100%;top:0;left:0;position:absolute`),e.setAttribute(`class`,`vjs-tech`);let t=document.createElement(`div`);return t.appendChild(e),t}initVimeoPlayer(){if(!this.url||!this.url.videoId)return;let e={id:this.url.videoId,byline:!1,portrait:!1,title:!1,transparent:!0,controls:!!this.options_.nativeUi,autopause:!1,width:`100%`,height:`100%`};this.options_.autoplay!==void 0&&(e.autoplay=this.options_.autoplay),this.options_.loop!==void 0&&(e.loop=this.options_.loop),this.options_.muted!==void 0&&(e.muted=this.options_.muted),this.vimeoPlayer=new l.default(this.options_.techId,e),this.vimeoPlayer.ready().then(()=>this.onPlayerReady()).catch(e=>{this.player_.error({code:4,message:e?.message||`This video is unavailable or cannot be embedded here.`})}),this.vimeoPlayer.on(`play`,()=>{this._paused=!1,this.trigger(`play`),this.trigger(`playing`)}),this.vimeoPlayer.on(`pause`,()=>{this._paused=!0,this.trigger(`pause`)}),this.vimeoPlayer.on(`ended`,()=>{this._paused=!0,this.trigger(`ended`)}),this.vimeoPlayer.on(`timeupdate`,({seconds:e,duration:t})=>{this._currentTime=e,this._duration=t,this.trigger(`timeupdate`),t&&!this._durationSet&&(this._durationSet=!0,this.trigger(`durationchange`))}),this.vimeoPlayer.on(`loaded`,()=>{this._durationSet=!1,this.trigger(`loadedmetadata`),this.trigger(`durationchange`)}),this.vimeoPlayer.on(`seeking`,({seconds:e})=>{this._currentTime=e,this._seeking=!0,this.trigger(`seeking`)}),this.vimeoPlayer.on(`seeked`,({seconds:e})=>{this._currentTime=e,this._seeking=!1,this.trigger(`seeked`),this.trigger(`timeupdate`)}),this.vimeoPlayer.on(`bufferstart`,()=>this.trigger(`waiting`)),this.vimeoPlayer.on(`bufferend`,()=>this.trigger(`canplay`)),this.vimeoPlayer.on(`volumechange`,({volume:e})=>{this._volume=e,this.trigger(`volumechange`)}),this.vimeoPlayer.on(`error`,e=>this.trigger(`error`,e)),this.vimeoPlayer.on(`fullscreenchange`,({fullscreen:e})=>{this.trigger(`fullscreenchange`,{isFullscreen:e})})}enterFullscreen(){a(this.player_.el().parentElement)}exitFullscreen(){o()}onPlayerReady(){this.triggerReady(),this.options_.muted&&this.vimeoPlayer.setMuted(!0),this.playOnReady&&this.play()}setSrc(t){!t||!t.src||(this.source=t,this.url=e.parseUrl(t.src),this.options_.autoplay&&(this.playOnReady=!0))}play(){if(!this.vimeoPlayer){this.playOnReady=!0;return}this.vimeoPlayer.play().catch(()=>{})}pause(){this.vimeoPlayer?.pause().catch(()=>{})}paused(){return this._paused}seeking(){return this._seeking}currentTime(){return this._currentTime}setCurrentTime(e){this.vimeoPlayer?.setCurrentTime(e).catch(()=>{}),this.trigger(`timeupdate`),this.trigger(`seeking`)}duration(){return this._duration}volume(){return this._volume}setVolume(e){this._volume=e,this.vimeoPlayer?.setVolume(e).catch(()=>{})}muted(){return this._muted}setMuted(e){this._muted=e,this.vimeoPlayer?.setMuted(e).then(()=>{this.setTimeout(()=>this.trigger(`volumechange`),50)}).catch(()=>{})}buffered(){return c.default.createTimeRange(0,this._currentTime)}seekable(){return c.default.createTimeRange(0,this._duration)}playbackRate(){return this._playbackRate||1}setPlaybackRate(e){this._playbackRate=e,this.vimeoPlayer?.setPlaybackRate(e).catch(()=>{}),this.trigger(`ratechange`)}preload(){}load(){}reset(){}currentSrc(){return this.source?.src||``}ended(){return!1}networkState(){return+!!this.vimeoPlayer}readyState(){return this.vimeoPlayer?4:0}supportsFullScreen(){return r()}dispose(){this.vimeoPlayer?.destroy().catch(()=>{}),this.vimeoPlayer=null,this.el_?.parentNode?.classList.remove(`vjs-vimeo`),u.prototype.dispose.call(this)}};d.isSupported=()=>!0,d.canPlayType=e=>e===`video/vimeo`?`probably`:``,d.canPlaySource=({type:e,src:t})=>e===`video/vimeo`?`probably`:/vimeo\.com|player\.vimeo\.com/.test(t)?`maybe`:``,d.parseUrl=e=>{let t={videoId:null},n=e.match(/(?:vimeo\.com\/(?:video\/|channels\/[^/]+\/|groups\/[^/]+\/videos\/)?|player\.vimeo\.com\/video\/)(\d+)/);return n&&(t.videoId=n[1]),t},i(`Vimeo`,d);export{d as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as e,o as t,s as n,t as r}from"./tech-DYVa4zaY.mjs";import i from"video.js";import a from"@vimeo/player";const o=i.getTech(`Tech`);var s=class t extends o{constructor(e,t){super(e,t),this._currentTime=0,this._duration=0,this._volume=1,this._muted=!1,this._paused=!0,this._seeking=!1,this.setSrc(this.options_.source,!0),this.setTimeout(()=>{this.el_&&(this.el_.parentNode.classList.add(`vjs-vimeo`),this.initVimeoPlayer())})}createEl(){let e=document.createElement(`div`);e.setAttribute(`id`,this.options_.techId),e.setAttribute(`style`,`width:100%;height:100%;top:0;left:0;position:absolute`),e.setAttribute(`class`,`vjs-tech`);let t=document.createElement(`div`);return t.appendChild(e),t}initVimeoPlayer(){if(!this.url||!this.url.videoId)return;let e={id:this.url.videoId,byline:!1,portrait:!1,title:!1,transparent:!0,controls:!!this.options_.nativeUi,autopause:!1,width:`100%`,height:`100%`};this.options_.autoplay!==void 0&&(e.autoplay=this.options_.autoplay),this.options_.loop!==void 0&&(e.loop=this.options_.loop),this.options_.muted!==void 0&&(e.muted=this.options_.muted),this.vimeoPlayer=new a(this.options_.techId,e),this.vimeoPlayer.ready().then(()=>this.onPlayerReady()).catch(e=>{this.player_.error({code:4,message:e?.message||`This video is unavailable or cannot be embedded here.`})}),this.vimeoPlayer.on(`play`,()=>{this._paused=!1,this.trigger(`play`),this.trigger(`playing`)}),this.vimeoPlayer.on(`pause`,()=>{this._paused=!0,this.trigger(`pause`)}),this.vimeoPlayer.on(`ended`,()=>{this._paused=!0,this.trigger(`ended`)}),this.vimeoPlayer.on(`timeupdate`,({seconds:e,duration:t})=>{this._currentTime=e,this._duration=t,this.trigger(`timeupdate`),t&&!this._durationSet&&(this._durationSet=!0,this.trigger(`durationchange`))}),this.vimeoPlayer.on(`loaded`,()=>{this._durationSet=!1,this.trigger(`loadedmetadata`),this.trigger(`durationchange`)}),this.vimeoPlayer.on(`seeking`,({seconds:e})=>{this._currentTime=e,this._seeking=!0,this.trigger(`seeking`)}),this.vimeoPlayer.on(`seeked`,({seconds:e})=>{this._currentTime=e,this._seeking=!1,this.trigger(`seeked`),this.trigger(`timeupdate`)}),this.vimeoPlayer.on(`bufferstart`,()=>this.trigger(`waiting`)),this.vimeoPlayer.on(`bufferend`,()=>this.trigger(`canplay`)),this.vimeoPlayer.on(`volumechange`,({volume:e})=>{this._volume=e,this.trigger(`volumechange`)}),this.vimeoPlayer.on(`error`,e=>this.trigger(`error`,e)),this.vimeoPlayer.on(`fullscreenchange`,({fullscreen:e})=>{this.trigger(`fullscreenchange`,{isFullscreen:e})})}enterFullscreen(){n(this.player_.el().parentElement)}exitFullscreen(){r()}onPlayerReady(){this.triggerReady(),this.options_.muted&&this.vimeoPlayer.setMuted(!0),this.playOnReady&&this.play()}setSrc(e){!e||!e.src||(this.source=e,this.url=t.parseUrl(e.src),this.options_.autoplay&&(this.playOnReady=!0))}play(){if(!this.vimeoPlayer){this.playOnReady=!0;return}this.vimeoPlayer.play().catch(()=>{})}pause(){this.vimeoPlayer?.pause().catch(()=>{})}paused(){return this._paused}seeking(){return this._seeking}currentTime(){return this._currentTime}setCurrentTime(e){this.vimeoPlayer?.setCurrentTime(e).catch(()=>{}),this.trigger(`timeupdate`),this.trigger(`seeking`)}duration(){return this._duration}volume(){return this._volume}setVolume(e){this._volume=e,this.vimeoPlayer?.setVolume(e).catch(()=>{})}muted(){return this._muted}setMuted(e){this._muted=e,this.vimeoPlayer?.setMuted(e).then(()=>{this.setTimeout(()=>this.trigger(`volumechange`),50)}).catch(()=>{})}buffered(){return i.createTimeRange(0,this._currentTime)}seekable(){return i.createTimeRange(0,this._duration)}playbackRate(){return this._playbackRate||1}setPlaybackRate(e){this._playbackRate=e,this.vimeoPlayer?.setPlaybackRate(e).catch(()=>{}),this.trigger(`ratechange`)}preload(){}load(){}reset(){}currentSrc(){return this.source?.src||``}ended(){return!1}networkState(){return+!!this.vimeoPlayer}readyState(){return this.vimeoPlayer?4:0}supportsFullScreen(){return e()}dispose(){this.vimeoPlayer?.destroy().catch(()=>{}),this.vimeoPlayer=null,this.el_?.parentNode?.classList.remove(`vjs-vimeo`),o.prototype.dispose.call(this)}};s.isSupported=()=>!0,s.canPlayType=e=>e===`video/vimeo`?`probably`:``,s.canPlaySource=({type:e,src:t})=>e===`video/vimeo`?`probably`:/vimeo\.com|player\.vimeo\.com/.test(t)?`maybe`:``,s.parseUrl=e=>{let t={videoId:null},n=e.match(/(?:vimeo\.com\/(?:video\/|channels\/[^/]+\/|groups\/[^/]+\/videos\/)?|player\.vimeo\.com\/video\/)(\d+)/);return n&&(t.videoId=n[1]),t},t(`Vimeo`,s);export{s as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as e,o as t,r as n,s as r,t as i}from"./tech-DYVa4zaY.mjs";import{a,i as o}from"./constants-DZGeSme4.mjs";import{t as s}from"./loadScript-Du6JsTc2.mjs";import c from"video.js";const l=c.getTech(`Tech`),u=c.browser.IS_IOS||c.browser.IS_NATIVE_ANDROID;var d=class t extends l{constructor(e,n){super(e,n),this.setPoster(e.poster),this.setSrc(this.options_.source),this.setTimeout(()=>{this.el_&&(this.el_.parentNode.classList.add(`vjs-youtube`),u&&this.el_.parentNode.classList.add(`vjs-youtube-mobile`),t.isApiReady?this.initYTPlayer():t.apiReadyQueue.push(this))})}createEl(){let e=document.createElement(`div`);e.setAttribute(`id`,this.options_.techId),e.setAttribute(`style`,`width:100%;height:100%;top:0;left:0;position:absolute`),e.setAttribute(`class`,`vjs-tech`);let t=document.createElement(`div`);if(t.appendChild(e),!u&&!this.options_.nativeUi&&!this.options_.ytControls){let e=document.createElement(`div`);e.setAttribute(`class`,`vjs-iframe-blocker`),e.setAttribute(`style`,`position:absolute;top:0;left:0;width:100%;height:100%`),e.onclick=()=>this.pause(),t.appendChild(e)}return t}initYTPlayer(){let e=this.options_,t={controls:+!!e.nativeUi,modestbranding:1,rel:0,showinfo:0,mute:+!!e.muted,loop:+!!e.loop,origin:window.location.origin,allowfullscreen:1,fullscreen:1,fs:1,...e.iv_load_policy!==void 0&&{iv_load_policy:e.iv_load_policy},...e.cc_load_policy!==void 0&&{cc_load_policy:e.cc_load_policy},...e.color!==void 0&&{color:e.color},...e.hl!==void 0&&{hl:e.hl},...e.playsinline!==void 0&&{playsinline:e.playsinline},...e.rel!==void 0&&{rel:e.rel},...e.start!==void 0&&{start:e.start},...e.end!==void 0&&{end:e.end},...e.ytControls!==void 0&&{controls:e.ytControls},...e.customVars};e.youtube&&Object.assign(t,e.youtube),this.activeVideoId=this.url?.videoId??null,this.ytPlayer=new window.YT.Player(this.options_.techId,{videoId:this.activeVideoId,playerVars:t,...e.enablePrivacyEnhancedMode&&{host:`https://www.youtube-nocookie.com`},events:{onReady:this.onPlayerReady.bind(this),onStateChange:this.onPlayerStateChange.bind(this),onPlaybackRateChange:this.onPlayerPlaybackRateChange.bind(this),onVolumeChange:this.onPlayerVolumeChange.bind(this),onError:this.onPlayerError.bind(this)}}),window.yt=this.ytPlayer}onPlayerReady(){this.ytPlayer.getAvailablePlaybackRates().length>1&&(this.featuresPlaybackRate=!0),this.playerReady_=!0,this.triggerReady(),this.playOnReady?this.play():this.cueOnReady&&(this.cueVideoById_(this.url.videoId),this.activeVideoId=this.url.videoId)}_isAdPlaying(){try{let e=this.ytPlayer?.getPlayerResponse()?.adPlacements;return Array.isArray(e)&&e.length>0}catch{return!1}}onPlayerStateChange(e){let t=e.data;if(t===this.lastState||this.errorNumber)return;this.lastState=t;let n=this._isAdPlaying();switch(n!==this._adWasPlaying&&(this._adWasPlaying=n,this.trigger(n?`adstart`:`adend`)),t){case-1:this.trigger(`loadstart`),this.trigger(`loadedmetadata`),this.trigger(`durationchange`),this.trigger(`ratechange`);break;case YT.PlayerState.ENDED:this.trigger(`ended`);break;case YT.PlayerState.PLAYING:this.trigger(`timeupdate`),this.trigger(`durationchange`),this.trigger(`playing`),this.trigger(`play`),this.isSeeking&&this.onSeeked();break;case YT.PlayerState.PAUSED:this.trigger(`canplay`),this.isSeeking||this.trigger(`pause`);break;case YT.PlayerState.BUFFERING:this.player_.trigger(`waiting`);break;case YT.PlayerState.CUED:this.trigger(`canplay`);break}this.startInterval&&=(clearInterval(this.startInterval),null),t===YT.PlayerState.PLAYING&&(this.startInterval=setInterval(()=>this.trigger(`timeupdate`),250))}onPlayerPlaybackRateChange(){this.trigger(`ratechange`)}onPlayerVolumeChange(){this.trigger(`volumechange`)}onPlayerError(e){this.errorNumber=e.data,this.trigger(`error`),this.setTimeout(()=>{this.errorNumber=null},0)}play(){this.url?.videoId&&(this.wasPausedBeforeSeek=!1,this.isReady_?this.activeVideoId===this.url.videoId?this.ytPlayer.playVideo():(this.loadVideoById_(this.url.videoId),this.activeVideoId=this.url.videoId):(this.trigger(`waiting`),this.playOnReady=!0))}pause(){this.ytPlayer?.pauseVideo()}paused(){return this.ytPlayer?this.lastState!==YT.PlayerState.PLAYING&&this.lastState!==YT.PlayerState.BUFFERING:!0}loadVideoById_(e){this.ytPlayer.loadVideoById({videoId:e})}cueVideoById_(e){this.ytPlayer.cueVideoById({videoId:e})}currentTime(){return this.ytPlayer?.getCurrentTime()??0}setCurrentTime(e){this.lastState===YT.PlayerState.PAUSED&&(this.timeBeforeSeek=this.currentTime()),this.isSeeking||(this.wasPausedBeforeSeek=this.paused()),this.ytPlayer.seekTo(e,!0),this.trigger(`timeupdate`),this.trigger(`seeking`),this.isSeeking=!0,this.lastState===YT.PlayerState.PAUSED&&this.timeBeforeSeek!==e&&(clearInterval(this.checkSeekedInPauseInterval),this.checkSeekedInPauseInterval=setInterval(()=>{this.lastState!==YT.PlayerState.PAUSED||!this.isSeeking?clearInterval(this.checkSeekedInPauseInterval):this.currentTime()!==this.timeBeforeSeek&&(this.trigger(`timeupdate`),this.onSeeked())},250))}onSeeked(){clearInterval(this.checkSeekedInPauseInterval),this.isSeeking=!1,this.wasPausedBeforeSeek&&this.pause(),this.trigger(`seeked`)}seeking(){return this.isSeeking}seekable(){return c.createTimeRange(0,this.ytPlayer?.getDuration()??0)}duration(){return this.ytPlayer?.getDuration()??0}ended(){return this.ytPlayer?this.lastState===YT.PlayerState.ENDED:!1}volume(){return this.ytPlayer?this.ytPlayer.getVolume()/100:1}setVolume(e){this.ytPlayer?.setVolume(e*100)}muted(){return this.ytPlayer?.isMuted()??!1}setMuted(e){this.ytPlayer&&(e?this.ytPlayer.mute():this.ytPlayer.unMute(),this.setTimeout(()=>this.trigger(`volumechange`),50))}buffered(){return this.ytPlayer?.getVideoLoadedFraction?c.createTimeRange(0,this.ytPlayer.getVideoLoadedFraction()*this.ytPlayer.getDuration()):c.createTimeRange()}playbackRate(){return this.ytPlayer?.getPlaybackRate()??1}setPlaybackRate(e){this.ytPlayer?.setPlaybackRate(e)}currentSrc(){return this.source?.src??``}preload(){}load(){}reset(){}networkState(){if(!this.ytPlayer)return 0;switch(this.ytPlayer.getPlayerState()){case-1:return 0;case 3:return 2;default:return 1}}readyState(){if(!this.ytPlayer)return 0;switch(this.ytPlayer.getPlayerState()){case-1:return 0;case 5:return 1;case 3:return 2;default:return 4}}supportsFullScreen(){return e()}setSrc(e){e?.src&&(this.source=e,this.url=t.parseUrl(e.src),!this.options_.poster&&this.url.videoId&&(this.poster_=`https://img.youtube.com/vi/${this.url.videoId}/0.jpg`,this.setTimeout(()=>{this.trigger(`posterchange`),this.checkHighResPoster()},0)),this.options_.autoplay?this.isReady_?this.play():this.playOnReady=!0:this.activeVideoId!==this.url.videoId&&(this.isReady_?(this.cueVideoById_(this.url.videoId),this.activeVideoId=this.url.videoId):this.cueOnReady=!0))}poster(){return u?null:this.poster_}setPoster(e){this.poster_=e}autoplay(){return this.options_.autoplay}setAutoplay(e){this.options_.autoplay=e}loop(){return this.options_.loop}setLoop(e){this.options_.loop=e}checkHighResPoster(){let e=`https://img.youtube.com/vi/${this.url.videoId}/maxresdefault.jpg`,t=new Image;t.onload=()=>{(t.naturalHeight||t.height)<=90||(this.poster_=e,this.trigger(`posterchange`))},t.src=e}enterFullscreen(){if(n()&&this.ytPlayer){this._spawnIosFullscreen();return}r(this.player_.el().parentElement)}exitFullscreen(){i()}_spawnIosFullscreen(){let e=this.ytPlayer,t=e.getCurrentTime(),{video_id:n}=e.getVideoData();e.pauseVideo(),this.player_.trigger(o);let r=document.createElement(`div`);r.style.cssText=`position:fixed;inset:0;z-index:99999;opacity:0;pointer-events:none`,document.body.appendChild(r);let i=document.createElement(`div`);i.id=`yt-fs-${Date.now()}`,r.appendChild(i);let s=null,c=!1,l=()=>{if(c)return;c=!0,this.player_.trigger(a);let n=s?s.getCurrentTime():t;try{s?.destroy()}catch{}r.remove(),e.seekTo(n,!0),this.trigger(`timeupdate`)};s=new window.YT.Player(i.id,{videoId:n,playerVars:{playsinline:0,autoplay:1,controls:1,modestbranding:1,rel:0,start:Math.floor(t)},events:{onReady:e=>{this.player_.trigger(a),e.target.seekTo(t,!0),e.target.playVideo()},onStateChange:e=>{(e.data===window.YT.PlayerState.PAUSED||e.data===window.YT.PlayerState.ENDED)&&l()}}})}dispose(){clearInterval(this.startInterval),this.ytPlayer?(this.ytPlayer.stopVideo?.(),this.ytPlayer.destroy?.()):t.apiReadyQueue=t.apiReadyQueue.filter(e=>e!==this),this.ytPlayer=null,this.el_?.parentNode?.classList.remove(`vjs-youtube`,`vjs-youtube-mobile`),l.prototype.dispose.call(this)}};d.isApiReady=!1,d.apiReadyQueue=[],d.isSupported=()=>!0,d.canPlayType=e=>e===`video/youtube`?`probably`:``,d.canPlaySource=({type:e,src:t})=>e===`video/youtube`?`probably`:/youtu\.be|youtube\.com/.test(t)?`maybe`:``,d.parseUrl=e=>{let t={videoId:null,listId:null},n=e.match(/^.*(youtu\.be\/|v\/|u\/\w\/|embed\/|watch\?v=|shorts\/|&v=)([^#&?]*).*/);n?.[2]?.length===11&&(t.videoId=n[2]);let r=e.match(/[?&]list=([^#&?]+)/);return r?.[1]&&(t.listId=r[1]),t},typeof document<`u`&&s(`https://www.youtube.com/iframe_api`).then(()=>{window.YT.ready(()=>{d.isApiReady=!0,d.apiReadyQueue.forEach(e=>e.initYTPlayer()),d.apiReadyQueue=[]})}),t(`Youtube`,d);export{d as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,t}from"./video.cjs-gZWrkL0e.mjs";import{c as n,o as r,r as i,s as a,t as o}from"./tech-hIKMwrTq.mjs";import{a as s,i as c}from"./constants-DZGeSme4.mjs";import{t as l}from"./loadScript-Du6JsTc2.mjs";var u=e(t(),1);const d=u.default.getTech(`Tech`),f=u.default.browser.IS_IOS||u.default.browser.IS_NATIVE_ANDROID;var p=class e extends d{constructor(t,n){super(t,n),this.setPoster(t.poster),this.setSrc(this.options_.source),this.setTimeout(()=>{this.el_&&(this.el_.parentNode.classList.add(`vjs-youtube`),f&&this.el_.parentNode.classList.add(`vjs-youtube-mobile`),e.isApiReady?this.initYTPlayer():e.apiReadyQueue.push(this))})}createEl(){let e=document.createElement(`div`);e.setAttribute(`id`,this.options_.techId),e.setAttribute(`style`,`width:100%;height:100%;top:0;left:0;position:absolute`),e.setAttribute(`class`,`vjs-tech`);let t=document.createElement(`div`);if(t.appendChild(e),!f&&!this.options_.nativeUi&&!this.options_.ytControls){let e=document.createElement(`div`);e.setAttribute(`class`,`vjs-iframe-blocker`),e.setAttribute(`style`,`position:absolute;top:0;left:0;width:100%;height:100%`),e.onclick=()=>this.pause(),t.appendChild(e)}return t}initYTPlayer(){let e=this.options_,t={controls:+!!e.nativeUi,modestbranding:1,rel:0,showinfo:0,mute:+!!e.muted,loop:+!!e.loop,origin:window.location.origin,allowfullscreen:1,fullscreen:1,fs:1,...e.iv_load_policy!==void 0&&{iv_load_policy:e.iv_load_policy},...e.cc_load_policy!==void 0&&{cc_load_policy:e.cc_load_policy},...e.color!==void 0&&{color:e.color},...e.hl!==void 0&&{hl:e.hl},...e.playsinline!==void 0&&{playsinline:e.playsinline},...e.rel!==void 0&&{rel:e.rel},...e.start!==void 0&&{start:e.start},...e.end!==void 0&&{end:e.end},...e.ytControls!==void 0&&{controls:e.ytControls},...e.customVars};e.youtube&&Object.assign(t,e.youtube),this.activeVideoId=this.url?.videoId??null,this.ytPlayer=new window.YT.Player(this.options_.techId,{videoId:this.activeVideoId,playerVars:t,...e.enablePrivacyEnhancedMode&&{host:`https://www.youtube-nocookie.com`},events:{onReady:this.onPlayerReady.bind(this),onStateChange:this.onPlayerStateChange.bind(this),onPlaybackRateChange:this.onPlayerPlaybackRateChange.bind(this),onVolumeChange:this.onPlayerVolumeChange.bind(this),onError:this.onPlayerError.bind(this)}}),window.yt=this.ytPlayer}onPlayerReady(){this.ytPlayer.getAvailablePlaybackRates().length>1&&(this.featuresPlaybackRate=!0),this.playerReady_=!0,this.triggerReady(),this.playOnReady?this.play():this.cueOnReady&&(this.cueVideoById_(this.url.videoId),this.activeVideoId=this.url.videoId)}_isAdPlaying(){try{let e=this.ytPlayer?.getPlayerResponse()?.adPlacements;return Array.isArray(e)&&e.length>0}catch{return!1}}onPlayerStateChange(e){let t=e.data;if(t===this.lastState||this.errorNumber)return;this.lastState=t;let n=this._isAdPlaying();switch(n!==this._adWasPlaying&&(this._adWasPlaying=n,this.trigger(n?`adstart`:`adend`)),t){case-1:this.trigger(`loadstart`),this.trigger(`loadedmetadata`),this.trigger(`durationchange`),this.trigger(`ratechange`);break;case YT.PlayerState.ENDED:this.trigger(`ended`);break;case YT.PlayerState.PLAYING:this.trigger(`timeupdate`),this.trigger(`durationchange`),this.trigger(`playing`),this.trigger(`play`),this.isSeeking&&this.onSeeked();break;case YT.PlayerState.PAUSED:this.trigger(`canplay`),this.isSeeking||this.trigger(`pause`);break;case YT.PlayerState.BUFFERING:this.player_.trigger(`waiting`);break;case YT.PlayerState.CUED:this.trigger(`canplay`);break}this.startInterval&&=(clearInterval(this.startInterval),null),t===YT.PlayerState.PLAYING&&(this.startInterval=setInterval(()=>this.trigger(`timeupdate`),250))}onPlayerPlaybackRateChange(){this.trigger(`ratechange`)}onPlayerVolumeChange(){this.trigger(`volumechange`)}onPlayerError(e){this.errorNumber=e.data,this.trigger(`error`),this.setTimeout(()=>{this.errorNumber=null},0)}play(){this.url?.videoId&&(this.wasPausedBeforeSeek=!1,this.isReady_?this.activeVideoId===this.url.videoId?this.ytPlayer.playVideo():(this.loadVideoById_(this.url.videoId),this.activeVideoId=this.url.videoId):(this.trigger(`waiting`),this.playOnReady=!0))}pause(){this.ytPlayer?.pauseVideo()}paused(){return this.ytPlayer?this.lastState!==YT.PlayerState.PLAYING&&this.lastState!==YT.PlayerState.BUFFERING:!0}loadVideoById_(e){this.ytPlayer.loadVideoById({videoId:e})}cueVideoById_(e){this.ytPlayer.cueVideoById({videoId:e})}currentTime(){return this.ytPlayer?.getCurrentTime()??0}setCurrentTime(e){this.lastState===YT.PlayerState.PAUSED&&(this.timeBeforeSeek=this.currentTime()),this.isSeeking||(this.wasPausedBeforeSeek=this.paused()),this.ytPlayer.seekTo(e,!0),this.trigger(`timeupdate`),this.trigger(`seeking`),this.isSeeking=!0,this.lastState===YT.PlayerState.PAUSED&&this.timeBeforeSeek!==e&&(clearInterval(this.checkSeekedInPauseInterval),this.checkSeekedInPauseInterval=setInterval(()=>{this.lastState!==YT.PlayerState.PAUSED||!this.isSeeking?clearInterval(this.checkSeekedInPauseInterval):this.currentTime()!==this.timeBeforeSeek&&(this.trigger(`timeupdate`),this.onSeeked())},250))}onSeeked(){clearInterval(this.checkSeekedInPauseInterval),this.isSeeking=!1,this.wasPausedBeforeSeek&&this.pause(),this.trigger(`seeked`)}seeking(){return this.isSeeking}seekable(){return u.default.createTimeRange(0,this.ytPlayer?.getDuration()??0)}duration(){return this.ytPlayer?.getDuration()??0}ended(){return this.ytPlayer?this.lastState===YT.PlayerState.ENDED:!1}volume(){return this.ytPlayer?this.ytPlayer.getVolume()/100:1}setVolume(e){this.ytPlayer?.setVolume(e*100)}muted(){return this.ytPlayer?.isMuted()??!1}setMuted(e){this.ytPlayer&&(e?this.ytPlayer.mute():this.ytPlayer.unMute(),this.setTimeout(()=>this.trigger(`volumechange`),50))}buffered(){return this.ytPlayer?.getVideoLoadedFraction?u.default.createTimeRange(0,this.ytPlayer.getVideoLoadedFraction()*this.ytPlayer.getDuration()):u.default.createTimeRange()}playbackRate(){return this.ytPlayer?.getPlaybackRate()??1}setPlaybackRate(e){this.ytPlayer?.setPlaybackRate(e)}currentSrc(){return this.source?.src??``}preload(){}load(){}reset(){}networkState(){if(!this.ytPlayer)return 0;switch(this.ytPlayer.getPlayerState()){case-1:return 0;case 3:return 2;default:return 1}}readyState(){if(!this.ytPlayer)return 0;switch(this.ytPlayer.getPlayerState()){case-1:return 0;case 5:return 1;case 3:return 2;default:return 4}}supportsFullScreen(){return n()}setSrc(t){t?.src&&(this.source=t,this.url=e.parseUrl(t.src),!this.options_.poster&&this.url.videoId&&(this.poster_=`https://img.youtube.com/vi/${this.url.videoId}/0.jpg`,this.setTimeout(()=>{this.trigger(`posterchange`),this.checkHighResPoster()},0)),this.options_.autoplay?this.isReady_?this.play():this.playOnReady=!0:this.activeVideoId!==this.url.videoId&&(this.isReady_?(this.cueVideoById_(this.url.videoId),this.activeVideoId=this.url.videoId):this.cueOnReady=!0))}poster(){return f?null:this.poster_}setPoster(e){this.poster_=e}autoplay(){return this.options_.autoplay}setAutoplay(e){this.options_.autoplay=e}loop(){return this.options_.loop}setLoop(e){this.options_.loop=e}checkHighResPoster(){let e=`https://img.youtube.com/vi/${this.url.videoId}/maxresdefault.jpg`,t=new Image;t.onload=()=>{(t.naturalHeight||t.height)<=90||(this.poster_=e,this.trigger(`posterchange`))},t.src=e}enterFullscreen(){if(i()&&this.ytPlayer){this._spawnIosFullscreen();return}a(this.player_.el().parentElement)}exitFullscreen(){o()}_spawnIosFullscreen(){let e=this.ytPlayer,t=e.getCurrentTime(),{video_id:n}=e.getVideoData();e.pauseVideo(),this.player_.trigger(c);let r=document.createElement(`div`);r.style.cssText=`position:fixed;inset:0;z-index:99999;opacity:0;pointer-events:none`,document.body.appendChild(r);let i=document.createElement(`div`);i.id=`yt-fs-${Date.now()}`,r.appendChild(i);let a=null,o=!1,l=()=>{if(o)return;o=!0,this.player_.trigger(s);let n=a?a.getCurrentTime():t;try{a?.destroy()}catch{}r.remove(),e.seekTo(n,!0),this.trigger(`timeupdate`)};a=new window.YT.Player(i.id,{videoId:n,playerVars:{playsinline:0,autoplay:1,controls:1,modestbranding:1,rel:0,start:Math.floor(t)},events:{onReady:e=>{this.player_.trigger(s),e.target.seekTo(t,!0),e.target.playVideo()},onStateChange:e=>{(e.data===window.YT.PlayerState.PAUSED||e.data===window.YT.PlayerState.ENDED)&&l()}}})}dispose(){clearInterval(this.startInterval),this.ytPlayer?(this.ytPlayer.stopVideo?.(),this.ytPlayer.destroy?.()):e.apiReadyQueue=e.apiReadyQueue.filter(e=>e!==this),this.ytPlayer=null,this.el_?.parentNode?.classList.remove(`vjs-youtube`,`vjs-youtube-mobile`),d.prototype.dispose.call(this)}};p.isApiReady=!1,p.apiReadyQueue=[],p.isSupported=()=>!0,p.canPlayType=e=>e===`video/youtube`?`probably`:``,p.canPlaySource=({type:e,src:t})=>e===`video/youtube`?`probably`:/youtu\.be|youtube\.com/.test(t)?`maybe`:``,p.parseUrl=e=>{let t={videoId:null,listId:null},n=e.match(/^.*(youtu\.be\/|v\/|u\/\w\/|embed\/|watch\?v=|shorts\/|&v=)([^#&?]*).*/);n?.[2]?.length===11&&(t.videoId=n[2]);let r=e.match(/[?&]list=([^#&?]+)/);return r?.[1]&&(t.listId=r[1]),t},typeof document<`u`&&l(`https://www.youtube.com/iframe_api`).then(()=>{window.YT.ready(()=>{p.isApiReady=!0,p.apiReadyQueue.forEach(e=>e.initYTPlayer()),p.apiReadyQueue=[]})}),r(`Youtube`,p);export{p as default};
|
package/dist/element.d.mts
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/types.d.ts
|
|
2
|
+
type BuiltinAction = 'mute' | 'loop';
|
|
3
|
+
interface CustomAction {
|
|
4
|
+
icon: string;
|
|
5
|
+
label: string;
|
|
6
|
+
onClick: () => void;
|
|
7
|
+
}
|
|
8
|
+
type PlayerAction = BuiltinAction | CustomAction;
|
|
9
|
+
interface PlayerProps {
|
|
10
|
+
videoUrl: string;
|
|
11
|
+
title?: string;
|
|
12
|
+
poster?: string;
|
|
13
|
+
aspectRatio?: string;
|
|
14
|
+
platform?: string;
|
|
15
|
+
techOptions?: Record<string, unknown>;
|
|
16
|
+
adTagUrl?: string;
|
|
17
|
+
imaOptions?: Record<string, unknown>;
|
|
18
|
+
autoplay?: boolean;
|
|
19
|
+
muted?: boolean;
|
|
20
|
+
playbackRate?: number;
|
|
21
|
+
nativeUi?: boolean;
|
|
22
|
+
autoStage?: boolean;
|
|
23
|
+
lazy?: boolean;
|
|
24
|
+
payload?: Record<string, unknown>;
|
|
25
|
+
action?: PlayerAction | null;
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
3
28
|
//#region src/element/index.d.ts
|
|
4
29
|
declare const VideoPlayerElement: import("vue").VueElementConstructor<PlayerProps & {
|
|
5
30
|
action?: PlayerAction | null;
|
package/dist/element.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,n as t,r as n,t as r}from"./chunks/VideoItem-C2dc1Nw7.mjs";import{defineCustomElement as i}from"vue";import a from"video.js/dist/video-js.css?inline";const o=i(e,{shadowRoot:!1,styles:[a]}),s=i(n,{shadowRoot:!1}),c=i(t,{shadowRoot:!1}),l=i(r,{shadowRoot:!1});customElements.define(`video-player`,o),customElements.define(`video-stage`,s),customElements.define(`video-placeholder`,c),customElements.define(`video-item`,l);export{l as VideoItemElement,c as VideoPlaceholderElement,o as VideoPlayerElement,s as VideoStageElement};
|
|
1
|
+
import{a as e,t}from"./chunks/video.cjs-gZWrkL0e.mjs";import{i as n,n as r}from"./chunks/tech-hIKMwrTq.mjs";import{a as i,c as a,i as o,n as s,o as c,r as l,s as u,t as d}from"./chunks/constants-DZGeSme4.mjs";import{Fragment as f,Transition as p,computed as m,createBlock as h,createCommentVNode as g,createElementBlock as _,createElementVNode as v,createStaticVNode as y,createVNode as b,defineComponent as x,defineCustomElement as S,inject as C,mergeProps as w,nextTick as T,normalizeClass as E,normalizeProps as D,normalizeStyle as O,onBeforeUnmount as k,onMounted as A,openBlock as j,provide as M,reactive as N,ref as P,toDisplayString as F,toRef as I,unref as L,watch as R,withCtx as z,withModifiers as B}from"vue";import ee from"video.js/dist/video-js.css?inline";var te=e(t(),1);const V={},ne=[{test:e=>/youtu\.be|youtube\.com/.test(e),key:`youtube`,tech:`Youtube`,type:`video/youtube`,load:()=>import(`./chunks/youtube-VA8teDMJ.mjs`)},{test:e=>/vimeo\.com|player\.vimeo\.com/.test(e),key:`vimeo`,tech:`Vimeo`,type:`video/vimeo`,load:()=>import(`./chunks/vimeo-D1LvZaNd.mjs`)},{test:e=>/dailymotion\.com|dai\.ly/.test(e),key:`dailymotion`,tech:`Dailymotion`,type:`video/dailymotion`,load:()=>import(`./chunks/dailymotion-BhvOCSDo.mjs`)},{test:e=>/cdn\.jwplayer\.com/.test(e)||e.startsWith(`jwplayer://`),key:`jwplayer`,tech:null,type:`video/jwplayer`,load:()=>import(`./chunks/jwplayer-eDjA1f7V.mjs`)},{test:e=>e.startsWith(`brightcove://`),key:`brightcove`,tech:null,type:`video/brightcove`,load:()=>import(`./chunks/brightcove-mjKXQYMp.mjs`)}];async function re(e){let t=ne.find(t=>t.test(e));if(!t)return{tech:null,type:null,adTagUrl:null};V[t.key]||(V[t.key]=t.load());let n=null,{prefetchConfig:r}=await V[t.key];return r&&(n=(await r(e).catch(()=>null))?.adTagUrl??null),{tech:t.tech,type:t.type,adTagUrl:n}}const H=new Set([`Youtube`,`Vimeo`,`Dailymotion`]);function ie(e){return!H.has(e)}function U(){return window.google?.ima?Promise.resolve():new Promise((e,t)=>{let n=document.createElement(`script`);n.src=`https://imasdk.googleapis.com/js/sdkloader/ima3.js`,n.onload=e,n.onerror=()=>t(Error(`Failed to load Google IMA SDK`)),document.head.appendChild(n)})}async function ae(t,n){return!n||!ie(t)?!1:(await U(),await import(`./chunks/videojs.ads-jA_s2l9Y.mjs`).then(t=>e(t.default,1)),await import(`./chunks/videojs.ima-Ccon1y6f.mjs`).then(t=>e(t.default,1)),!0)}function oe(e,t,n={}){e.ima({adTagUrl:t,showControlsForJSAds:!1,...n})}const W=new Set;function se(e){return W.add(e),()=>W.delete(e)}function ce(e){W.forEach(t=>{if(t!==e)try{t()}catch{}})}function G(){try{return JSON.parse(localStorage.getItem(`player:positions`)??`[]`)}catch{return[]}}function K(e){localStorage.setItem(d,JSON.stringify(e))}function q(e,t){if(t<5)return;let n=G().filter(t=>t.url!==e);n.unshift({url:e,time:t}),K(n.slice(0,5))}function le(e){return G().find(t=>t.url===e)?.time??null}function ue(e){K(G().filter(t=>t.url!==e))}function de(e,t,n){let a=null,c=!1,u=null,d=null,f=null,p=new Set,h=[[.25,`firstQuartile`],[.5,`midpoint`],[.75,`thirdQuartile`]],g=P(!1),_=P(!1),v=P(!1),y=P(!1),b=P(0),x=P(0),S=P(0),C=P(1),w=P(t.muted??t.autoplay??!1),T=P(!1),E=P(t.playbackRate??1),D=P(!1),O=P(!1),j=P(!1),M=P(``),N=P(!1),F=P(!1),I=P(!1),L=m(()=>x.value?b.value/x.value*100:0),z=m(()=>Math.max(S.value,L.value)),B=()=>a.tech({IWillNotUseThisInPlugins:!0});function ee(){let e=B();if(typeof e?.enterFullscreen==`function`){e.enterFullscreen();return}let t=e?.el();if(typeof t?.webkitEnterFullscreen==`function`){t.webkitEnterFullscreen();return}a.requestFullscreen()}function V(){let e=B();typeof e?.exitFullscreen==`function`?e.exitFullscreen():a.exitFullscreen()}function ne(){a&&(F.value?V():ee())}function H(){let e=document;F.value=!!(document.fullscreenElement||e.webkitFullscreenElement)}function U(e,r={}){n(`state-change`,{type:e,currentTime:b.value,duration:x.value,src:t.videoUrl,...r,payload:t.payload})}function W(){if(!x.value)return;let e=b.value/x.value;for(let[t,n]of h)!p.has(t)&&e>=t&&(p.add(t),U(n))}function G(){!a||!f||(j.value=!1,M.value=``,a.src(f))}function K(){!a||!_.value||(a.paused()?a.play():a.pause())}function de(e){a?.currentTime(x.value*(e/100))}function fe(){a?.muted(!a.muted())}function J(e){a&&(a.volume(e),a.muted(e===0))}function Y(){T.value=!T.value}function X(e){a&&(a.playbackRate(e),E.value=e)}function Z(){a.ready(()=>{_.value=!0,D.value=!!B()?.featuresPlaybackRate});let e=()=>{let e=a.duration();e>0&&isFinite(e)&&(x.value=e)};a.on([`adstart`,l],()=>{ce(Q),v.value=!0,U(`adstart`)}),a.on([`adend`,s],()=>{v.value=!1,U(`adend`)}),a.on(`play`,()=>{if(ce(Q),O.value=!0,g.value=!0,!c){let e=le(t.videoUrl);e&&a.currentTime(e),c=!0}U(`play`)}),a.on(`pause`,()=>{g.value=!1,q(t.videoUrl,a.currentTime()),U(`pause`)}),a.on(`ended`,()=>{g.value=!1,p.clear(),T.value?(a.currentTime(0),a.play()):(ue(t.videoUrl),U(`ended`))}),a.on(`seeked`,()=>{U(`seeked`)}),a.on(`error`,()=>{let e=a.error();M.value=e?.message||`This video could not be played.`,j.value=!0,_.value=!0,U(`error`,{error:e})}),a.on(`waiting`,()=>{y.value=!0}),a.on(`playing`,()=>{y.value=!1}),a.on(`canplay`,()=>{y.value=!1}),a.on(`timeupdate`,()=>{b.value=a.currentTime(),x.value||e(),W()}),a.on(`durationchange`,e),a.on(`progress`,()=>{let e=a.duration();S.value=e?a.bufferedEnd()/e*100:0}),a.on(`volumechange`,()=>{let e=a.muted();C.value=a.volume(),w.value=e,O.value&&U(`volumechange`,{isMuted:e})}),a.on(`ratechange`,()=>{let e=a.playbackRate();E.value=e,O.value&&U(`ratechange`,{playbackRate:e})}),a.on(`fullscreenchange`,()=>{F.value=a.isFullscreen()}),a.on(o,()=>{I.value=!0}),a.on(i,()=>{I.value=!1})}function Q(){a?.pause()}R(()=>t.muted,e=>{!a||e===void 0||a.muted(e)}),R(()=>t.playbackRate,e=>{!a||e===void 0||a.playbackRate(e)}),A(async()=>{document.addEventListener(`fullscreenchange`,H),document.addEventListener(`webkitfullscreenchange`,H),document.addEventListener(`visibilitychange`,pe);let{tech:n,type:r,adTagUrl:i}=await re(t.videoUrl),o=n?[n,`Html5`]:[`Html5`],s=t.adTagUrl||i||``,c=await ae(n??`Html5`,s);if(!e.value)return;let l={src:t.videoUrl,...r&&{type:r}};f=l,N.value=!!(t.nativeUi&&!ie(n??``)),a=(0,te.default)(e.value,{techOrder:o,controls:!1,fluid:!0,aspectRatio:t.aspectRatio??`16:9`,poster:t.poster||``,playsinline:!0,autoplay:t.autoplay,muted:t.muted??t.autoplay,playbackRate:E.value,adTagUrl:s,youtube:{nativeUi:N.value},vimeo:{nativeUi:N.value},dailymotion:{nativeUi:N.value},...!c&&{sources:[l]},...t.techOptions}),c&&(oe(a,s,t.imaOptions??{}),a.src(l)),u=se(Q),Z(),d=new IntersectionObserver(([e])=>{!e.isIntersecting&&a&&!a.paused()&&!F.value&&a.pause()},{threshold:.1}),e.value&&d.observe(e.value)});function pe(){document.visibilityState===`hidden`&&a&&q(t.videoUrl,a.currentTime())}return k(()=>{a&&q(t.videoUrl,a.currentTime()),u?.(),d?.disconnect(),document.removeEventListener(`visibilitychange`,pe),document.removeEventListener(`fullscreenchange`,H),document.removeEventListener(`webkitfullscreenchange`,H),a?.dispose(),a=null}),{isPlaying:g,isReady:_,isAdPlaying:v,isBuffering:y,current:b,total:x,vol:C,isMuted:w,isLooping:T,playbackRate:E,hasStarted:O,isError:j,errorMessage:M,progress:L,bufferedDisplay:z,isFullscreen:F,isFullscreenPending:I,fmt:r,retry:G,togglePlay:K,seek:de,toggleMute:fe,setVolume:J,toggleFullscreen:ne,toggleLoop:Y,setPlaybackRate:X,supportsPlaybackRate:D,nativeUi:N}}function fe(e){let t=P(!0),n=P(!1),r=null;function i(e=3500){clearTimeout(r??void 0),r=setTimeout(()=>{t.value=!1,n.value=!1},e)}function a(){clearTimeout(r??void 0)}function o(){n.value=!0,t.value=!0,i()}function s(){n.value=!1,e.value&&i()}function c(){e.value&&i()}function l(){t.value=!0,e.value&&i()}function u(){t.value=!0,i()}function d(){e.value&&i(600)}return R(e,e=>{e?i():(clearTimeout(r??void 0),t.value=!0)}),k(()=>clearTimeout(r??void 0)),{showHUD:t,isOpen:n,scheduleHide:i,pauseHide:a,onVideoTap:l,onMouseMove:u,onMouseLeave:d,openControls:o,closeControls:s,keepOpen:c}}const J=Symbol(`player`),Y=Symbol(`hud`),X=Symbol(`action`);var Z=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n};const Q={},pe={viewBox:`0 0 24 24`,fill:`currentColor`};function me(e,t){return j(),_(`svg`,pe,[...t[0]||=[v(`path`,{d:`M8 5v14l11-7z`},null,-1)]])}var he=Z(Q,[[`render`,me]]);const ge={},_e={viewBox:`0 0 24 24`,fill:`currentColor`};function ve(e,t){return j(),_(`svg`,_e,[...t[0]||=[v(`path`,{d:`M6 19h4V5H6v14zm8-14v14h4V5h-4z`},null,-1)]])}var ye=Z(ge,[[`render`,ve]]);const be=[`aria-label`];var $=Z(x({__name:`PlayPauseButton`,props:{isPlaying:{type:Boolean,required:!0},size:{type:String,default:`sm`}},emits:[`toggle-play`],setup(e){return(t,n)=>(j(),_(`button`,{class:E([`ppbtn`,`ppbtn--${e.size}`]),"aria-label":e.isPlaying?`Pause`:`Play`,onClick:n[0]||=B(e=>t.$emit(`toggle-play`),[`stop`])},[e.isPlaying?(j(),h(ye,{key:0})):(j(),h(he,{key:1}))],10,be))}}),[[`__scopeId`,`data-v-85902525`]]);const xe={},Se={viewBox:`0 0 24 24`,fill:`currentColor`};function Ce(e,t){return j(),_(`svg`,Se,[...t[0]||=[v(`path`,{d:`M3 9v6h4l5 5V4L7 9H3zm13.5 3A4.5 4.5 0 0 0 14 7.97v8.05c1.48-.73 2.5-2.25 2.5-4.02z`},null,-1)]])}var we=Z(xe,[[`render`,Ce]]);const Te={},Ee={viewBox:`0 0 24 24`,fill:`currentColor`};function De(e,t){return j(),_(`svg`,Ee,[...t[0]||=[v(`path`,{d:`M16.5 12A4.5 4.5 0 0 0 14 7.97v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51A8.796 8.796 0 0 0 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06A8.99 8.99 0 0 0 17.73 18L19 19.27 20.27 18 5.27 3 4.27 3zM12 4L9.91 6.09 12 8.18V4z`},null,-1)]])}var Oe=Z(Te,[[`render`,De]]);const ke={},Ae={viewBox:`0 0 24 24`,fill:`currentColor`};function je(e,t){return j(),_(`svg`,Ae,[...t[0]||=[v(`path`,{d:`M7 7h10v3l4-4-4-4v3H5v6h2V7zm10 10H7v-3l-4 4 4 4v-3h12v-6h-2v4z`},null,-1)]])}var Me=Z(ke,[[`render`,je]]);const Ne={},Pe={viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`};function Fe(e,t){return j(),_(`svg`,Pe,[...t[0]||=[y(`<line x1="4" y1="6" x2="20" y2="6"></line><line x1="4" y1="12" x2="20" y2="12"></line><line x1="4" y1="18" x2="20" y2="18"></line><circle cx="9" cy="6" r="2.5" fill="currentColor" stroke="none"></circle><circle cx="15" cy="12" r="2.5" fill="currentColor" stroke="none"></circle><circle cx="9" cy="18" r="2.5" fill="currentColor" stroke="none"></circle>`,6)]])}var Ie=Z(Ne,[[`render`,Fe]]);const Le={class:`hud`},Re=[`aria-label`],ze=[`aria-label`],Be=[`aria-label`,`innerHTML`];var Ve=Z(x({__name:`HudButtons`,setup(e){let t=C(J),n=C(Y),r=C(X),i=m(()=>r?.value??null),a=m(()=>!!i.value&&typeof i.value==`object`),o=m(()=>a.value?i.value:null),s=m(()=>i.value===`mute`?t.isMuted?`Unmute`:`Mute`:i.value===`loop`?t.isLooping?`Disable loop`:`Loop`:``);function c(){i.value===`mute`?t.toggleMute():i.value===`loop`&&t.toggleLoop()}return(e,r)=>(j(),_(`div`,Le,[g(` Built-in: mute `),i.value===`mute`?(j(),_(`button`,{key:0,class:E([`hud__btn`,{"hud__btn--active":L(t).isMuted}]),"aria-label":s.value,onClick:B(c,[`stop`])},[!L(t).isMuted&&L(t).vol>0?(j(),h(we,{key:0})):(j(),h(Oe,{key:1}))],10,Re)):i.value===`loop`?(j(),_(f,{key:1},[g(` Built-in: loop `),v(`button`,{class:E([`hud__btn`,{"hud__btn--active":L(t).isLooping}]),"aria-label":s.value,onClick:B(c,[`stop`])},[b(Me)],10,ze)],2112)):a.value&&o.value?(j(),_(f,{key:2},[g(` Custom action `),v(`button`,{class:`hud__btn`,"aria-label":o.value.label,onClick:r[0]||=B(e=>o.value.onClick(),[`stop`]),innerHTML:o.value.icon},null,8,Be)],2112)):(j(),_(f,{key:3},[g(` No action — spacer keeps layout balanced `),r[2]||=v(`div`,{class:`hud__spacer`},null,-1)],2112)),b($,{"is-playing":L(t).isPlaying,size:`lg`,onTogglePlay:L(t).togglePlay},null,8,[`is-playing`,`onTogglePlay`]),v(`button`,{class:`hud__btn`,"aria-label":`Show controls`,onClick:r[1]||=B((...e)=>L(n).openControls&&L(n).openControls(...e),[`stop`])},[b(Ie)])]))}}),[[`__scopeId`,`data-v-a6d118e7`]]);const He={},Ue={viewBox:`0 0 24 24`,fill:`currentColor`};function We(e,t){return j(),_(`svg`,Ue,[...t[0]||=[v(`path`,{d:`M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z`},null,-1)]])}var Ge=Z(He,[[`render`,We]]);const Ke={},qe={viewBox:`0 0 24 24`,fill:`currentColor`};function Je(e,t){return j(),_(`svg`,qe,[...t[0]||=[v(`path`,{d:`M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z`},null,-1)]])}var Ye=Z(Ke,[[`render`,Je]]);const Xe={},Ze={viewBox:`0 0 24 24`,fill:`currentColor`};function Qe(e,t){return j(),_(`svg`,Ze,[...t[0]||=[v(`path`,{d:`M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z`},null,-1)]])}var $e=Z(Xe,[[`render`,Qe]]);const et={},tt={viewBox:`0 0 24 24`,fill:`currentColor`};function nt(e,t){return j(),_(`svg`,tt,[...t[0]||=[v(`path`,{d:`M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z`},null,-1)]])}var rt=Z(et,[[`render`,nt]]);const it={class:`controls__vol-header`},at=[`aria-label`],ot={class:`controls__vol-body`},st=[`value`],ct={class:`controls__vol-pct`},lt=[`value`],ut={class:`controls__row`},dt={class:`controls__play-wrap`},ft={key:0,class:`controls__buf-spinner`},pt={class:`controls__time`},mt={key:2,class:`controls__fs-wrap`},ht={key:0,class:`controls__fs-spinner`},gt=[`aria-label`];var _t=Z(x({__name:`ControlsPopup`,setup(e){let t=C(J),n=C(Y),r=C(`compact`),i=P(!1),a=P(null);k(()=>{i.value=!1});function o(e){if(!document.startViewTransition||!a.value){e();return}a.value.style.viewTransitionName=`controls-popup`,document.startViewTransition(async()=>{e(),await T()}).finished.finally(()=>{a.value&&(a.value.style.viewTransitionName=``)})}let s=m(()=>t.isMuted?0:Math.round(t.vol*100)),c=null;function l(){c=setTimeout(()=>{c=null,o(()=>{i.value=!0})},350)}function u(){c&&(clearTimeout(c),c=null,t.toggleMute())}function d(){clearTimeout(c),c=null}function p(e){t.seek(Number(e.target.value))}function y(e){t.setVolume(Number(e.target.value)/100)}let x=[.5,.75,1,1.25,1.5,2];function S(){let e=x[(x.indexOf(t.playbackRate)+1)%x.length];t.setPlaybackRate(e)}function w(e){return e===1?`1×`:`${e}×`}return(e,c)=>(j(),_(`div`,{ref_key:`popupEl`,ref:a,class:E([`controls`,{"controls--fs":L(t).isFullscreen}]),onMousemove:c[14]||=B((...e)=>L(n).keepOpen&&L(n).keepOpen(...e),[`stop`])},[i.value?(j(),_(f,{key:0},[v(`div`,it,[v(`button`,{class:`controls__btn`,"aria-label":`Back`,onClick:c[0]||=e=>o(()=>i.value=!1)},[b(Ye)]),c[15]||=v(`span`,{class:`controls__vol-label`},`Volume`,-1),v(`button`,{class:`controls__btn`,"aria-label":L(t).isMuted?`Unmute`:`Mute`,onClick:c[1]||=e=>L(t).toggleMute()},[!L(t).isMuted&&L(t).vol>0?(j(),h(we,{key:0})):(j(),h(Oe,{key:1}))],8,at)]),v(`div`,ot,[v(`input`,{type:`range`,min:`0`,max:`100`,step:`1`,value:s.value,class:`controls__vol-slider`,style:O({"--v":s.value+`%`}),"aria-label":`Volume`,onInput:y,onMousedown:c[2]||=e=>L(n).pauseHide(),onMouseup:c[3]||=e=>L(n).scheduleHide(),onTouchstartPassive:c[4]||=e=>L(n).pauseHide(),onTouchend:c[5]||=e=>L(n).scheduleHide()},null,44,st),v(`span`,ct,F(s.value)+`%`,1)])],64)):(j(),_(f,{key:1},[L(r)?g(`v-if`,!0):(j(),_(`input`,{key:0,type:`range`,min:`0`,max:`100`,value:L(t).progress,class:`controls__seek`,style:O({"--p":L(t).progress+`%`,"--b":L(t).bufferedDisplay+`%`}),onInput:p,onMousedown:c[6]||=e=>L(n).pauseHide(),onMouseup:c[7]||=e=>L(n).scheduleHide(),onTouchstartPassive:c[8]||=e=>L(n).pauseHide(),onTouchend:c[9]||=e=>L(n).scheduleHide()},null,44,lt)),v(`div`,ut,[v(`div`,dt,[L(t).isBuffering?(j(),_(`div`,ft)):(j(),h($,{key:1,"is-playing":L(t).isPlaying,size:`sm`,onTogglePlay:c[10]||=e=>L(t).togglePlay()},null,8,[`is-playing`]))]),v(`span`,pt,F(L(t).fmt(L(t).current))+` / `+F(L(t).fmt(L(t).total)),1),!L(r)&&L(t).supportsPlaybackRate?(j(),_(`button`,{key:0,class:E([`controls__btn controls__btn--rate`,{"controls__btn--active":L(t).playbackRate!==1}]),"aria-label":`Playback rate`,onClick:S},F(w(L(t).playbackRate)),3)):g(`v-if`,!0),L(r)?g(`v-if`,!0):(j(),_(`button`,{key:1,class:E([`controls__btn`,{"controls__btn--active":L(t).isLooping}]),"aria-label":`Toggle loop`,onClick:c[11]||=e=>L(t).toggleLoop()},[b(Me)],2)),v(`button`,{class:`controls__btn`,"aria-label":`Volume`,onMousedown:l,onMouseup:u,onMouseleave:d,onTouchstartPassive:l,onTouchend:B(u,[`prevent`]),onTouchcancel:d},[!L(t).isMuted&&L(t).vol>0?(j(),h(we,{key:0})):(j(),h(Oe,{key:1}))],32),L(r)?g(`v-if`,!0):(j(),_(`div`,mt,[L(t).isFullscreenPending?(j(),_(`div`,ht)):(j(),_(`button`,{key:1,class:`controls__btn`,"aria-label":L(t).isFullscreen?`Exit fullscreen`:`Fullscreen`,onClick:c[12]||=e=>L(t).toggleFullscreen()},[L(t).isFullscreen?(j(),h(rt,{key:0})):(j(),h($e,{key:1}))],8,gt))])),v(`button`,{class:`controls__btn controls__btn--close`,"aria-label":`Close`,onClick:c[13]||=e=>L(n).closeControls()},[b(Ge)])])],64))],34))}}),[[`__scopeId`,`data-v-5712aad4`]]);const vt={key:0,class:`overlay__spinner`},yt={key:0,class:`overlay__error`};var bt=Z(x({__name:`PlayerOverlay`,setup(e){let t=C(J),n=C(Y);return(e,r)=>(j(),_(f,null,[g(` Inactive until content has started so platform ad UIs (skip buttons etc.) remain reachable `),v(`div`,{class:`overlay__tap-capture`,style:O({pointerEvents:!L(t).hasStarted||L(t).isAdPlaying?`none`:void 0}),onClick:r[0]||=(...e)=>L(n).onVideoTap&&L(n).onVideoTap(...e),onTouchend:r[1]||=B((...e)=>L(n).onVideoTap&&L(n).onVideoTap(...e),[`prevent`,`stop`])},null,36),b(p,{name:`fade`},{default:z(()=>[!L(t).isReady&&!L(t).isError?(j(),_(`div`,vt,[...r[4]||=[v(`div`,{class:`overlay__spinner-ring`},null,-1)]])):g(`v-if`,!0)]),_:1}),b(p,{name:`fade`},{default:z(()=>[L(t).isError?(j(),_(`div`,yt,[v(`p`,null,F(L(t).errorMessage||`This video could not be played.`),1),v(`button`,{class:`overlay__retry`,onClick:r[2]||=B((...e)=>L(t).retry&&L(t).retry(...e),[`stop`])},`Retry`)])):g(`v-if`,!0)]),_:1}),g(` Hidden in fullscreen while the controls popup is open `),v(`div`,{class:E([`overlay__hud`,{"overlay__hud--visible":L(n).showHUD&&L(t).isReady&&!L(t).isError&&!(L(n).isOpen&&L(t).isFullscreen)}])},[b(Ve)],2),b(p,{name:`popup`},{default:z(()=>[L(n).isOpen&&L(t).isReady&&!L(t).isError?(j(),_(`div`,{key:0,class:E([`overlay__popup`,{"overlay__popup--fs":L(t).isFullscreen}]),onClick:r[3]||=B(()=>{},[`stop`])},[b(_t)],2)):g(`v-if`,!0)]),_:1})],64))}}),[[`__scopeId`,`data-v-f3307b98`]]);const xt={class:`player`},St={"data-vjs-player":``},Ct={key:1,class:`player__native-play`};var wt=Z(x({__name:`VideoPlayer`,props:{videoUrl:{type:String,required:!0},title:{type:String,required:!1,default:``},poster:{type:String,required:!1,default:``},aspectRatio:{type:String,required:!1,default:`16:9`},platform:{type:String,required:!1,default:``},techOptions:{type:Object,required:!1,default:()=>({})},adTagUrl:{type:String,required:!1,default:``},imaOptions:{type:Object,required:!1},autoplay:{type:Boolean,required:!1,default:!1},muted:{type:Boolean,required:!1},playbackRate:{type:Number,required:!1},nativeUi:{type:Boolean,required:!1,default:!1},autoStage:{type:Boolean,required:!1,default:!1},lazy:{type:Boolean,required:!1,default:!1},payload:{type:Object,required:!1,default:()=>({})},action:{type:[String,Object,null],required:!1,default:null}},emits:[`state-change`],setup(e,{expose:t,emit:r}){let i=e,a=r,o=P(null),s=N(de(o,i,a)),c=N(fe(I(s,`isPlaying`)));M(J,s),M(Y,c),M(X,I(i,`action`));let{isPortrait:l,cssRatio:u}=n(i.aspectRatio);return t(s),(e,t)=>(j(),_(`div`,xt,[v(`div`,{class:E([`player__shell`,{"player__shell--portrait":L(l)}]),style:O({aspectRatio:L(u)}),onMousemove:t[0]||=e=>c.onMouseMove(),onContextmenuCapture:t[1]||=B(()=>{},[`prevent`]),onMouseleave:t[2]||=e=>c.onMouseLeave()},[v(`div`,St,[v(`video`,{ref_key:`videoEl`,ref:o,class:`video-js`,playsinline:``},null,512),s.nativeUi?g(`v-if`,!0):(j(),h(bt,{key:0})),s.nativeUi&&!s.hasStarted?(j(),_(`div`,Ct,[b($,{"is-playing":!1,size:`lg`,onTogglePlay:s.togglePlay},null,8,[`onTogglePlay`])])):g(`v-if`,!0)])],38)]))}}),[[`__scopeId`,`data-v-4ab3cf75`]]);const Tt=P(0),Et=m(()=>Tt.value>0);function Dt(){Tt.value++}function Ot(){Tt.value--}const kt=[`src`],At={class:`stage__idle-body`},jt={class:`stage__idle-btn`},Mt={class:`stage__idle-title`},Nt={key:1,class:`stage__idle-empty`};var Pt=Z(x({__name:`VideoStage`,emits:[`state-change`],setup(e,{emit:t}){let n=t,r=P(null),i=P(null),o=P(!1),s=P(!1),l=P(null),d=P(null),p=P(!1),m=P(null);M(`compact`,p);let y=null;R(p,e=>{m.value=e&&d.value?d.value.offsetHeight:null});function x(){y?.disconnect(),l.value&&(y=new IntersectionObserver(([e])=>{p.value=!e.isIntersecting},{threshold:1}),y.observe(l.value))}R(l,x);function S(){i.value&&(i.value={...i.value,autoplay:!0},o.value=!0)}function C(){i.value=null,o.value=!1,s.value=!1,p.value=!1,m.value=null,T()}function T(){window.dispatchEvent(new CustomEvent(u,{detail:{currentVideoUrl:i.value?.videoUrl??null,isPlaying:s.value}}))}function D(e){let t=e.detail;if(i.value?.videoUrl===t.videoUrl&&o.value){r.value?.togglePlay();return}i.value=t,o.value=!1,s.value=!1,T(),o.value=!0}function N(e){let t=e.detail;!i.value||t.videoUrl!==i.value.videoUrl||(o.value?r.value?.togglePlay():(i.value={...i.value,autoplay:!0},o.value=!0))}function I(e){e.type===`play`&&(s.value=!0),(e.type===`pause`||e.type===`ended`)&&(s.value=!1),T(),n(`state-change`,e)}return A(()=>{Dt(),window.addEventListener(c,D),window.addEventListener(a,N)}),k(()=>{Ot(),window.removeEventListener(c,D),window.removeEventListener(a,N),y?.disconnect()}),(e,t)=>(j(),_(`div`,{ref_key:`wrapperEl`,ref:l,class:`stage-wrapper`,style:O(m.value?{height:m.value+`px`}:{})},[v(`div`,{ref_key:`stageEl`,ref:d,class:E([`stage`,{"stage--minified":p.value&&i.value&&o.value}])},[p.value&&i.value&&o.value?(j(),_(`button`,{key:0,class:`stage__dismiss`,"aria-label":`Close`,onClick:B(C,[`stop`])},[b(Ge)])):g(`v-if`,!0),i.value&&o.value?(j(),h(wt,w({ref_key:`playerRef`,ref:r,key:i.value.videoUrl},i.value,{onStateChange:I}),null,16)):(j(),_(`div`,{key:2,class:`stage__idle`,style:O({aspectRatio:i.value?.aspectRatio||`16:9`}),onClick:S},[i.value?.poster?(j(),_(`img`,{key:0,src:i.value.poster,class:`stage__idle-poster`},null,8,kt)):g(`v-if`,!0),t[0]||=v(`div`,{class:`stage__idle-scrim`},null,-1),v(`div`,At,[i.value?(j(),_(f,{key:0},[v(`div`,jt,[b(he)]),v(`p`,Mt,F(i.value.title),1)],64)):(j(),_(`p`,Nt,`Select a video to play`))])],4))],2)],4))}}),[[`__scopeId`,`data-v-fb8c86cf`]]);const Ft={class:`placeholder`},It=[`src`,`alt`],Lt={class:`placeholder__btn-wrap`},Rt={key:2,class:`placeholder__footer`},zt={class:`placeholder__title`};var Bt=Z(x({__name:`VideoPlaceholder`,props:{videoUrl:{type:String,required:!0},title:{type:String,required:!1,default:``},poster:{type:String,required:!1,default:``},aspectRatio:{type:String,required:!1,default:`16:9`},platform:{type:String,required:!1,default:``},techOptions:{type:Object,required:!1,default:()=>({})},adTagUrl:{type:String,required:!1,default:``},imaOptions:{type:Object,required:!1},autoplay:{type:Boolean,required:!1,default:!1},muted:{type:Boolean,required:!1},playbackRate:{type:Number,required:!1},nativeUi:{type:Boolean,required:!1,default:!1},autoStage:{type:Boolean,required:!1,default:!1},lazy:{type:Boolean,required:!1},payload:{type:Object,required:!1,default:()=>({})},action:{type:[String,Object,null],required:!1,default:null}},setup(e){let t=e,{isPortrait:r,cssRatio:i}=n(t.aspectRatio),a=P(!1),o=P(!1);function s(e){let n=e.detail;a.value=n.currentVideoUrl===t.videoUrl,o.value=a.value&&n.isPlaying}function l(e){window.dispatchEvent(new CustomEvent(c,{detail:{...t,...e!==void 0&&{autoplay:e}}}))}function d(){l(!0)}return A(()=>{window.addEventListener(u,s),t.autoStage&&l()}),k(()=>window.removeEventListener(u,s)),(t,n)=>(j(),_(`div`,Ft,[v(`div`,{class:E([`placeholder__shell`,{"placeholder__shell--portrait":L(r),"placeholder__shell--active":a.value}]),style:O({aspectRatio:L(i)}),onClick:d},[e.poster?(j(),_(`img`,{key:0,class:`placeholder__poster`,src:e.poster,alt:e.title},null,8,It)):g(`v-if`,!0),n[0]||=v(`div`,{class:`placeholder__scrim`},null,-1),e.platform?(j(),_(`span`,{key:1,class:E([`placeholder__badge`,`badge--${e.platform}`])},F(e.platform),3)):g(`v-if`,!0),v(`div`,Lt,[b($,{"is-playing":a.value&&o.value,size:`lg`,onTogglePlay:d},null,8,[`is-playing`])]),e.title?(j(),_(`div`,Rt,[v(`p`,zt,F(e.title),1)])):g(`v-if`,!0)],6)]))}}),[[`__scopeId`,`data-v-dbcb4f82`]]),Vt=x({__name:`VideoItem`,props:{videoUrl:{type:String,required:!0},title:{type:String,required:!1},poster:{type:String,required:!1},aspectRatio:{type:String,required:!1},platform:{type:String,required:!1},techOptions:{type:Object,required:!1},adTagUrl:{type:String,required:!1},imaOptions:{type:Object,required:!1},autoplay:{type:Boolean,required:!1},muted:{type:Boolean,required:!1},playbackRate:{type:Number,required:!1},nativeUi:{type:Boolean,required:!1},autoStage:{type:Boolean,required:!1},lazy:{type:Boolean,required:!1,default:!0},payload:{type:Object,required:!1},action:{type:[String,Object,null],required:!1,default:null}},emits:[`state-change`],setup(e,{emit:t}){let n=e,r=t,i=P(!1);return(e,t)=>L(Et)?(j(),h(Bt,D(w({key:0},e.$props)),null,16)):(j(),_(f,{key:1},[n.lazy&&!i.value&&!n.autoplay?(j(),h(Bt,w({key:0},e.$props,{onClickCapture:t[0]||=e=>i.value=!0}),null,16)):(j(),h(wt,w({key:1},n,{autoplay:i.value||n.autoplay,onStateChange:t[1]||=e=>r(`state-change`,e)}),null,16,[`autoplay`]))],64))}});const Ht=S(wt,{shadowRoot:!1,styles:[ee]}),Ut=S(Pt,{shadowRoot:!1}),Wt=S(Bt,{shadowRoot:!1}),Gt=S(Vt,{shadowRoot:!1});customElements.define(`video-player`,Ht),customElements.define(`video-stage`,Ut),customElements.define(`video-placeholder`,Wt),customElements.define(`video-item`,Gt);export{Gt as VideoItemElement,Wt as VideoPlaceholderElement,Ht as VideoPlayerElement,Ut as VideoStageElement};
|