cloudinary-video-player 2.0.2-edge.2 → 2.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/dist/chapters.js +6 -509
- package/dist/chapters.light.js +6 -509
- package/dist/chapters.light.min.js +1 -1
- package/dist/chapters.min.js +1 -1
- package/dist/cld-video-player.css +1161 -0
- package/dist/cld-video-player.js +120 -84
- package/dist/cld-video-player.light.css +1161 -0
- package/dist/cld-video-player.light.js +120 -84
- package/dist/cld-video-player.light.min.css +1 -1
- package/dist/cld-video-player.light.min.js +1 -1
- package/dist/cld-video-player.min.css +1 -1
- package/dist/cld-video-player.min.js +1 -1
- package/dist/ima.js +6 -611
- package/dist/ima.light.js +6 -620
- package/dist/ima.light.min.js +1 -1
- package/dist/ima.min.js +1 -1
- package/dist/interaction-areas.js +6 -516
- package/dist/interaction-areas.light.js +6 -516
- package/dist/interaction-areas.light.min.js +1 -1
- package/dist/interaction-areas.min.js +1 -1
- package/dist/node_modules_lodash_throttle_js.js +449 -0
- package/dist/node_modules_lodash_throttle_js.light.js +449 -0
- package/dist/playlist.js +130 -549
- package/dist/playlist.light.js +130 -549
- package/dist/playlist.light.min.js +1 -1
- package/dist/playlist.min.js +1 -1
- package/dist/recommendations-overlay.js +6 -617
- package/dist/recommendations-overlay.light.js +6 -617
- package/dist/recommendations-overlay.light.min.js +1 -1
- package/dist/recommendations-overlay.min.js +1 -1
- package/dist/shoppable.js +7 -742
- package/dist/shoppable.light.js +7 -742
- package/dist/shoppable.light.min.js +1 -1
- package/dist/shoppable.min.js +1 -1
- package/lib/all.js +1 -1
- package/lib/chapters.js +1 -1
- package/lib/cld-video-player.js +1 -1
- package/lib/cld-video-player.min.css +10 -1
- package/lib/ima.js +1 -1
- package/lib/interaction-areas.js +1 -1
- package/lib/playlist.js +1 -1
- package/lib/recommendations-overlay.js +1 -1
- package/lib/shoppable.js +1 -1
- package/lib/videoPlayer.js +1 -1
- package/lib/videoPlayerWithProfile.js +1 -1
- package/package.json +1 -2
- package/dist/473.light.min.js +0 -2
- package/dist/473.min.js +0 -2
- package/dist/node_modules_css-loader_dist_runtime_api_js-node_modules_css-loader_dist_runtime_sourceMaps_j-64c8cd.js +0 -530
- package/dist/node_modules_css-loader_dist_runtime_api_js-node_modules_css-loader_dist_runtime_sourceMaps_j-64c8cd.light.js +0 -530
- package/lib/473.js +0 -2
- package/lib/all.min.css +0 -12
- package/lib/videoPlayer.min.css +0 -12
- package/lib/videoPlayerWithProfile.min.css +0 -12
package/dist/ima.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(self.cloudinaryVideoPlayerChunkLoading=self.cloudinaryVideoPlayerChunkLoading||[]).push([[330],{9294:(t,e,n)=>{n.r(e);var i=n(7938),o=n.n(i),r=n(5204),a=n.n(r),s=n(7509),d=n.n(s),l="7.5.0";var c=function(t,e){e.isImmediatePropagationStopped=function(){return!0},e.cancelBubble=!0,e.isPropagationStopped=function(){return!0}},u=function(t,e,n){c(0,n),t.trigger({type:e+n.type,originalEvent:n})};function h(t){"playing"===t.type?function(t,e){t.ads.isInAdMode()&&(t.ads.isContentResuming()?t.ads._contentEnding&&u(t,"content",e):u(t,"ad",e))}(this,t):"ended"===t.type?function(t,e){t.ads.isInAdMode()?t.ads.isContentResuming()?(c(0,e),t.trigger("resumeended")):u(t,"ad",e):t.ads._contentHasEnded||t.ads.stitchedAds()||(u(t,"content",e),t.trigger("readyforpostroll"))}(this,t):"loadstart"===t.type||"loadeddata"===t.type||"loadedmetadata"===t.type?function(t,e){if(!("loadstart"===e.type&&!t.ads._hasThereBeenALoadStartDuringPlayerLife||"loadeddata"===e.type&&!t.ads._hasThereBeenALoadedData||"loadedmetadata"===e.type&&!t.ads._hasThereBeenALoadedMetaData))if(t.ads.inAdBreak())u(t,"ad",e);else{if(t.currentSrc()!==t.ads.contentSrc)return;u(t,"content",e)}}(this,t):"play"===t.type?function(t,e){t.ads.inAdBreak()?u(t,"ad",e):t.ads.isContentResuming()&&u(t,"content",e)}(this,t):this.ads.isInAdMode()&&(this.ads.isContentResuming()?u(this,"content",t):u(this,"ad",t))}function A(){return A=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},A.apply(this,arguments)}function p(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,g(t,e)}function g(t,e){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},g(t,e)}var y={},m=function(){!function(t){if(o().dom.isInFrame()&&"function"!=typeof a().__tcfapi){for(var e,n=a(),i={};n;){try{if(n.frames.__tcfapiLocator){e=n;break}}catch(t){}if(n===a().top)break;n=n.parent}if(!e)return;a().__tcfapi=function(t,n,o,r){var a=Math.random()+"",s={__tcfapiCall:{command:t,parameter:r,version:n,callId:a}};i[a]=o,e.postMessage(s,"*")},a().addEventListener("message",(function(t){var e={};try{e="string"==typeof t.data?JSON.parse(t.data):t.data}catch(t){}var n=e.__tcfapiReturn;n&&"function"==typeof i[n.callId]&&(i[n.callId](n.returnValue,n.success),i[n.callId]=null)}),!1)}}(),"function"==typeof a().__tcfapi&&a().__tcfapi("addEventListener",2,(function(t,e){e&&(y=t)}))},f="",v=function(t,e){if(void 0===e&&(e=a()),e.__uspapi)e.__uspapi("getUSPData",1,(function(e,n){var i=n?e.uspString:null;f=i,t(i)}));else{var n=function(t){for(var e=t.parent;e!==t.top;){try{if(e.frames&&e.frames.__uspapiLocator)return e}catch(t){}e=e.parent}try{if(t.top.frames&&t.top.frames.__uspapiLocator)return t.top}catch(t){}return null}(e);if(!n)return void t(null);var i=Math.random().toString(36).substring(2),o={__uspapiCall:{command:"getUSPData",version:1,callId:i}};e.addEventListener("message",(function n(o){if(o&&o.data&&o.data.__uspapiReturn&&o.data.__uspapiReturn.callId===i){e.removeEventListener("message",n,!1);var r=o.data.__uspapiReturn,a=r.returnValue,s=r.success?a.uspString:null;f=s,t(s)}}),!1),n.postMessage(o,"*")}},C=function(t,e){return e?encodeURIComponent(t):t},b=function(t,e){var n={};return["description","tags","reference_id","ad_keys"].forEach((function(i){t&&t[i]?n["{mediainfo."+i+"}"]=t[i]:e["{mediainfo."+i+"}"]?n["{mediainfo."+i+"}"]=e["{mediainfo."+i+"}"]:n["{mediainfo."+i+"}"]=""})),["custom_fields","customFields"].forEach((function(e){!function(t,e,n){if(t&&t[n])for(var i=t[n],o=Object.keys(i),r=0;r<o.length;r++)e["{mediainfo."+n+"."+o[r]+"}"]=i[o[r]]}(t,n,e)})),n},P=function(t,e,n,i,r){for(var a in void 0===i&&(i={}),e){var s=i.hasOwnProperty(a)?i[a]:a;if(s.startsWith("r:"))try{var d=new RegExp(s.slice(2),"g");t=t.replace(d,C(e[a],n))}catch(t){r.ads.error({errorType:o().Error.AdsMacroReplacementFailed,macro:a,error:t}),o().log.warn('Unable to replace macro with regex "'+s+'". The provided regex may be invalid.')}else t=t.split(s).join(C(e[a],n))}return t};function S(t,e,n){void 0===e&&(e=!1),void 0===n&&(n={});var i=n.disableDefaultMacros||!1,r=n.macroNameOverrides||{};delete n.disableDefaultMacros,delete n.macroNameOverrides;var s=n;if(i)return P(t,s,e,r);var l,c,u,h=function(t){var e={},n=t.replace(/{([^}=]+)=([^}]*)}/g,(function(t,n,i){return e["{"+n+"}"]=i,"{"+n+"}"}));return{defaults:e,modifiedString:n}}(t),p=h.defaults,g=h.modifiedString;for(var m in t=g,A(s,{"{player.id}":(u=this).options_["data-player"]||u.id_,"{player.height}":u.currentHeight(),"{player.width}":u.currentWidth(),"{player.heightInt}":Math.round(u.currentHeight()),"{player.widthInt}":Math.round(u.currentWidth()),"{player.autoplay}":u.autoplay()?1:0,"{player.muted}":u.muted()?1:0,"{player.language}":u.language()||"","{mediainfo.id}":u.mediainfo?u.mediainfo.id:"","{mediainfo.name}":u.mediainfo?u.mediainfo.name:"","{mediainfo.duration}":u.mediainfo?u.mediainfo.duration:"","{player.duration}":u.duration(),"{player.durationInt}":Math.round(u.duration()),"{player.live}":u.duration()===1/0?1:0,"{player.pageUrl}":o().dom.isInFrame()?d().referrer:a().location.href,"{playlistinfo.id}":u.playlistinfo?u.playlistinfo.id:"","{playlistinfo.name}":u.playlistinfo?u.playlistinfo.name:"","{timestamp}":(new Date).getTime(),"{document.referrer}":d().referrer,"{window.location.href}":a().location.href,"{random}":Math.floor(1e12*Math.random())},b(this.mediainfo,p),(l=y,c={},Object.keys(l).forEach((function(t){c["{tcf."+t+"}"]=l[t]})),c["{tcf.gdprAppliesInt}"]=l.gdprApplies?1:0,c),{"{usp.uspString}":f},function(t,e,n){var i=new RegExp("{pageVariable\\.([^}]+)}","g"),r={},s=(t.match(i)||[]).concat(Object.keys(n).filter((function(e){return i.test(e)&&t.includes(n[e])})));if(s)return s.forEach((function(t){for(var n,i=t,s=t.slice(14,-1),d=s.split("."),l=a(),c=0;c<d.length;c++)if(c===d.length-1)n=l[d[c]];else if(void 0===(l=l[d[c]]))break;var u=typeof n;null===n?r[i]="null":void 0===n?e[i]?r[i]=e[i]:(o().log.warn('Page variable "'+s+'" not found'),r[i]=""):"string"!==u&&"number"!==u&&"boolean"!==u?(o().log.warn('Page variable "'+s+'" is not a supported type'),r[i]=""):r[i]=n})),r}(t,p,r)),t=P(t,s,e,r,this),p)t=t.replace(m,p[m]);return t}var k={processMetadataTracks:function(t,e){for(var n=t.textTracks(),i=function(n){"metadata"===n.kind&&(t.ads.cueTextTracks.setMetadataTrackMode(n),e(t,n))},o=0;o<n.length;o++)i(n[o]);n.addEventListener("addtrack",(function(t){i(t.track)}))},setMetadataTrackMode:function(t){},getSupportedAdCue:function(t,e){return e},isSupportedAdCue:function(t,e){return!0},getCueId:function(t,e){return e.id}},w=function(t,e){return void 0!==e&&t.ads.includedCues[e]},E=function(t,e){void 0!==e&&""!==e&&(t.ads.includedCues[e]=!0)};function M(){!1!==this.ads._shouldBlockPlay&&(this.paused()||(this.ads.debug("Playback was canceled by cancelContentPlay"),this.pause()),this.ads._cancelledPlay=!0)}k.processAdTrack=function(t,e,n,i){t.ads.includedCues={};for(var r=0;r<e.length;r++){var a=e[r],s=this.getSupportedAdCue(t,a);if(!this.isSupportedAdCue(t,a))return void o().log.warn("Skipping as this is not a supported ad cue.",a);var d=this.getCueId(t,a),l=a.startTime;if(w(t,d))return void o().log("Skipping ad already seen with ID "+d);i&&i(t,s,d,l),n(t,s,d,l),E(t,d)}};var T={},L=o();T.isMiddlewareMediatorSupported=function(){return!L.browser.IS_IOS&&!L.browser.IS_ANDROID&&!!(L.use&&L.middleware&&L.middleware.TERMINATOR)},T.playMiddleware=function(t){return{setSource:function(t,e){e(null,t)},callPlay:function(){if(t.ads&&!0===t.ads._shouldBlockPlay)return t.ads.debug("Using playMiddleware to block content playback"),t.ads._playBlocked=!0,L.middleware.TERMINATOR},play:function(e,n){t.ads&&t.ads._playBlocked&&e?(t.ads.debug("Play call to Tech was terminated."),t.trigger("play"),t.addClass("vjs-has-started"),t.ads._playBlocked=!1):n&&n.catch&&n.catch((function(e){"NotAllowedError"!==e.name||o().browser.IS_SAFARI||t.trigger("pause")}))}}},T.testHook=function(t){L=t};var R=T.playMiddleware,D=T.isMiddlewareMediatorSupported;var I={src:"data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAAMFbW9vdgAAAGxtdmhkAAAAAAAAAAAAAAAAAAAD6AAAACgAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAjB0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAABAAAAAAAAACgAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAABQAAAALQAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAAoAAAAAAABAAAAAAGobWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAAyAAAAAgBVxAAAAAAALWhkbHIAAAAAAAAAAHZpZGUAAAAAAAAAAAAAAABWaWRlb0hhbmRsZXIAAAABU21pbmYAAAAUdm1oZAAAAAEAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAARNzdGJsAAAAr3N0c2QAAAAAAAAAAQAAAJ9hdmMxAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAABQAC0ABIAAAASAAAAAAAAAABFExhdmM2MC4zLjEwMCBsaWJ4MjY0AAAAAAAAAAAAAAAAGP//AAAANWF2Y0MBZAAf/+EAGGdkAB/zZQFAFuhAAAADAEAAAAyDxgxlgAEABmjr48siwPz4+AAAAAAUYnRydAAAAAAAArEQAAKxEAAAABhzdHRzAAAAAAAAAAEAAAABAAACAAAAABxzdHNjAAAAAAAAAAEAAAABAAAAAQAAAAEAAAAUc3RzegAAAAAAAANyAAAAAQAAABRzdGNvAAAAAAAAAAEAAAM1AAAAYXVkdGEAAABZbWV0YQAAAAAAAAAhaGRscgAAAAAAAAAAbWRpcmFwcGwAAAAAAAAAAAAAAAAsaWxzdAAAACSpdG9vAAAAHGRhdGEAAAABAAAAAExhdmY2MC4zLjEwMAAAAAhmcmVlAAADem1kYXQAAAKvBgX//6vcRem95tlIt5Ys2CDZI+7veDI2NCAtIGNvcmUgMTY0IHIzMDk1IGJhZWU0MDAgLSBILjI2NC9NUEVHLTQgQVZDIGNvZGVjIC0gQ29weWxlZnQgMjAwMy0yMDIyIC0gaHR0cDovL3d3dy52aWRlb2xhbi5vcmcveDI2NC5odG1sIC0gb3B0aW9uczogY2FiYWM9MSByZWY9MyBkZWJsb2NrPTE6MDowIGFuYWx5c2U9MHgzOjB4MTEzIG1lPWhleCBzdWJtZT03IHBzeT0xIHBzeV9yZD0xLjAwOjAuMDAgbWl4ZWRfcmVmPTEgbWVfcmFuZ2U9MTYgY2hyb21hX21lPTAgdHJlbGxpcz0xIDh4OGRjdD0xIGNxbT0wIGRlYWR6b25lPTIxLDExIGZhc3RfcHNraXA9MSBjaHJvbWFfcXBfb2Zmc2V0PS0yIHRocmVhZHM9MTIgbG9va2FoZWFkX3RocmVhZHM9MiBzbGljZWRfdGhyZWFkcz0wIG5yPTAgZGVjaW1hdGU9MSBpbnRlcmxhY2VkPTAgYmx1cmF5X2NvbXBhdD0wIGNvbnN0cmFpbmVkX2ludHJhPTAgYmZyYW1lcz0zIGJfcHlyYW1pZD0yIGJfYWRhcHQ9MSBiX2JpYXM9MCBkaXJlY3Q9MSB3ZWlnaHRiPTEgb3Blbl9nb3A9MCB3ZWlnaHRwPTIga2V5aW50PTI1MCBrZXlpbnRfbWluPTI1IHNjZW5lY3V0PTQwIGludHJhX3JlZnJlc2g9MCByY19sb29rYWhlYWQ9NDAgcmM9Y3JmIG1idHJlZT0xIGNyZj0yMy4wIHFjb21wPTAuNjAgcXBtaW49MCBxcG1heD02OSBxcHN0ZXA9NCBpcF9yYXRpbz0xLjQwIGFxPTE6MS4wMACAAAAAu2WIhAAr//712/Msrm6aNt72NzYJPxaInwAZmgAAAwAAAwAAAwAAFmhoUruNAYyHgAAAAwAAHDAAjoAFsABLAATIAGCACcgA/QAbAAN4AISAFoADHAAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAASUE=",type:"video/mp4"},j=function(){function t(){}return t.getState=function(e){if(e)return t.states_&&t.states_[e]?t.states_[e]:void 0},t.registerState=function(e,n){if("string"!=typeof e||!e)throw new Error('Illegal state name, "'+e+'"; must be a non-empty string.');return t.states_||(t.states_={}),t.states_[e]=n,n},t}(),B=function(){function t(t){this.player=t}t._getName=function(){return"Anonymous State"};var e=t.prototype;return e.transitionTo=function(t){var e=this.player;this.cleanup(e);var n=new t(e);e.ads._state=n,e.ads.debug(this.constructor._getName()+" -> "+n.constructor._getName());for(var i=arguments.length,o=new Array(i>1?i-1:0),r=1;r<i;r++)o[r-1]=arguments[r];n.init.apply(n,[e].concat(o))},e.init=function(){},e.cleanup=function(){},e.onPlay=function(){},e.onPlaying=function(){},e.onEnded=function(){},e.onAdEnded=function(){},e.onAdsReady=function(){o().log.warn("Unexpected adsready event")},e.onAdsError=function(){},e.onAdsCanceled=function(){},e.onAdTimeout=function(){},e.onAdStarted=function(){},e.onAdSkipped=function(){},e.onContentChanged=function(){},e.onContentResumed=function(){},e.onReadyForPostroll=function(){o().log.warn("Unexpected readyforpostroll event")},e.onNoPreroll=function(){},e.onNoPostroll=function(){},e.startLinearAdMode=function(){o().log.warn("Unexpected startLinearAdMode invocation (State via "+this.constructor._getName()+")")},e.endLinearAdMode=function(){o().log.warn("Unexpected endLinearAdMode invocation (State via "+this.constructor._getName()+")")},e.skipLinearAdMode=function(){o().log.warn("Unexpected skipLinearAdMode invocation (State via "+this.constructor._getName()+")")},e.isAdState=function(){throw new Error("isAdState unimplemented for "+this.constructor._getName())},e.isWaitingForAdBreak=function(){return!1},e.isContentResuming=function(){return!1},e.inAdBreak=function(){return!1},e.handleEvent=function(t){var e=this.player;"play"===t?this.onPlay(e):"adsready"===t?this.onAdsReady(e):"adserror"===t?this.onAdsError(e):"adscanceled"===t?this.onAdsCanceled(e):"adtimeout"===t?this.onAdTimeout(e):"ads-ad-started"===t?this.onAdStarted(e):"ads-ad-skipped"===t?this.onAdSkipped(e):"contentchanged"===t?this.onContentChanged(e):"contentresumed"===t?this.onContentResumed(e):"readyforpostroll"===t?this.onReadyForPostroll(e):"playing"===t?this.onPlaying(e):"ended"===t?this.onEnded(e):"nopreroll"===t?this.onNoPreroll(e):"nopostroll"===t?this.onNoPostroll(e):"adended"===t&&this.onAdEnded(e)},t}();j.registerState("State",B);var _=function(t){function e(e){var n;return(n=t.call(this,e)||this).contentResuming=!1,n.waitingForAdBreak=!1,n}p(e,t);var n=e.prototype;return n.isAdState=function(){return!0},n.onPlaying=function(){var t=j.getState("ContentPlayback");this.contentResuming&&this.transitionTo(t)},n.onContentResumed=function(){var t=j.getState("ContentPlayback");this.contentResuming&&this.transitionTo(t)},n.isWaitingForAdBreak=function(){return this.waitingForAdBreak},n.isContentResuming=function(){return this.contentResuming},n.inAdBreak=function(){return!0===this.player.ads._inLinearAdMode},e}(B);j.registerState("AdState",_);var F=function(t){function e(){return t.apply(this,arguments)||this}p(e,t);var n=e.prototype;return n.isAdState=function(){return!1},n.onContentChanged=function(t){var e=j.getState("BeforePreroll"),n=j.getState("Preroll");t.ads.debug("Received contentchanged event (ContentState)"),t.paused()?this.transitionTo(e):(this.transitionTo(n,!1),t.pause(),t.ads._pausedOnContentupdate=!0)},e}(B);j.registerState("ContentState",F);var W,N=function(t){function e(){return t.apply(this,arguments)||this}p(e,t),e._getName=function(){return"AdsDone"};var n=e.prototype;return n.init=function(t){t.ads._contentHasEnded=!0,t.trigger("ended")},n.startLinearAdMode=function(){o().log.warn("Unexpected startLinearAdMode invocation (AdsDone)")},e}(j.getState("ContentState"));j.registerState("AdsDone",N);var O={start:function(t){t.ads.debug("Starting ad break"),t.ads._inLinearAdMode=!0,t.trigger("adstart"),t.ads.shouldTakeSnapshots()&&(t.ads.snapshot=function(t){var e;e=o().browser.IS_IOS&&t.ads.isLive(t)&&t.seekable().length>0?t.currentTime()-t.seekable().end(0):t.currentTime();var n=t.$(".vjs-tech"),i=t.textTracks?t.textTracks():[],r=[],a={ended:t.ended(),currentSrc:t.currentSrc(),sources:t.currentSources(),src:t.tech_.src(),currentTime:e,type:t.currentType()};n&&(a.style=n.getAttribute("style"));for(var s=0;s<i.length;s++){var d=i[s];r.push({track:d,mode:d.mode}),d.mode="disabled"}return a.suppressedTracks=r,a}(t)),t.ads.shouldPlayContentBehindAd(t)&&!t.ads.settings.stitchedAds&&(t.ads.preAdVolume_=t.volume(),t.volume(0)),t.addClass("vjs-ad-playing"),t.hasClass("vjs-live")&&t.removeClass("vjs-live"),t.ads.removeNativePoster(),t.ads.preAdPlaybackRate_=t.playbackRate(),t.playbackRate(1),t.controlBar&&t.controlBar.playbackRateMenuButton&&t.controlBar.playbackRateMenuButton.playbackRateSupported&&!t.controlBar.playbackRateMenuButton.hasClass("vjs-hidden")?(t.controlBar.playbackRateMenuButton.hide(),t.ads.showPlaybackMenuOnAdEnd_=!0):t.ads.showPlaybackMenuOnAdEnd_=!1},end:function(t,e){t.ads.debug("Ending ad break"),void 0===e&&(e=function(){}),t.ads.adType=null,t.ads._inLinearAdMode=!1,t.trigger("adend"),t.removeClass("vjs-ad-playing"),t.ads.isLive(t)&&t.addClass("vjs-live"),t.ads.shouldTakeSnapshots()?function(t,e){var n=t.ads.snapshot;if(void 0===e&&(e=function(){}),!0===t.ads.disableNextSnapshotRestore)return t.ads.disableNextSnapshotRestore=!1,delete t.ads.snapshot,void e();var i,r=t.$(".vjs-tech"),a=20,s=n.suppressedTracks,d=function(){for(var t=0;t<s.length;t++)(i=s[t]).track.mode=i.mode},l=function(){var e;if(o().browser.IS_IOS&&t.ads.isLive(t)){if(n.currentTime<0&&(e=t.seekable().length>0?t.seekable().end(0)+n.currentTime:t.currentTime(),t.currentTime(e)),t.paused()){var i=t.play();i&&i.catch&&i.catch((function(t){o().log.warn("Play promise rejected in IOS snapshot resume",t)}))}}else if(n.ended)t.currentTime(t.duration());else{t.currentTime(n.currentTime);var r=t.play();r&&r.catch&&r.catch((function(t){o().log.warn("Play promise rejected in snapshot resume",t)}))}t.ads.shouldRemoveAutoplay_&&(t.autoplay(!1),t.ads.shouldRemoveAutoplay_=!1)},c=function e(){if(t.off("contentcanplay",e),W&&t.clearTimeout(W),(r=t.el().querySelector(".vjs-tech")).readyState>1)return l();if(void 0===r.seekable)return l();if(r.seekable.length>0)return l();if(a--)t.setTimeout(e,50);else try{l()}catch(e){t.ads.error({errorType:o().Error.AdsResumeContentFailed,error:e}),o().log.warn("Failed to resume the content after an advertisement",e)}};if("style"in n&&r.setAttribute("style",n.style||""),t.ads.videoElementRecycled())t.one("resumeended",(function(){delete t.ads.snapshot,e()})),t.one("contentloadedmetadata",d),o().browser.IS_IOS&&!t.autoplay()&&"function"==typeof t.techCall_&&(t.techCall_("setAutoplay",!0),t.ads.shouldRemoveAutoplay_=!0),t.src(n.sources),t.one("contentcanplay",c),W=t.setTimeout(c,2e3);else{if(d(),!t.ended()){var u=t.play();u&&u.catch&&u.catch((function(t){o().log.warn("Play promise rejected in snapshot restore",t)}))}delete t.ads.snapshot,e()}}(t,e):(t.ads.preAdVolume_&&t.volume(t.ads.preAdVolume_),e()),t.playbackRate(t.ads.preAdPlaybackRate_),t.ads.showPlaybackMenuOnAdEnd_&&t.controlBar.playbackRateMenuButton.show()}},U=function(t){function e(){return t.apply(this,arguments)||this}p(e,t),e._getName=function(){return"Preroll"};var n=e.prototype;return n.init=function(t,e,n){if(this.waitingForAdBreak=!0,t.addClass("vjs-ad-loading"),n||t.ads.nopreroll_)return this.resumeAfterNoPreroll(t);var i=t.ads.settings.timeout;"number"==typeof t.ads.settings.prerollTimeout&&(i=t.ads.settings.prerollTimeout),this._timeout=t.setTimeout((function(){t.trigger("adtimeout")}),i),e?this.handleAdsReady():this.adsReady=!1},n.onAdsReady=function(t){t.ads.inAdBreak()?o().log.warn("Unexpected adsready event (Preroll)"):(t.ads.debug("Received adsready event (Preroll)"),this.handleAdsReady())},n.handleAdsReady=function(){this.adsReady=!0,this.readyForPreroll()},n.afterLoadStart=function(t){var e=this.player;e.ads._hasThereBeenALoadStartDuringPlayerLife?t():(e.ads.debug("Waiting for loadstart..."),e.one("loadstart",(function(){e.ads.debug("Received loadstart event"),t()})))},n.noPreroll=function(){var t=this;this.afterLoadStart((function(){t.player.ads.debug("Skipping prerolls due to nopreroll event (Preroll)"),t.resumeAfterNoPreroll(t.player)}))},n.readyForPreroll=function(){var t=this.player;this.afterLoadStart((function(){t.ads.debug("Triggered readyforpreroll event (Preroll)"),t.trigger("readyforpreroll")}))},n.onAdsCanceled=function(t){var e=this;t.ads.debug("adscanceled (Preroll)"),this.afterLoadStart((function(){e.resumeAfterNoPreroll(t)}))},n.onAdsError=function(t){var e=this;o().log("adserror (Preroll)"),t.ads.error({errorType:o().Error.AdsPrerollError}),this.inAdBreak()?t.ads.endLinearAdMode():this.afterLoadStart((function(){e.resumeAfterNoPreroll(t)}))},n.startLinearAdMode=function(){var t=this.player;!this.adsReady||t.ads.inAdBreak()||this.isContentResuming()?o().log.warn("Unexpected startLinearAdMode invocation (Preroll)"):(this.clearTimeout(t),t.ads.adType="preroll",this.waitingForAdBreak=!1,O.start(t),t.ads._shouldBlockPlay=!1)},n.onAdStarted=function(t){t.removeClass("vjs-ad-loading")},n.endLinearAdMode=function(){var t=this.player;this.inAdBreak()&&(t.removeClass("vjs-ad-loading"),t.addClass("vjs-ad-content-resuming"),this.contentResuming=!0,O.end(t))},n.skipLinearAdMode=function(){var t=this,e=this.player;e.ads.inAdBreak()||this.isContentResuming()?o().log.warn("Unexpected skipLinearAdMode invocation"):this.afterLoadStart((function(){e.trigger("adskip"),e.ads.debug("skipLinearAdMode (Preroll)"),t.resumeAfterNoPreroll(e)}))},n.onAdTimeout=function(t){var e=this;this.afterLoadStart((function(){t.ads.debug("adtimeout (Preroll)"),e.resumeAfterNoPreroll(t)}))},n.onNoPreroll=function(t){t.ads.inAdBreak()||this.isContentResuming()?o().log.warn("Unexpected nopreroll event (Preroll)"):this.noPreroll()},n.resumeAfterNoPreroll=function(t){if(this.contentResuming=!0,t.ads._shouldBlockPlay=!1,this.cleanupPartial(t),t.ads._playRequested||t.ads._pausedOnContentupdate)if(t.paused()){t.ads.debug("resumeAfterNoPreroll: attempting to resume playback (Preroll)");var e=t.play();e&&e.then&&e.then(null,(function(t){}))}else t.ads.debug("resumeAfterNoPreroll: already playing (Preroll)"),t.trigger("play"),t.trigger("playing")},n.cleanup=function(t){t.ads._hasThereBeenALoadStartDuringPlayerLife||o().log.warn("Leaving Preroll state before loadstart event can cause issues."),this.cleanupPartial(t)},n.cleanupPartial=function(t){t.removeClass("vjs-ad-loading"),t.removeClass("vjs-ad-content-resuming"),this.clearTimeout(t)},n.clearTimeout=function(t){t.clearTimeout(this._timeout),this._timeout=null},e}(j.getState("AdState"));j.registerState("Preroll",U);var x=function(t){function e(){return t.apply(this,arguments)||this}p(e,t),e._getName=function(){return"BeforePreroll"};var n=e.prototype;return n.init=function(t){this.adsReady=!1,this.shouldResumeToContent=!1,t.ads._shouldBlockPlay=!t.ads.settings.allowVjsAutoplay||!t.autoplay()},n.onAdsReady=function(t){t.ads.debug("Received adsready event (BeforePreroll)"),this.adsReady=!0},n.onPlay=function(t){var e=j.getState("Preroll");t.ads.debug("Received play event (BeforePreroll)"),this.transitionTo(e,this.adsReady,this.shouldResumeToContent)},n.onAdsCanceled=function(t){t.ads.debug("adscanceled (BeforePreroll)"),this.shouldResumeToContent=!0},n.onAdsError=function(){this.player.ads.debug("adserror (BeforePreroll)"),this.player.ads.error({errorType:o().Error.BeforePrerollError}),this.shouldResumeToContent=!0},n.onNoPreroll=function(){this.player.ads.debug("Skipping prerolls due to nopreroll event (BeforePreroll)"),this.shouldResumeToContent=!0},n.skipLinearAdMode=function(){var t=this.player;t.trigger("adskip"),t.ads.debug("skipLinearAdMode (BeforePreroll)"),this.shouldResumeToContent=!0},n.onContentChanged=function(){this.init(this.player)},e}(j.getState("ContentState"));j.registerState("BeforePreroll",x);var V=function(t){function e(){return t.apply(this,arguments)||this}p(e,t),e._getName=function(){return"Midroll"};var n=e.prototype;return n.init=function(t){t.ads.adType="midroll",O.start(t),t.addClass("vjs-ad-loading")},n.onAdStarted=function(t){t.removeClass("vjs-ad-loading")},n.endLinearAdMode=function(){var t=this.player;this.inAdBreak()&&(this.contentResuming=!0,t.addClass("vjs-ad-content-resuming"),t.removeClass("vjs-ad-loading"),O.end(t))},n.onAdsError=function(t){t.ads.error({errorType:o().Error.AdsMidrollError}),this.inAdBreak()&&t.ads.endLinearAdMode()},n.cleanup=function(t){t.removeClass("vjs-ad-loading"),t.removeClass("vjs-ad-content-resuming")},e}(j.getState("AdState"));j.registerState("Midroll",V);var H=function(t){function e(){return t.apply(this,arguments)||this}p(e,t),e._getName=function(){return"Postroll"};var n=e.prototype;return n.init=function(t){if(this.waitingForAdBreak=!0,t.ads._contentEnding=!0,t.ads.nopostroll_){this.resumeContent(t);var e=j.getState("AdsDone");this.transitionTo(e)}else{t.addClass("vjs-ad-loading");var n=t.ads.settings.timeout;"number"==typeof t.ads.settings.postrollTimeout&&(n=t.ads.settings.postrollTimeout),this._postrollTimeout=t.setTimeout((function(){t.trigger("adtimeout")}),n)}},n.startLinearAdMode=function(){var t=this.player;t.ads.inAdBreak()||this.isContentResuming()?o().log.warn("Unexpected startLinearAdMode invocation (Postroll)"):(t.ads.adType="postroll",t.clearTimeout(this._postrollTimeout),this.waitingForAdBreak=!1,O.start(t))},n.onAdStarted=function(t){t.removeClass("vjs-ad-loading")},n.endLinearAdMode=function(){var t=this,e=this.player,n=j.getState("AdsDone");this.inAdBreak()&&(e.removeClass("vjs-ad-loading"),this.resumeContent(e),O.end(e,(function(){t.transitionTo(n)})))},n.skipLinearAdMode=function(){var t=this.player;t.ads.inAdBreak()||this.isContentResuming()?o().log.warn("Unexpected skipLinearAdMode invocation"):(t.ads.debug("Postroll abort (skipLinearAdMode)"),t.trigger("adskip"),this.abort(t))},n.onAdTimeout=function(t){t.ads.debug("Postroll abort (adtimeout)"),this.abort(t)},n.onAdsError=function(t){t.ads.debug("Postroll abort (adserror)"),t.ads.error({errorType:o().Error.AdsPostrollError}),t.ads.inAdBreak()?t.ads.endLinearAdMode():this.abort(t)},n.onContentChanged=function(t){if(this.isContentResuming()){var e=j.getState("BeforePreroll");this.transitionTo(e)}else if(!this.inAdBreak()){var n=j.getState("Preroll");this.transitionTo(n)}},n.onNoPostroll=function(t){this.isContentResuming()||this.inAdBreak()?o().log.warn("Unexpected nopostroll event (Postroll)"):this.abort(t)},n.resumeContent=function(t){this.contentResuming=!0,t.addClass("vjs-ad-content-resuming")},n.abort=function(t){var e=j.getState("AdsDone");this.resumeContent(t),t.removeClass("vjs-ad-loading"),this.transitionTo(e)},n.cleanup=function(t){t.removeClass("vjs-ad-content-resuming"),t.clearTimeout(this._postrollTimeout),t.ads._contentEnding=!1},e}(j.getState("AdState"));j.registerState("Postroll",H);var G=function(t){function e(){return t.apply(this,arguments)||this}p(e,t),e._getName=function(){return"ContentPlayback"};var n=e.prototype;return n.init=function(t){t.ads._shouldBlockPlay=!1},n.onAdsReady=function(t){t.ads.debug("Received adsready event (ContentPlayback)"),t.ads.nopreroll_||(t.ads.debug("Triggered readyforpreroll event (ContentPlayback)"),t.trigger("readyforpreroll"))},n.onReadyForPostroll=function(t){var e=j.getState("Postroll");t.ads.debug("Received readyforpostroll event"),this.transitionTo(e)},n.startLinearAdMode=function(){var t=j.getState("Midroll");this.transitionTo(t)},e}(j.getState("ContentState"));j.registerState("ContentPlayback",G);var z=function(t){function e(){return t.apply(this,arguments)||this}p(e,t),e._getName=function(){return"StitchedContentPlayback"};var n=e.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 t=j.getState("StitchedAdRoll");this.transitionTo(t)},e}(j.getState("ContentState"));j.registerState("StitchedContentPlayback",z);var Y=function(t){function e(){return t.apply(this,arguments)||this}p(e,t),e._getName=function(){return"StitchedAdRoll"};var n=e.prototype;return n.init=function(){this.waitingForAdBreak=!1,this.contentResuming=!1,this.player.ads.adType="stitched",O.start(this.player)},n.onPlaying=function(){},n.onContentResumed=function(){},n.onAdEnded=function(){this.endLinearAdMode(),this.player.trigger("ended")},n.endLinearAdMode=function(){var t=j.getState("StitchedContentPlayback");O.end(this.player),this.transitionTo(t)},e}(j.getState("AdState"));j.registerState("StitchedAdRoll",Y);var Z=function(t){function e(){return t.apply(this,arguments)||this}p(e,t),e._getName=function(){return"OutstreamPending"};var n=e.prototype;return n.init=function(t){this.adsReady=!1},n.onPlay=function(t){var e=j.getState("OutstreamPlayback");t.ads.debug("Received play event (OutstreamPending)"),this.transitionTo(e,this.adsReady)},n.onAdsReady=function(t){t.ads.debug("Received adsready event (OutstreamPending)"),this.adsReady=!0},n.onAdsError=function(){this.player.ads.debug("adserror (OutstreamPending)"),this.adsReady=!1},e}(j.getState("AdState"));j.registerState("OutstreamPending",Z);var q=function(t){function e(){return t.apply(this,arguments)||this}p(e,t),e._getName=function(){return"OutstreamPlayback"};var n=e.prototype;return n.init=function(t,e){t.addClass("vjs-ad-loading"),e?this.handleAdsReady():this.abort(t)},n.onAdsReady=function(t){t.ads.inAdBreak()?o().log.warn("Unexpected adsready event (Preroll)"):(t.ads.debug("Received adsready event (Preroll)"),this.handleAdsReady())},n.abort=function(t){var e=j.getState("OutstreamDone");t.removeClass("vjs-ad-loading"),this.transitionTo(e)},n.onAdStarted=function(t){t.removeClass("vjs-ad-loading")},n.handleAdsReady=function(){this.adsReady=!0,this.readyForOutstreamPlayback()},n.readyForOutstreamPlayback=function(){var t=this.player;this.afterLoadStart((function(){t.trigger("readyforoutstream")}))},n.startLinearAdMode=function(){var t=this.player;this.adsReady&&!t.ads.inAdBreak()&&O.start(t)},n.cleanup=function(t){t.ads._hasThereBeenALoadStartDuringPlayerLife||o().log.warn("Leaving OutstreamPlayback state before loadstart event can cause issues."),this.cleanupPartial(t)},n.cleanupPartial=function(t){t.removeClass("vjs-ad-loading"),t.removeClass("vjs-ad-content-resuming"),this.clearTimeout(t)},n.clearTimeout=function(t){t.clearTimeout(this._timeout),this._timeout=null},n.onAdStarted=function(t){t.removeClass("vjs-ad-loading")},n.onAdsError=function(t){var e=this;o().log("adserror (OutstreamPlayback)"),this.inAdBreak()?t.ads.endLinearAdMode():this.afterLoadStart((function(){e.abort(t)}))},n.onAdTimeout=function(t){var e=this;this.afterLoadStart((function(){t.ads.debug("adtimeout (OutstreamPlayback)"),e.abort(t)}))},n.onAdsCanceled=function(t){var e=this;t.ads.debug("adscanceled (OutstreamPlaybac)"),this.afterLoadStart((function(){e.abort(t)}))},n.endLinearAdMode=function(){var t=this;if(this.inAdBreak()){this.player.removeClass("vjs-ad-loading");var e=j.getState("OutstreamDone");O.end(this.player,(function(){t.transitionTo(e)}))}},n.afterLoadStart=function(t){var e=this.player;e.ads._hasThereBeenALoadStartDuringPlayerLife?t():(e.ads.debug("Waiting for loadstart..."),e.one("loadstart",(function(){e.ads.debug("Received loadstart event"),t()})))},n.skipLinearAdMode=function(){var t=this,e=this.player,n=j.getState("OutstreamDone");this.inAdBreak()?o().log.warn("Unexpected skipLinearAdMode invocation"):this.afterLoadStart((function(){e.trigger("adskip"),e.ads.debug("skipLinearAdMode (OutstreamPlayback)"),t.transitionTo(n)}))},e}(j.getState("AdState"));j.registerState("OutstreamPlayback",q);var Q=function(t){function e(){return t.apply(this,arguments)||this}p(e,t),e._getName=function(){return"OutstreamDone"};var n=e.prototype;return n.init=function(t){t.trigger("ended")},n.startLinearAdMode=function(){o().log.warn("Unexpected startLinearAdMode invocation (OutstreamDone)")},e}(j.getState("AdState"));j.registerState("OutstreamDone",Q);var J=T.isMiddlewareMediatorSupported,X=o().getTech("Html5").Events,K={timeout:5e3,prerollTimeout:void 0,postrollTimeout:void 0,debug:!1,stitchedAds:!1,contentIsLive:void 0,liveCuePoints:!0,allowVjsAutoplay:o().options.normalizeAutoplay||!1},$=function(t){var e=this,n=o().obj.merge(K,t),i=[];X.concat(["firstplay","loadedalldata"]).forEach((function(t){-1===i.indexOf(t)&&i.push(t)})),e.on(i,h),J()||function(t,e){e&&o().log("Using cancelContentPlay to block content playback"),t.on("play",M)}(e,n.debug),e.setTimeout((function(){e.ads._hasThereBeenALoadStartDuringPlayerLife||""===e.src()||o().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),e.on("ended",(function(){e.hasClass("vjs-has-started")||e.addClass("vjs-has-started")})),e.on("contenttimeupdate",(function(){e.removeClass("vjs-waiting")})),e.on(["addurationchange","adcanplay"],(function(){if(!e.ads.settings.stitchedAds&&!e.hasStarted()&&(!e.ads.snapshot||e.currentSrc()!==e.ads.snapshot.currentSrc)&&e.ads.inAdBreak()){var t=e.play();t&&t.catch&&t.catch((function(t){o().log.warn("Play promise rejected when playing ad",t)}))}})),e.on("nopreroll",(function(){e.ads.debug("Received nopreroll event"),e.ads.nopreroll_=!0})),e.on("nopostroll",(function(){e.ads.debug("Received nopostroll event"),e.ads.nopostroll_=!0})),e.on("playing",(function(){e.ads._cancelledPlay=!1,e.ads._pausedOnContentupdate=!1})),e.on("play",(function(){e.ads._playRequested=!0})),e.one("loadstart",(function(){e.ads._hasThereBeenALoadStartDuringPlayerLife=!0})),e.on("loadeddata",(function(){e.ads._hasThereBeenALoadedData=!0})),e.on("loadedmetadata",(function(){e.ads._hasThereBeenALoadedMetaData=!0})),e.ads=function(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:l,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 void 0!==t&&(o().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 new 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(e){return void 0===e&&(e=t),"boolean"==typeof e.ads.settings.contentIsLive?e.ads.settings.contentIsLive:e.duration()===1/0||"8"===o().browser.IOS_VERSION&&0===e.duration()},shouldPlayContentBehindAd:function(e){if(void 0===e&&(e=t),e)return!!e.ads.settings.liveCuePoints&&!o().browser.IS_IOS&&!o().browser.IS_ANDROID&&e.duration()===1/0;throw new Error("shouldPlayContentBehindAd requires a player as a param")},shouldTakeSnapshots:function(e){return void 0===e&&(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){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];1===e.length&&"string"==typeof e[0]?o().log("ADS: "+e[0]):o().log.apply(o(),["ADS:"].concat(e))}},error:function(e){if(void 0===e)return this._error||null;null!==e&&e.errorType?(this._error=e,o().log.error("An error with Ads occured. Type: "+e.errorType+"."),t.trigger({type:"vjsadserror",error:this._error})):this._error=null}}}(e),e.ads.settings=n,n.stitchedAds=!!n.stitchedAds,"outstream"===n.playerMode?(e.src(I),e.ads._state=new(j.getState("OutstreamPending"))(e)):n.stitchedAds?e.ads._state=new(j.getState("StitchedContentPlayback"))(e):e.ads._state=new(j.getState("BeforePreroll"))(e),e.ads._state.init(e),e.ads.cueTextTracks=k,e.ads.adMacroReplacement=S.bind(e),function(t){t.ads.contentSrc=t.currentSrc(),t.ads._seenInitialLoadstart=!1,t.on("loadstart",(function(){if(!t.ads.inAdBreak()){var e=t.currentSrc();e!==t.ads.contentSrc&&(t.ads._seenInitialLoadstart&&t.trigger({type:"contentchanged"}),t.trigger({type:"contentupdate",oldValue:t.ads.contentSrc,newValue:e}),t.ads.contentSrc=e),t.ads._seenInitialLoadstart=!0}}))}(e),e.on("contentchanged",e.ads.reset);var r=function(){var t=e.textTracks();if(!e.ads.shouldPlayContentBehindAd(e)&&e.ads.inAdBreak()&&e.tech_.featuresNativeTextTracks&&o().browser.IS_IOS&&!Array.isArray(e.textTracks()))for(var n=0;n<t.length;n++){var i=t[n];"showing"===i.mode&&(i.mode="disabled")}};e.ready((function(){e.textTracks().addEventListener("change",r)})),e.on(["play","playing","ended","adsready","adscanceled","adskip","adserror","adtimeout","adended","ads-ad-started","ads-ad-skipped","contentchanged","dispose","contentresumed","readyforpostroll","nopreroll","nopostroll"],(function(t){e.ads._state.handleEvent(t.type)})),e.on("dispose",(function(){e.ads.reset(),e.textTracks().removeEventListener("change",r)})),m(),v((function(){})),e.ads.listenToTcf=m,e.ads.updateUsPrivacyString=function(t){return v(t)}};$.VERSION=l,function(t){!function(){if(o().getPlugin)return Boolean(o().getPlugin("ads"));var t=o().getComponent("Player");return Boolean(t&&t.prototype.ads)}(o())&&((o().registerPlugin||o().plugin)("ads",t),D()&&!o().usingContribAdsMiddleware_&&(o().use("*",R),o().usingContribAdsMiddleware_=!0,o().log.debug("Play middleware has been registered with videojs")))}($);function tt(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function et(t){return et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},et(t)}function nt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function it(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,tt(i.key),i)}}function ot(t,e,n){return e&&it(t.prototype,e),n&&it(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function rt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function at(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return rt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?rt(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,o=function(){};return{s:o,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,r=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw r}}}}var st=function(t,e,n){this.vjsPlayer=t,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("contentended",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)),"onPlay"===this.controller.getSettings().requestMode&&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(e)};st.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)},st.prototype.updateCurrentTime=function(){this.contentPlayheadTracker.seeking||(this.contentPlayheadTracker.currentTime=this.vjsPlayer.currentTime())},st.prototype.checkForSeeking=function(){var t=1e3*(this.vjsPlayer.currentTime()-this.contentPlayheadTracker.previousTime);Math.abs(t)>this.seekCheckInterval+this.seekThreshold?this.contentPlayheadTracker.seeking=!0:this.contentPlayheadTracker.seeking=!1,this.contentPlayheadTracker.previousTime=this.vjsPlayer.currentTime()},st.prototype.checkForResize=function(){var t=this.getPlayerWidth(),e=this.getPlayerHeight();t==this.vjsPlayerDimensions.width&&e==this.vjsPlayerDimensions.height||(this.vjsPlayerDimensions.width=t,this.vjsPlayerDimensions.height=e,this.controller.onPlayerResize(t,e))},st.prototype.localContentEndedListener=function(){for(var t in this.contentComplete||(this.contentComplete=!0,this.controller.onContentComplete()),this.contentEndedListeners)"function"==typeof this.contentEndedListeners[t]&&this.contentEndedListeners[t]();this.vjsPlayer.el()&&this.vjsPlayer.one("play",this.setUpPlayerIntervals.bind(this))},st.prototype.onNoPostroll=function(){this.vjsPlayer.trigger("nopostroll")},st.prototype.playerDisposedListener=function(){this.contentEndedListeners=[],this.controller.onPlayerDisposed(),this.contentComplete=!0,this.vjsPlayer.off("contentended",this.boundContentEndedListener),this.vjsPlayer.ads.adTimeoutTimeout&&clearTimeout(this.vjsPlayer.ads.adTimeoutTimeout);var t=[this.updateTimeIntervalHandle,this.seekCheckIntervalHandle,this.resizeCheckIntervalHandle];for(var e in t)t[e]&&clearInterval(t[e])},st.prototype.onReadyForPreroll=function(){this.controller.onPlayerReadyForPreroll()},st.prototype.onAdTimeout=function(){this.controller.onAdTimeout()},st.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()},st.prototype.onFullscreenChange=function(){this.vjsPlayer.isFullscreen()?this.controller.onPlayerEnterFullscreen():this.controller.onPlayerExitFullscreen()},st.prototype.onVolumeChange=function(){var t=this.vjsPlayer.muted()?0:this.vjsPlayer.volume();this.controller.onPlayerVolumeChanged(t)},st.prototype.injectAdContainerDiv=function(t){this.vjsControls.el().parentNode.appendChild(t)},st.prototype.getContentPlayer=function(){return this.h5Player},st.prototype.getVolume=function(){return this.vjsPlayer.muted()?0:this.vjsPlayer.volume()},st.prototype.setVolume=function(t){this.vjsPlayer.volume(t),0==t?this.vjsPlayer.muted(!0):this.vjsPlayer.muted(!1)},st.prototype.unmute=function(){this.vjsPlayer.muted(!1)},st.prototype.mute=function(){this.vjsPlayer.muted(!0)},st.prototype.play=function(){this.vjsPlayer.play()},st.prototype.togglePlayback=function(){this.vjsPlayer.paused()?this.vjsPlayer.play():this.vjsPlayer.pause()},st.prototype.getPlayerWidth=function(){var t=(getComputedStyle(this.vjsPlayer.el())||{}).width;return t&&0!==parseFloat(t)||(t=(this.vjsPlayer.el().getBoundingClientRect()||{}).width),parseFloat(t)||this.vjsPlayer.width()},st.prototype.getPlayerHeight=function(){var t=(getComputedStyle(this.vjsPlayer.el())||{}).height;return t&&0!==parseFloat(t)||(t=(this.vjsPlayer.el().getBoundingClientRect()||{}).height),parseFloat(t)||this.vjsPlayer.height()},st.prototype.getPlayerOptions=function(){return this.vjsPlayer.options_},st.prototype.getPlayerId=function(){return this.vjsPlayer.id()},st.prototype.toggleFullscreen=function(){this.vjsPlayer.isFullscreen()?this.vjsPlayer.exitFullscreen():this.vjsPlayer.requestFullscreen()},st.prototype.getContentPlayheadTracker=function(){return this.contentPlayheadTracker},st.prototype.onAdError=function(t){this.vjsControls.show();var e=void 0!==t.getError?t.getError():t.stack;this.vjsPlayer.trigger({type:"adserror",data:{AdError:e,AdErrorEvent:t}})},st.prototype.onAdLog=function(t){var e=t.getAdData(),n=void 0!==e.adError?e.adError.getMessage():void 0;this.vjsPlayer.trigger({type:"adslog",data:{AdError:n,AdEvent:t}})},st.prototype.onAdBreakStart=function(){this.contentSource=this.vjsPlayer.currentSrc(),this.contentSourceType=this.vjsPlayer.currentType(),this.vjsPlayer.off("contentended",this.boundContentEndedListener),this.vjsPlayer.ads.startLinearAdMode(),this.vjsControls.hide(),this.vjsPlayer.pause()},st.prototype.onAdBreakEnd=function(){this.vjsPlayer.on("contentended",this.boundContentEndedListener),this.vjsPlayer.ads.inAdBreak()&&this.vjsPlayer.ads.endLinearAdMode(),this.vjsControls.show()},st.prototype.onAdStart=function(){this.vjsPlayer.trigger("ads-ad-started")},st.prototype.onAllAdsCompleted=function(){1==this.contentComplete&&(this.contentSource&&this.vjsPlayer.currentSrc()!=this.contentSource&&this.vjsPlayer.src({src:this.contentSource,type:this.contentSourceType}),this.controller.onContentAndAdsCompleted())},st.prototype.onAdsReady=function(){this.vjsPlayer.trigger("adsready")},st.prototype.changeSource=function(t){this.vjsPlayer.currentSrc()&&(this.vjsPlayer.currentTime(0),this.vjsPlayer.pause()),t&&this.vjsPlayer.src(t),this.vjsPlayer.one("loadedmetadata",this.seekContentToZero.bind(this))},st.prototype.seekContentToZero=function(){this.vjsPlayer.currentTime(0)},st.prototype.triggerPlayerEvent=function(t,e){this.vjsPlayer.trigger(t,e)},st.prototype.addContentEndedListener=function(t){this.contentEndedListeners.push(t)},st.prototype.reset=function(){this.vjsPlayer.off("contentended",this.boundContentEndedListener),this.vjsPlayer.on("contentended",this.boundContentEndedListener),this.vjsControls.show(),this.vjsPlayer.ads.inAdBreak()&&this.vjsPlayer.ads.endLinearAdMode(),this.contentPlayheadTracker.currentTime=0,this.contentComplete=!1};var dt=function(t){this.controller=t,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,!1===this.controller.getSettings().showCountdown&&(this.showCountdown=!1),this.isAdNonlinear=!1,this.createAdContainer()};dt.prototype.createAdContainer=function(){this.assignControlAttributes(this.adContainerDiv,"ima-ad-container"),this.adContainerDiv.style.position="absolute",this.adContainerDiv.style.zIndex=1111,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)},dt.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)},dt.prototype.onAdPlayPauseClick=function(){this.controller.onAdPlayPauseClick()},dt.prototype.onAdMuteClick=function(){this.controller.onAdMuteClick()},dt.prototype.onAdFullscreenClick=function(){this.controller.toggleFullscreen()},dt.prototype.onAdsPaused=function(){this.controller.sdkImpl.adPlaying=!1,this.addClass(this.playPauseDiv,"ima-paused"),this.removeClass(this.playPauseDiv,"ima-playing"),this.showAdControls()},dt.prototype.onAdsResumed=function(){this.onAdsPlaying(),this.showAdControls()},dt.prototype.onAdsPlaying=function(){this.controller.sdkImpl.adPlaying=!0,this.addClass(this.playPauseDiv,"ima-playing"),this.removeClass(this.playPauseDiv,"ima-paused")},dt.prototype.updateAdUi=function(t,e,n,i,o){var r=Math.floor(e/60),a=Math.floor(e%60);a.toString().length<2&&(a="0"+a);var s=": ";o>1&&(s=" ("+i+" "+this.controller.getSettings().adLabelNofN+" "+o+"): "),this.countdownDiv.innerHTML=this.controller.getSettings().adLabel+s+r+":"+a;var d=100*(t/n);this.progressDiv.style.width=d+"%"},dt.prototype.unmute=function(){this.addClass(this.muteDiv,"ima-non-muted"),this.removeClass(this.muteDiv,"ima-muted"),this.sliderLevelDiv.style.width=100*this.controller.getPlayerVolume()+"%"},dt.prototype.mute=function(){this.addClass(this.muteDiv,"ima-muted"),this.removeClass(this.muteDiv,"ima-non-muted"),this.sliderLevelDiv.style.width="0%"},dt.prototype.onAdVolumeSliderMouseDown=function(){document.addEventListener("mouseup",this.boundOnMouseUp,!1),document.addEventListener("mousemove",this.boundOnMouseMove,!1)},dt.prototype.onMouseMove=function(t){this.changeVolume(t)},dt.prototype.onMouseUp=function(t){this.changeVolume(t),document.removeEventListener("mouseup",this.boundOnMouseUp),document.removeEventListener("mousemove",this.boundOnMouseMove)},dt.prototype.changeVolume=function(t){var e=(t.clientX-this.sliderDiv.getBoundingClientRect().left)/this.sliderDiv.offsetWidth;e*=100,e=Math.min(Math.max(e,0),100),this.sliderLevelDiv.style.width=e+"%",0==this.percent?(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(e/100)},dt.prototype.showAdContainer=function(){this.adContainerDiv.style.display="block"},dt.prototype.hideAdContainer=function(){this.adContainerDiv.style.display="none"},dt.prototype.onAdContainerClick=function(){this.isAdNonlinear&&this.controller.togglePlayback()},dt.prototype.reset=function(){this.hideAdContainer()},dt.prototype.onAdError=function(){this.hideAdContainer()},dt.prototype.onAdBreakStart=function(t){this.showAdContainer(),"application/javascript"!==t.getAd().getContentType()||this.controller.getSettings().showControlsForJSAds?this.controlsDiv.style.display="block":this.controlsDiv.style.display="none",this.onAdsPlaying(),this.hideAdControls()},dt.prototype.onAdBreakEnd=function(){var t=this.controller.getCurrentAd();(null==t||t.isLinear())&&this.hideAdContainer(),this.controlsDiv.style.display="none",this.countdownDiv.innerHTML=""},dt.prototype.onAllAdsCompleted=function(){this.hideAdContainer()},dt.prototype.onLinearAdStart=function(){this.removeClass(this.adContainerDiv,"bumpable-ima-ad-container"),this.isAdNonlinear=!1},dt.prototype.onNonLinearAdLoad=function(){this.adContainerDiv.style.display="block",this.addClass(this.adContainerDiv,"bumpable-ima-ad-container"),this.isAdNonlinear=!0},dt.prototype.onPlayerEnterFullscreen=function(){this.addClass(this.fullscreenDiv,"ima-fullscreen"),this.removeClass(this.fullscreenDiv,"ima-non-fullscreen")},dt.prototype.onPlayerExitFullscreen=function(){this.addClass(this.fullscreenDiv,"ima-non-fullscreen"),this.removeClass(this.fullscreenDiv,"ima-fullscreen")},dt.prototype.onPlayerVolumeChanged=function(t){0==t?(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=100*t+"%")},dt.prototype.showAdControls=function(){this.controller.getSettings().disableAdControls||this.addClass(this.controlsDiv,"ima-controls-div-showing")},dt.prototype.hideAdControls=function(){this.removeClass(this.controlsDiv,"ima-controls-div-showing")},dt.prototype.assignControlAttributes=function(t,e){t.id=this.controlPrefix+e,t.className=this.controlPrefix+e+" "+e},dt.prototype.getClassRegexp=function(t){return new RegExp("(^|[^A-Za-z-])"+t+"((?![A-Za-z-])|$)","gi")},dt.prototype.elementHasClass=function(t,e){return this.getClassRegexp(e).test(t.className)},dt.prototype.addClass=function(t,e){t.className=t.className.trim()+" "+e},dt.prototype.removeClass=function(t,e){var n=this.getClassRegexp(e);t.className=t.className.trim().replace(n,"")},dt.prototype.getAdContainerDiv=function(){return this.adContainerDiv},dt.prototype.setShowCountdown=function(t){this.showCountdown=t,this.countdownDiv.style.display=this.showCountdown?"block":"none"};var lt="2.3.0",ct=function(t){this.controller=t,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,!1===this.controller.getSettings().autoPlayAdBreaks&&(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)};ct.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),0==this.controller.getSettings().vpaidAllowed&&this.adsLoader.getSettings().setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.DISABLED),void 0!==this.controller.getSettings().vpaidMode&&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(lt),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})},ct.prototype.requestAds=function(){var t=new google.ima.AdsRequest;if(this.controller.getSettings().adTagUrl?t.adTagUrl=this.controller.getSettings().adTagUrl:t.adsResponse=this.controller.getSettings().adsResponse,this.controller.getSettings().forceNonLinearFullSlot&&(t.forceNonLinearFullSlot=!0),this.controller.getSettings().vastLoadTimeout&&(t.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){t.omidAccessModeRules={};var e=this.controller.getSettings().omidVendorAccess;Object.keys(e).forEach((function(n){t.omidAccessModeRules[n]=e[n]}))}t.linearAdSlotWidth=this.controller.getPlayerWidth(),t.linearAdSlotHeight=this.controller.getPlayerHeight(),t.nonLinearAdSlotWidth=this.controller.getSettings().nonLinearWidth||this.controller.getPlayerWidth(),t.nonLinearAdSlotHeight=this.controller.getSettings().nonLinearHeight||this.controller.getPlayerHeight(),t.setAdWillAutoPlay(this.controller.adsWillAutoplay()),t.setAdWillPlayMuted(this.controller.adsWillPlayMuted());var n=this.controller.getSettings().adsRequest;n&&"object"===et(n)&&Object.keys(n).forEach((function(e){t[e]=n[e]})),this.adsLoader.requestAds(t),this.controller.playerWrapper.vjsPlayer.trigger({type:"ads-request",AdsRequest:t})},ct.prototype.onAdsManagerLoaded=function(t){this.createAdsRenderingSettings(),this.adsManager=t.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 e=this.controller.getSettings().preventLateAdStart;e?e&&!this.isAdTimedOut&&this.controller.onAdsReady():this.controller.onAdsReady(),this.controller.getSettings().adsManagerLoadedCallback&&this.controller.getSettings().adsManagerLoadedCallback()},ct.prototype.onAdsLoaderError=function(t){window.console.warn("AdsLoader error: "+t.getError()),this.controller.onErrorLoadingAds(t),this.adsManager&&this.adsManager.destroy()},ct.prototype.initAdsManager=function(){try{var t=this.controller.getPlayerWidth(),e=this.controller.getPlayerHeight();this.adsManagerDimensions.width=t,this.adsManagerDimensions.height=e,this.adsManager.init(t,e,google.ima.ViewMode.NORMAL),this.adsManager.setVolume(this.controller.getPlayerVolume()),this.initializeAdDisplayContainer()}catch(t){this.onAdError(t)}},ct.prototype.createAdsRenderingSettings=function(){if(this.adsRenderingSettings=new google.ima.AdsRenderingSettings,this.adsRenderingSettings.restoreCustomPlaybackStateOnAdBreakComplete=!0,this.controller.getSettings().adsRenderingSettings)for(var t in this.controller.getSettings().adsRenderingSettings)""!==t&&(this.adsRenderingSettings[t]=this.controller.getSettings().adsRenderingSettings[t])},ct.prototype.onAdError=function(t){var e=void 0!==t.getError?t.getError():t.stack;window.console.warn("Ad error: "+e),this.adsManager.destroy(),this.controller.onAdError(t),this.adsActive=!1,this.adPlaying=!1},ct.prototype.onAdBreakReady=function(t){this.adBreakReadyListener(t)},ct.prototype.onContentPauseRequested=function(t){this.adsActive=!0,this.adPlaying=!0,this.controller.onAdBreakStart(t)},ct.prototype.onContentResumeRequested=function(t){this.adsActive=!1,this.adPlaying=!1,this.controller.onAdBreakEnd()},ct.prototype.onAllAdsCompleted=function(t){this.allAdsCompleted=!0,this.controller.onAllAdsCompleted()},ct.prototype.onAdLoaded=function(t){t.getAd().isLinear()||(this.controller.onNonLinearAdLoad(),this.controller.playContent())},ct.prototype.onAdStarted=function(t){this.currentAd=t.getAd(),this.currentAd.isLinear()?(this.adTrackingTimer=setInterval(this.onAdPlayheadTrackerInterval.bind(this),250),this.controller.onLinearAdStart()):this.controller.onNonLinearAdStart()},ct.prototype.onAdPaused=function(){this.controller.onAdsPaused()},ct.prototype.onAdResumed=function(t){this.controller.onAdsResumed()},ct.prototype.onAdComplete=function(){this.currentAd.isLinear()&&clearInterval(this.adTrackingTimer)},ct.prototype.onAdLog=function(t){this.controller.onAdLog(t)},ct.prototype.onAdPlayheadTrackerInterval=function(){if(null!==this.adsManager){var t=this.adsManager.getRemainingTime(),e=this.currentAd.getDuration(),n=e-t;n=n>0?n:0;var i,o=0;this.currentAd.getAdPodInfo()&&(i=this.currentAd.getAdPodInfo().getAdPosition(),o=this.currentAd.getAdPodInfo().getTotalAds()),this.controller.onAdPlayheadUpdated(n,t,e,i,o)}},ct.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()},ct.prototype.onPlayerDisposed=function(){this.adTrackingTimer&&clearInterval(this.adTrackingTimer),this.adsManager&&(this.adsManager.destroy(),this.adsManager=null)},ct.prototype.onPlayerReadyForPreroll=function(){if(this.autoPlayAdBreaks){this.initAdsManager();try{this.controller.showAdContainer(),this.adsManager.setVolume(this.controller.getPlayerVolume()),this.adsManager.start()}catch(t){this.onAdError(t)}}},ct.prototype.onAdTimeout=function(){this.isAdTimedOut=!0},ct.prototype.onPlayerReady=function(){this.initAdObjects(),(this.controller.getSettings().adTagUrl||this.controller.getSettings().adsResponse)&&"onLoad"===this.controller.getSettings().requestMode&&this.requestAds()},ct.prototype.onPlayerEnterFullscreen=function(){this.adsManager&&this.adsManager.resize(window.screen.width,window.screen.height,google.ima.ViewMode.FULLSCREEN)},ct.prototype.onPlayerExitFullscreen=function(){this.adsManager&&this.adsManager.resize(this.controller.getPlayerWidth(),this.controller.getPlayerHeight(),google.ima.ViewMode.NORMAL)},ct.prototype.onPlayerVolumeChanged=function(t){this.adsManager&&this.adsManager.setVolume(t),this.adMuted=0==t},ct.prototype.onPlayerResize=function(t,e){this.adsManager&&(this.adsManagerDimensions.width=t,this.adsManagerDimensions.height=e,this.adsManager.resize(t,e,google.ima.ViewMode.NORMAL))},ct.prototype.getCurrentAd=function(){return this.currentAd},ct.prototype.setAdBreakReadyListener=function(t){this.adBreakReadyListener=t},ct.prototype.isAdPlaying=function(){return this.adPlaying},ct.prototype.isAdMuted=function(){return this.adMuted},ct.prototype.pauseAds=function(){this.adsManager.pause(),this.adPlaying=!1},ct.prototype.resumeAds=function(){this.adsManager.resume(),this.adPlaying=!0},ct.prototype.unmute=function(){this.adsManager.setVolume(1),this.adMuted=!1},ct.prototype.mute=function(){this.adsManager.setVolume(0),this.adMuted=!0},ct.prototype.setVolume=function(t){this.adsManager.setVolume(t),this.adMuted=0==t},ct.prototype.initializeAdDisplayContainer=function(){this.adDisplayContainer&&(this.adDisplayContainerInitialized||(this.adDisplayContainer.initialize(),this.adDisplayContainerInitialized=!0))},ct.prototype.playAdBreak=function(){this.autoPlayAdBreaks||(this.controller.showAdContainer(),this.adsManager.setVolume(this.controller.getPlayerVolume()),this.adsManager.start())},ct.prototype.addEventListener=function(t,e){this.adsManager&&this.adsManager.addEventListener(t,e)},ct.prototype.getAdsManager=function(){return this.adsManager},ct.prototype.reset=function(){this.adsActive=!1,this.adPlaying=!1,this.adTrackingTimer&&clearInterval(this.adTrackingTimer),this.adsManager&&(this.adsManager.destroy(),this.adsManager=null),this.adsLoader&&!this.contentCompleteCalled&&this.adsLoader.contentComplete(),this.contentCompleteCalled=!1,this.allAdsCompleted=!1};var ut=function(t,e){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(e);var n={debug:this.settings.debug,timeout:this.settings.timeout,prerollTimeout:this.settings.prerollTimeout},i=Object.assign({},n,e.contribAdsSettings||{});this.playerWrapper=new st(t,i,this),this.adUi=new dt(this),this.sdkImpl=new ct(this)};ut.IMA_DEFAULTS={adLabel:"Advertisement",adLabelNofN:"of",debug:!1,disableAdControls:!1,prerollTimeout:1e3,preventLateAdStart:!1,requestMode:"onLoad",showControlsForJSAds:!0,timeout:5e3},ut.prototype.initWithSettings=function(t){this.settings=Object.assign({},ut.IMA_DEFAULTS,t||{}),this.warnAboutDeprecatedSettings(),this.showCountdown=!0,!1===this.settings.showCountdown&&(this.showCountdown=!1)},ut.prototype.warnAboutDeprecatedSettings=function(){var t=this;["adWillAutoplay","adsWillAutoplay","adWillPlayMuted","adsWillPlayMuted"].forEach((function(e){void 0!==t.settings[e]&&console.warn("WARNING: videojs.ima setting "+e+" is deprecated")}))},ut.prototype.getSettings=function(){return this.settings},ut.prototype.getIsMobile=function(){return this.isMobile},ut.prototype.getIsIos=function(){return this.isIos},ut.prototype.injectAdContainerDiv=function(t){this.playerWrapper.injectAdContainerDiv(t)},ut.prototype.getAdContainerDiv=function(){return this.adUi.getAdContainerDiv()},ut.prototype.getContentPlayer=function(){return this.playerWrapper.getContentPlayer()},ut.prototype.getContentPlayheadTracker=function(){return this.playerWrapper.getContentPlayheadTracker()},ut.prototype.requestAds=function(){this.sdkImpl.requestAds()},ut.prototype.setSetting=function(t,e){this.settings[t]=e},ut.prototype.onErrorLoadingAds=function(t){this.adUi.onAdError(),this.playerWrapper.onAdError(t)},ut.prototype.onAdPlayPauseClick=function(){this.sdkImpl.isAdPlaying()?(this.adUi.onAdsPaused(),this.sdkImpl.pauseAds()):(this.adUi.onAdsPlaying(),this.sdkImpl.resumeAds())},ut.prototype.onAdMuteClick=function(){this.sdkImpl.isAdMuted()?(this.playerWrapper.unmute(),this.adUi.unmute(),this.sdkImpl.unmute()):(this.playerWrapper.mute(),this.adUi.mute(),this.sdkImpl.mute())},ut.prototype.setVolume=function(t){this.playerWrapper.setVolume(t),this.sdkImpl.setVolume(t)},ut.prototype.getPlayerVolume=function(){return this.playerWrapper.getVolume()},ut.prototype.toggleFullscreen=function(){this.playerWrapper.toggleFullscreen()},ut.prototype.onAdError=function(t){this.adUi.onAdError(),this.playerWrapper.onAdError(t)},ut.prototype.onAdBreakStart=function(t){this.playerWrapper.onAdBreakStart(),this.adUi.onAdBreakStart(t)},ut.prototype.showAdContainer=function(){this.adUi.showAdContainer()},ut.prototype.onAdBreakEnd=function(){this.playerWrapper.onAdBreakEnd(),this.adUi.onAdBreakEnd()},ut.prototype.onAllAdsCompleted=function(){this.adUi.onAllAdsCompleted(),this.playerWrapper.onAllAdsCompleted()},ut.prototype.onAdsPaused=function(){this.adUi.onAdsPaused()},ut.prototype.onAdsResumed=function(){this.adUi.onAdsResumed()},ut.prototype.onAdPlayheadUpdated=function(t,e,n,i,o){this.adUi.updateAdUi(t,e,n,i,o)},ut.prototype.onAdLog=function(t){this.playerWrapper.onAdLog(t)},ut.prototype.getCurrentAd=function(){return this.sdkImpl.getCurrentAd()},ut.prototype.playContent=function(){this.playerWrapper.play()},ut.prototype.onLinearAdStart=function(){this.adUi.onLinearAdStart(),this.playerWrapper.onAdStart()},ut.prototype.onNonLinearAdLoad=function(){this.adUi.onNonLinearAdLoad()},ut.prototype.onNonLinearAdStart=function(){this.adUi.onNonLinearAdLoad(),this.playerWrapper.onAdStart()},ut.prototype.getPlayerWidth=function(){return this.playerWrapper.getPlayerWidth()},ut.prototype.getPlayerHeight=function(){return this.playerWrapper.getPlayerHeight()},ut.prototype.onAdsReady=function(){this.playerWrapper.onAdsReady()},ut.prototype.onPlayerResize=function(t,e){this.sdkImpl.onPlayerResize(t,e)},ut.prototype.onContentComplete=function(){this.sdkImpl.onContentComplete()},ut.prototype.onNoPostroll=function(){this.playerWrapper.onNoPostroll()},ut.prototype.onContentAndAdsCompleted=function(){for(var t in this.contentAndAdsEndedListeners)"function"==typeof this.contentAndAdsEndedListeners[t]&&this.contentAndAdsEndedListeners[t]()},ut.prototype.onPlayerDisposed=function(){this.contentAndAdsEndedListeners=[],this.sdkImpl.onPlayerDisposed()},ut.prototype.onPlayerReadyForPreroll=function(){this.sdkImpl.onPlayerReadyForPreroll()},ut.prototype.onAdTimeout=function(){this.sdkImpl.onAdTimeout()},ut.prototype.onPlayerReady=function(){this.sdkImpl.onPlayerReady()},ut.prototype.onPlayerEnterFullscreen=function(){this.adUi.onPlayerEnterFullscreen(),this.sdkImpl.onPlayerEnterFullscreen()},ut.prototype.onPlayerExitFullscreen=function(){this.adUi.onPlayerExitFullscreen(),this.sdkImpl.onPlayerExitFullscreen()},ut.prototype.onPlayerVolumeChanged=function(t){this.adUi.onPlayerVolumeChanged(t),this.sdkImpl.onPlayerVolumeChanged(t)},ut.prototype.setContentWithAdTag=function(t,e){this.reset(),this.settings.adTagUrl=e||this.settings.adTagUrl,this.playerWrapper.changeSource(t)},ut.prototype.setContentWithAdsResponse=function(t,e){this.reset(),this.settings.adsResponse=e||this.settings.adsResponse,this.playerWrapper.changeSource(t)},ut.prototype.setContentWithAdsRequest=function(t,e){this.reset(),this.settings.adsRequest=e||this.settings.adsRequest,this.playerWrapper.changeSource(t)},ut.prototype.reset=function(){this.sdkImpl.reset(),this.playerWrapper.reset(),this.adUi.reset()},ut.prototype.addContentEndedListener=function(t){this.playerWrapper.addContentEndedListener(t)},ut.prototype.addContentAndAdsEndedListener=function(t){this.contentAndAdsEndedListeners.push(t)},ut.prototype.setAdBreakReadyListener=function(t){this.sdkImpl.setAdBreakReadyListener(t)},ut.prototype.setShowCountdown=function(t){this.adUi.setShowCountdown(t),this.showCountdown=t,this.adUi.countdownDiv.style.display=this.showCountdown?"block":"none"},ut.prototype.initializeAdDisplayContainer=function(){this.sdkImpl.initializeAdDisplayContainer()},ut.prototype.playAdBreak=function(){this.sdkImpl.playAdBreak()},ut.prototype.addEventListener=function(t,e){this.sdkImpl.addEventListener(t,e)},ut.prototype.getAdsManager=function(){return this.sdkImpl.getAdsManager()},ut.prototype.getPlayerId=function(){return this.playerWrapper.getPlayerId()},ut.prototype.changeAdTag=function(t){this.reset(),this.settings.adTagUrl=t},ut.prototype.pauseAd=function(){this.adUi.onAdsPaused(),this.sdkImpl.pauseAds()},ut.prototype.resumeAd=function(){this.adUi.onAdsPlaying(),this.sdkImpl.resumeAds()},ut.prototype.togglePlayback=function(){this.playerWrapper.togglePlayback()},ut.prototype.adsWillAutoplay=function(){return void 0!==this.settings.adsWillAutoplay?this.settings.adsWillAutoplay:void 0!==this.settings.adWillAutoplay?this.settings.adWillAutoplay:!!this.playerWrapper.getPlayerOptions().autoplay},ut.prototype.adsWillPlayMuted=function(){return void 0!==this.settings.adsWillPlayMuted?this.settings.adsWillPlayMuted:void 0!==this.settings.adWillPlayMuted?this.settings.adWillPlayMuted:void 0!==this.playerWrapper.getPlayerOptions().muted?this.playerWrapper.getPlayerOptions().muted:0==this.playerWrapper.getVolume()},ut.prototype.triggerPlayerEvent=function(t,e){this.playerWrapper.triggerPlayerEvent(t,e)};var ht=function(t,e,n){this.vjsPlayer=t,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(e)};ht.prototype.playerDisposedListener=function(){this.contentEndedListeners=[],this.daiController.onPlayerDisposed()},ht.prototype.onPause=function(){this.daiController.isInAdBreak()&&this.vjsControls.show()},ht.prototype.onPlay=function(){this.daiController.isInAdBreak()&&this.vjsControls.hide()},ht.prototype.onSeekEnd=function(){this.daiController.onSeekEnd(this.vjsPlayer.currentTime())},ht.prototype.onPlayerReady=function(){this.h5Player=document.getElementById(this.getPlayerId()).getElementsByClassName("vjs-tech")[0],this.daiController.onPlayerReady()},ht.prototype.getStreamPlayer=function(){return this.h5Player},ht.prototype.getVjsPlayer=function(){return this.vjsPlayer},ht.prototype.getPlayerOptions=function(){return this.vjsPlayer.options_},ht.prototype.getPlayerId=function(){return this.vjsPlayer.id()},ht.prototype.onAdError=function(t){this.vjsControls.show();var e=void 0!==t.getError?t.getError():t.stack;this.vjsPlayer.trigger({type:"adserror",data:{AdError:e,AdErrorEvent:t}})},ht.prototype.onAdBreakStart=function(){this.vjsControls.hide()},ht.prototype.onAdBreakEnd=function(){this.vjsControls.show()},ht.prototype.reset=function(){this.vjsControls.show()};var At=function(t){this.daiController=t,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"}};At.prototype.initImaDai=function(){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),this.streamManager.addEventListener([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],this.onStreamEvent.bind(this),!1),this.vjsPlayer.textTracks().onaddtrack=this.onAddTrack.bind(this),this.vjsPlayer.trigger({type:"stream-manager",StreamManager:this.streamManager}),this.requestStream()},At.prototype.onAddTrack=function(t){var e=this,n=t.track;"metadata"===n.kind&&(n.mode="hidden",n.addEventListener("cuechange",(function(t){var i,o=at(n.activeCues_);try{for(o.s();!(i=o.n()).done;){var r=i.value,a={};a[r.value.key]=r.value.data,e.streamManager.onTimedMetadata(a)}}catch(t){o.e(t)}finally{o.f()}})))},At.prototype.createAdUiDiv=function(){var t=document.createElement("div");t.id="ad-ui",t.style.height="calc(100% - 3em)",this.streamPlayer.parentNode.appendChild(t),this.adUiDiv=t},At.prototype.onStreamPause=function(){this.isAdBreak&&(this.adUiDiv.style.display="none")},At.prototype.onStreamPlay=function(){this.isAdBreak&&(this.adUiDiv.style.display="block")},At.prototype.onSeekEnd=function(t){if("live"!==this.daiController.getSettings().streamType)if(this.isSnapback)this.isSnapback=!1;else{var e=this.streamManager.previousCuePointForStreamTime(t);e&&!e.played&&(this.isSnapback=!0,this.snapForwardTime=t,this.vjsPlayer.currentTime(e.start))}},At.prototype.onStreamEvent=function(t){switch(t.type){case google.ima.dai.api.StreamEvent.Type.LOADED:this.loadUrl(t.getStreamData().url);break;case google.ima.dai.api.StreamEvent.Type.ERROR:window.console.warn("Error loading stream, attempting to play backup stream. "+t.getStreamData().errorMessage),this.daiController.onErrorLoadingAds(t),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)}},At.prototype.loadUrl=function(t){this.vjsPlayer.ready(function(){var e=this.daiController.getSettings().streamFormat;this.vjsPlayer.src({src:t,type:this.SOURCE_TYPES[e]});var n=this.daiController.getSettings().bookmarkTime;if(n){var i=this.streamManager.streamTimeForContentTime(n);this.isSnapback=!0,this.vjsPlayer.currentTime(i)}}.bind(this))},At.prototype.requestStream=function(){var t,e=this.daiController.getSettings().streamType;if("vod"===e?((t=new google.ima.dai.api.VODStreamRequest).contentSourceId=this.daiController.getSettings().cmsId,t.videoId=this.daiController.getSettings().videoId):"live"===e?(t=new google.ima.dai.api.LiveStreamRequest).assetKey=this.daiController.getSettings().assetKey:window.console.warn("No valid stream type selected"),t.format=this.daiController.getSettings().streamFormat,this.daiController.getSettings().apiKey&&(t.apiKey=this.daiController.getSettings().apiKey),this.daiController.getSettings().authToken&&(t.authToken=this.daiController.getSettings().authToken),this.daiController.getSettings().adTagParameters&&(t.adTagParameters=this.daiController.getSettings().adTagParameters),this.daiController.getSettings().streamActivityMonitorId&&(t.streamActivityMonitorId=this.daiController.getSettings().streamActivityMonitorId),this.daiController.getSettings().omidMode){t.omidAccessModeRules={};var n=this.daiController.getSettings().omidMode;n.FULL&&(t.omidAccessModeRules[google.ima.OmidAccessMode.FULL]=n.FULL),n.DOMAIN&&(t.omidAccessModeRules[google.ima.OmidAccessMode.DOMAIN]=n.DOMAIN),n.LIMITED&&(t.omidAccessModeRules[google.ima.OmidAccessMode.LIMITED]=n.LIMITED)}this.streamManager.requestStream(t),this.vjsPlayer.trigger({type:"stream-request",StreamRequest:t})},At.prototype.onPlayerReady=function(){this.initImaDai()},At.prototype.onPlayerDisposed=function(){this.streamManager&&this.streamManager.reset()},At.prototype.getStreamManager=function(){return this.StreamManager},At.prototype.reset=function(){this.StreamManager&&this.StreamManager.reset()};var pt=function(t,e){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(e);var n={debug:this.settings.debug,timeout:this.settings.timeout,prerollTimeout:this.settings.prerollTimeout},i=Object.assign({},n,e.contribAdsSettings||{});this.playerWrapper=new ht(t,i,this),this.sdkImpl=new At(this)};pt.IMA_DEFAULTS={adLabel:"Advertisement",adLabelNofN:"of",debug:!1,disableAdControls:!1,showControlsForJSAds:!0},pt.prototype.initWithSettings=function(t){this.settings=Object.assign({},pt.IMA_DEFAULTS,t||{}),this.warnAboutDeprecatedSettings(),this.showCountdown=!0,!1===this.settings.showCountdown&&(this.showCountdown=!1)},pt.prototype.warnAboutDeprecatedSettings=function(){var t=this;[].forEach((function(e){void 0!==t.settings[e]&&console.warn("WARNING: videojs.imaDai setting "+e+" is deprecated")}))},pt.prototype.getSettings=function(){return this.settings},pt.prototype.getIsMobile=function(){return this.isMobile},pt.prototype.getIsIos=function(){return this.isIos},pt.prototype.getStreamPlayer=function(){return this.playerWrapper.getStreamPlayer()},pt.prototype.getVjsPlayer=function(){return this.playerWrapper.getVjsPlayer()},pt.prototype.requestStream=function(){this.sdkImpl.requestStream()},pt.prototype.setSetting=function(t,e){this.settings[t]=e},pt.prototype.onErrorLoadingAds=function(t){this.playerWrapper.onAdError(t)},pt.prototype.onAdError=function(t){this.playerWrapper.onAdError(t)},pt.prototype.onAdBreakStart=function(){this.inAdBreak=!0,this.playerWrapper.onAdBreakStart()},pt.prototype.onAdBreakEnd=function(){this.inAdBreak=!1,this.playerWrapper.onAdBreakEnd()},pt.prototype.onPlayerDisposed=function(){this.contentAndAdsEndedListeners=[],this.sdkImpl.onPlayerDisposed()},pt.prototype.isInAdBreak=function(){return this.inAdBreak},pt.prototype.onSeekEnd=function(t){this.sdkImpl.onSeekEnd(t)},pt.prototype.onPlayerReady=function(){this.sdkImpl.onPlayerReady()},pt.prototype.reset=function(){this.sdkImpl.reset(),this.playerWrapper.reset()},pt.prototype.addEventListener=function(t,e){this.sdkImpl.addEventListener(t,e)},pt.prototype.getStreamManager=function(){return this.sdkImpl.getStreamManager()},pt.prototype.getPlayerId=function(){return this.playerWrapper.getPlayerId()},pt.prototype.streamWillAutoplay=function(){return void 0!==this.settings.streamWillAutoplay?this.settings.streamWillAutoplay:!!this.playerWrapper.getPlayerOptions().autoplay},pt.prototype.triggerPlayerEvent=function(t,e){this.playerWrapper.triggerPlayerEvent(t,e)};var gt=function(t,e){this.controller=new ut(t,e),this.addContentAndAdsEndedListener=function(t){this.controller.addContentAndAdsEndedListener(t)}.bind(this),this.addContentEndedListener=function(t){this.controller.addContentEndedListener(t)}.bind(this),this.addEventListener=function(t,e){this.controller.addEventListener(t,e)}.bind(this),this.changeAdTag=function(t){this.controller.changeAdTag(t)}.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(t){this.controller.setAdBreakReadyListener(t)}.bind(this),this.setContentWithAdTag=function(t,e){this.controller.setContentWithAdTag(t,e)}.bind(this),this.setContentWithAdsResponse=function(t,e){this.controller.setContentWithAdsResponse(t,e)}.bind(this),this.setContentWithAdsRequest=function(t,e){this.controller.setContentWithAdsRequest(t,e)}.bind(this),this.setShowCountdown=function(t){this.controller.setShowCountdown(t)}.bind(this)},yt=function(t,e){this.controller=new pt(t,e),this.streamEndedListener=function(t){this.controller.addStreamEndedListener(t)}.bind(this),this.addEventListener=function(t,e){this.controller.addEventListener(t,e)}.bind(this),this.getStreamManager=function(){return this.controller.getStreamManager()}.bind(this)},mt=ot((function t(e,n){nt(this,t),"hls"===(e=e.toLowerCase())||"dash"===e?"dash"!==e?"string"==typeof n?(this.streamFormat=e,this.assetKey=n):window.console.error("assetKey error: value must be string."):window.console.error("streamFormat error: DASH streams are notcurrently supported by this plugin."):window.console.error("VodStream error: incorrect streamFormat.")})),ft=ot((function t(e,n,i){nt(this,t),"hls"===(e=e.toLowerCase())||"dash"===e?"dash"!==e?"string"==typeof n?"string"==typeof i?(this.streamFormat=e,this.cmsId=n,this.videoId=i):window.console.error("videoId error: value must be string."):window.console.error("cmsId error: value must be string."):window.console.error("streamFormat error: DASH streams are notcurrently supported by this plugin."):window.console.error("VodStream error: incorrect streamFormat.")})),vt=o().registerPlugin||o().plugin;vt("ima",(function(t){this.ima=new gt(this,t)})),vt("imaDai",(function(t,e){if(t instanceof mt)e.streamType="live",e.assetKey=t.assetKey;else{if(!(t instanceof ft))return void window.console.error("initDai() first parameter must be an instance of LiveStream or VodStream.");e.streamType="vod",e.cmsId=t.cmsId,e.videoId=t.videoId}e.streamFormat=t.streamFormat,this.imaDai=new yt(this,e)}));var Ct=n(5292),bt=n.n(Ct),Pt=n(9893),St=n.n(Pt),kt=n(9383),wt=n.n(kt),Et=n(6884),Mt=n.n(Et),Tt=n(9088),Lt=n.n(Tt),Rt=n(7997),Dt=n.n(Rt),It=n(7493),jt={};jt.styleTagTransform=Dt(),jt.setAttributes=Mt(),jt.insert=wt().bind(null,"head"),jt.domAPI=St(),jt.insertStyleElement=Lt();bt()(It.A,jt);It.A&&It.A.locals&&It.A.locals},7493:(t,e,n)=>{n.d(e,{A:()=>s});var i=n(4942),o=n.n(i),r=n(278),a=n.n(r)()(o());a.push([t.id,'.ima-ad-container{top:0em;position:absolute;display:none;width:100%;height:100%}.video-js.vjs-playing .bumpable-ima-ad-container{margin-top:-4em}.video-js.vjs-user-inactive.vjs-playing .bumpable-ima-ad-container{margin-top:0em}.video-js.vjs-paused .bumpable-ima-ad-container,.video-js.vjs-playing:hover .bumpable-ima-ad-container,.video-js.vjs-user-active.vjs-playing .bumpable-ima-ad-container{margin-top:-4em}.ima-controls-div{bottom:0em;height:1.4em;position:absolute;overflow:hidden;display:none;opacity:1;background-color:rgba(7,20,30,.7);background:-moz-linear-gradient(bottom, rgba(7, 20, 30, 0.7) 0%, rgba(7, 20, 30, 0) 100%);background:-webkit-gradient(linear, left bottom, left top, color-stop(0%, rgba(7, 20, 30, 0.7)), color-stop(100%, rgba(7, 20, 30, 0)));background:-webkit-linear-gradient(bottom, rgba(7, 20, 30, 0.7) 0%, rgba(7, 20, 30, 0) 100%);background:-o-linear-gradient(bottom, rgba(7, 20, 30, 0.7) 0%, rgba(7, 20, 30, 0) 100%);background:-ms-linear-gradient(bottom, rgba(7, 20, 30, 0.7) 0%, rgba(7, 20, 30, 0) 100%);background:linear-gradient(to top, rgba(7, 20, 30, 0.7) 0%, rgba(7, 20, 30, 0) 100%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr="#0007141E", endColorstr="#07141E",GradientType=0 )}.ima-controls-div.ima-controls-div-showing{height:3.7em}.ima-countdown-div{height:1em;color:#fff;text-shadow:0 0 .2em #000;cursor:default}.ima-seek-bar-div{top:1.2em;height:.3em;position:absolute;background:rgba(255,255,255,.4)}.ima-progress-div{width:0em;height:.3em;background-color:#ecc546}.ima-play-pause-div,.ima-mute-div,.ima-slider-div,.ima-fullscreen-div{width:2.33em;height:1.33em;top:.733em;left:0em;position:absolute;color:#ccc;font-size:1.5em;line-height:2;text-align:center;font-family:VideoJS;cursor:pointer}.ima-mute-div{left:auto;right:5.667em}.ima-slider-div{left:auto;right:2.33em;width:3.33em;height:.667em;top:1.33em;background-color:#555}.ima-slider-level-div{width:100%;height:.667em;background-color:#ecc546}.ima-fullscreen-div{left:auto;right:0em}.ima-playing:before{content:""}.ima-paused:before{content:""}.ima-playing:hover:before,.ima-paused:hover:before{text-shadow:0 0 1em #fff}.ima-non-muted:before{content:""}.ima-muted:before{content:""}.ima-non-muted:hover:before,.ima-muted:hover:before{text-shadow:0 0 1em #fff}.ima-non-fullscreen:before{content:""}.ima-fullscreen:before{content:""}.ima-non-fullscreen:hover:before,.ima-fullscreen:hover:before{text-shadow:0 0 1em #fff}',"",{version:3,sources:["webpack://./../node_modules/videojs-ima/dist/videojs.ima.scss"],names:[],mappings:"AAAA,kBAgBA,OACE,CAAA,iBACA,CAAA,YACA,CAAA,UACA,CAAA,WACA,CAAA,iDAIF,eACE,CAAA,mEAIF,cACE,CAAA,wKAGF,eAGE,CAAA,kBAGF,UACE,CAAA,YACA,CAAA,iBACA,CAAA,eACA,CAAA,YACA,CAAA,SACA,CAAA,iCACA,CAAA,yFACA,CAAA,sIAIA,CAAA,4FAMA,CAAA,uFAIA,CAAA,wFAGA,CAAA,oFAGA,CAAA,oHAGA,CAAA,2CAKF,YACE,CAAA,mBAGF,UACE,CAAA,UACA,CAAA,yBACA,CAAA,cACA,CAAA,kBAGF,SACE,CAAA,WACA,CAAA,iBACA,CAAA,+BACA,CAAA,kBAGF,SACE,CAAA,WACA,CAAA,wBACA,CAAA,sEAGF,YACE,CAAA,aACA,CAAA,UACA,CAAA,QACA,CAAA,iBACA,CAAA,UACA,CAAA,eACA,CAAA,aACA,CAAA,iBACA,CAAA,mBACA,CAAA,cACA,CAAA,cAGF,SACE,CAAA,aACA,CAAA,gBAGF,SACE,CAAA,YACA,CAAA,YACA,CAAA,aACA,CAAA,UACA,CAAA,qBACA,CAAA,sBAGF,UACE,CAAA,aACA,CAAA,wBACA,CAAA,oBAGF,SACE,CAAA,SACA,CAAA,oBAGF,WACE,CAAA,mBAGF,WACE,CAAA,mDAGF,wBACE,CAAA,sBAGF,WACE,CAAA,kBAGF,WACE,CAAA,oDAGF,wBACE,CAAA,2BAGF,WACE,CAAA,uBAGF,WACE,CAAA,8DAGF,wBACE",sourcesContent:['/**\n * Copyright 2014 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n.ima-ad-container {\n top: 0em;\n position: absolute;\n display: none;\n width: 100%;\n height: 100%;\n}\n\n/* Move overlay if user fast-clicks play button. */\n.video-js.vjs-playing .bumpable-ima-ad-container {\n margin-top: -4em;\n}\n\n/* Move overlay when controls are active. */\n.video-js.vjs-user-inactive.vjs-playing .bumpable-ima-ad-container {\n margin-top: 0em;\n}\n\n.video-js.vjs-paused .bumpable-ima-ad-container,\n.video-js.vjs-playing:hover .bumpable-ima-ad-container,\n.video-js.vjs-user-active.vjs-playing .bumpable-ima-ad-container {\n margin-top: -4em;\n}\n\n.ima-controls-div {\n bottom: 0em;\n height: 1.4em;\n position: absolute;\n overflow: hidden;\n display: none;\n opacity: 1;\n background-color: rgba(7, 20, 30, .7);\n background: -moz-linear-gradient(\n bottom,\n rgba(7, 20, 30, .7) 0%,\n rgba(7, 20, 30, 0) 100%); /* FF3.6+ */\n background: -webkit-gradient(\n linear,\n left bottom,\n left top,\n color-stop(0%,rgba(7, 20, 30, .7)),\n color-stop(100%,rgba(7, 20, 30, 0))); /* Chrome,Safari4+ */\n background: -webkit-linear-gradient(\n bottom,\n rgba(7, 20, 30, .7) 0%,\n rgba(7, 20, 30, 0) 100%); /* Chrome10+,Safari5.1+ */\n background: -o-linear-gradient(bottom,\n rgba(7, 20, 30, .7) 0%,\n rgba(7, 20, 30, 0) 100%); /* Opera 11.10+ */\n background: -ms-linear-gradient(bottom,\n rgba(7, 20, 30, .7) 0%,\n rgba(7, 20, 30, 0) 100%); /* IE10+ */\n background: linear-gradient(to top,\n rgba(7, 20, 30, .7) 0%,\n rgba(7, 20, 30, 0) 100%); /* W3C */\n filter: progid:DXImageTransform.Microsoft.gradient(\n startColorstr=\'#0007141E\',\n endColorstr=\'#07141E\',GradientType=0 ); /* IE6-9 */\n}\n\n.ima-controls-div.ima-controls-div-showing {\n height: 3.7em;\n}\n\n.ima-countdown-div {\n height: 1em;\n color: #FFFFFF;\n text-shadow: 0 0 0.2em #000;\n cursor: default;\n}\n\n.ima-seek-bar-div {\n top: 1.2em;\n height: 0.3em;\n position: absolute;\n background: rgba(255, 255, 255, .4);\n}\n\n.ima-progress-div {\n width: 0em;\n height: 0.3em;\n background-color: #ECC546;\n}\n\n.ima-play-pause-div, .ima-mute-div, .ima-slider-div, .ima-fullscreen-div {\n width: 2.33em;\n height: 1.33em;\n top: 0.733em;\n left: 0em;\n position: absolute;\n color: #CCCCCC;\n font-size: 1.5em;\n line-height: 2;\n text-align: center;\n font-family: VideoJS;\n cursor: pointer;\n}\n\n.ima-mute-div {\n left: auto;\n right: 5.667em;\n}\n\n.ima-slider-div {\n left: auto;\n right: 2.33em;\n width: 3.33em;\n height: 0.667em;\n top: 1.33em;\n background-color: #555555;\n}\n\n.ima-slider-level-div {\n width: 100%;\n height: 0.667em;\n background-color: #ECC546;\n}\n\n.ima-fullscreen-div {\n left: auto;\n right: 0em;\n}\n\n.ima-playing:before {\n content: "\\00f103";\n}\n\n.ima-paused:before {\n content: "\\00f101";\n}\n\n.ima-playing:hover:before, .ima-paused:hover:before {\n text-shadow: 0 0 1em #fff;\n}\n\n.ima-non-muted:before {\n content: "\\00f107";\n}\n\n.ima-muted:before {\n content: "\\00f104";\n}\n\n.ima-non-muted:hover:before, .ima-muted:hover:before {\n text-shadow: 0 0 1em #fff;\n}\n\n.ima-non-fullscreen:before {\n content: "\\00f108";\n}\n\n.ima-fullscreen:before {\n content: "\\00f109";\n}\n\n.ima-non-fullscreen:hover:before, .ima-fullscreen:hover:before {\n text-shadow: 0 0 1em #fff;\n}\n'],sourceRoot:""}]);const s=a},278:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",i=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),i&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),i&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,i,o,r){"string"==typeof t&&(t=[[null,t,void 0]]);var a={};if(i)for(var s=0;s<this.length;s++){var d=this[s][0];null!=d&&(a[d]=!0)}for(var l=0;l<t.length;l++){var c=[].concat(t[l]);i&&a[c[0]]||(void 0!==r&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=r),n&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=n):c[2]=n),o&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=o):c[4]="".concat(o)),e.push(c))}},e}},4942:t=>{t.exports=function(t){var e=t[1],n=t[3];if(!n)return e;if("function"==typeof btoa){var i=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),o="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(i),r="/*# ".concat(o," */");return[e].concat([r]).join("\n")}return[e].join("\n")}},5292:t=>{var e=[];function n(t){for(var n=-1,i=0;i<e.length;i++)if(e[i].identifier===t){n=i;break}return n}function i(t,i){for(var r={},a=[],s=0;s<t.length;s++){var d=t[s],l=i.base?d[0]+i.base:d[0],c=r[l]||0,u="".concat(l," ").concat(c);r[l]=c+1;var h=n(u),A={css:d[1],media:d[2],sourceMap:d[3],supports:d[4],layer:d[5]};if(-1!==h)e[h].references++,e[h].updater(A);else{var p=o(A,i);i.byIndex=s,e.splice(s,0,{identifier:u,updater:p,references:1})}a.push(u)}return a}function o(t,e){var n=e.domAPI(e);n.update(t);return function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;n.update(t=e)}else n.remove()}}t.exports=function(t,o){var r=i(t=t||[],o=o||{});return function(t){t=t||[];for(var a=0;a<r.length;a++){var s=n(r[a]);e[s].references--}for(var d=i(t,o),l=0;l<r.length;l++){var c=n(r[l]);0===e[c].references&&(e[c].updater(),e.splice(c,1))}r=d}}},9383:t=>{var e={};t.exports=function(t,n){var i=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(n)}},9088:t=>{t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},6884:(t,e,n)=>{t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},9893:t=>{t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var i="";n.supports&&(i+="@supports (".concat(n.supports,") {")),n.media&&(i+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(i+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),i+=n.css,o&&(i+="}"),n.media&&(i+="}"),n.supports&&(i+="}");var r=n.sourceMap;r&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),e.styleTagTransform(i,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},7997:t=>{t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}}}]);
|
|
1
|
+
"use strict";(self.cloudinaryVideoPlayerChunkLoading=self.cloudinaryVideoPlayerChunkLoading||[]).push([[330],{2650:(t,e,n)=>{n.r(e);var i=n(7938),o=n.n(i),r=n(5204),s=n.n(r),a=n(7509),d=n.n(a),l="7.5.0";var h=function(t,e){e.isImmediatePropagationStopped=function(){return!0},e.cancelBubble=!0,e.isPropagationStopped=function(){return!0}},u=function(t,e,n){h(0,n),t.trigger({type:e+n.type,originalEvent:n})};function c(t){"playing"===t.type?function(t,e){t.ads.isInAdMode()&&(t.ads.isContentResuming()?t.ads._contentEnding&&u(t,"content",e):u(t,"ad",e))}(this,t):"ended"===t.type?function(t,e){t.ads.isInAdMode()?t.ads.isContentResuming()?(h(0,e),t.trigger("resumeended")):u(t,"ad",e):t.ads._contentHasEnded||t.ads.stitchedAds()||(u(t,"content",e),t.trigger("readyforpostroll"))}(this,t):"loadstart"===t.type||"loadeddata"===t.type||"loadedmetadata"===t.type?function(t,e){if(!("loadstart"===e.type&&!t.ads._hasThereBeenALoadStartDuringPlayerLife||"loadeddata"===e.type&&!t.ads._hasThereBeenALoadedData||"loadedmetadata"===e.type&&!t.ads._hasThereBeenALoadedMetaData))if(t.ads.inAdBreak())u(t,"ad",e);else{if(t.currentSrc()!==t.ads.contentSrc)return;u(t,"content",e)}}(this,t):"play"===t.type?function(t,e){t.ads.inAdBreak()?u(t,"ad",e):t.ads.isContentResuming()&&u(t,"content",e)}(this,t):this.ads.isInAdMode()&&(this.ads.isContentResuming()?u(this,"content",t):u(this,"ad",t))}function A(){return A=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},A.apply(this,arguments)}function p(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,g(t,e)}function g(t,e){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},g(t,e)}var y={},m=function(){!function(t){if(o().dom.isInFrame()&&"function"!=typeof s().__tcfapi){for(var e,n=s(),i={};n;){try{if(n.frames.__tcfapiLocator){e=n;break}}catch(t){}if(n===s().top)break;n=n.parent}if(!e)return;s().__tcfapi=function(t,n,o,r){var s=Math.random()+"",a={__tcfapiCall:{command:t,parameter:r,version:n,callId:s}};i[s]=o,e.postMessage(a,"*")},s().addEventListener("message",(function(t){var e={};try{e="string"==typeof t.data?JSON.parse(t.data):t.data}catch(t){}var n=e.__tcfapiReturn;n&&"function"==typeof i[n.callId]&&(i[n.callId](n.returnValue,n.success),i[n.callId]=null)}),!1)}}(),"function"==typeof s().__tcfapi&&s().__tcfapi("addEventListener",2,(function(t,e){e&&(y=t)}))},f="",v=function(t,e){if(void 0===e&&(e=s()),e.__uspapi)e.__uspapi("getUSPData",1,(function(e,n){var i=n?e.uspString:null;f=i,t(i)}));else{var n=function(t){for(var e=t.parent;e!==t.top;){try{if(e.frames&&e.frames.__uspapiLocator)return e}catch(t){}e=e.parent}try{if(t.top.frames&&t.top.frames.__uspapiLocator)return t.top}catch(t){}return null}(e);if(!n)return void t(null);var i=Math.random().toString(36).substring(2),o={__uspapiCall:{command:"getUSPData",version:1,callId:i}};e.addEventListener("message",(function n(o){if(o&&o.data&&o.data.__uspapiReturn&&o.data.__uspapiReturn.callId===i){e.removeEventListener("message",n,!1);var r=o.data.__uspapiReturn,s=r.returnValue,a=r.success?s.uspString:null;f=a,t(a)}}),!1),n.postMessage(o,"*")}},P=function(t,e){return e?encodeURIComponent(t):t},C=function(t,e){var n={};return["description","tags","reference_id","ad_keys"].forEach((function(i){t&&t[i]?n["{mediainfo."+i+"}"]=t[i]:e["{mediainfo."+i+"}"]?n["{mediainfo."+i+"}"]=e["{mediainfo."+i+"}"]:n["{mediainfo."+i+"}"]=""})),["custom_fields","customFields"].forEach((function(e){!function(t,e,n){if(t&&t[n])for(var i=t[n],o=Object.keys(i),r=0;r<o.length;r++)e["{mediainfo."+n+"."+o[r]+"}"]=i[o[r]]}(t,n,e)})),n},S=function(t,e,n,i,r){for(var s in void 0===i&&(i={}),e){var a=i.hasOwnProperty(s)?i[s]:s;if(a.startsWith("r:"))try{var d=new RegExp(a.slice(2),"g");t=t.replace(d,P(e[s],n))}catch(t){r.ads.error({errorType:o().Error.AdsMacroReplacementFailed,macro:s,error:t}),o().log.warn('Unable to replace macro with regex "'+a+'". The provided regex may be invalid.')}else t=t.split(a).join(P(e[s],n))}return t};function b(t,e,n){void 0===e&&(e=!1),void 0===n&&(n={});var i=n.disableDefaultMacros||!1,r=n.macroNameOverrides||{};delete n.disableDefaultMacros,delete n.macroNameOverrides;var a=n;if(i)return S(t,a,e,r);var l,h,u,c=function(t){var e={},n=t.replace(/{([^}=]+)=([^}]*)}/g,(function(t,n,i){return e["{"+n+"}"]=i,"{"+n+"}"}));return{defaults:e,modifiedString:n}}(t),p=c.defaults,g=c.modifiedString;for(var m in t=g,A(a,{"{player.id}":(u=this).options_["data-player"]||u.id_,"{player.height}":u.currentHeight(),"{player.width}":u.currentWidth(),"{player.heightInt}":Math.round(u.currentHeight()),"{player.widthInt}":Math.round(u.currentWidth()),"{player.autoplay}":u.autoplay()?1:0,"{player.muted}":u.muted()?1:0,"{player.language}":u.language()||"","{mediainfo.id}":u.mediainfo?u.mediainfo.id:"","{mediainfo.name}":u.mediainfo?u.mediainfo.name:"","{mediainfo.duration}":u.mediainfo?u.mediainfo.duration:"","{player.duration}":u.duration(),"{player.durationInt}":Math.round(u.duration()),"{player.live}":u.duration()===1/0?1:0,"{player.pageUrl}":o().dom.isInFrame()?d().referrer:s().location.href,"{playlistinfo.id}":u.playlistinfo?u.playlistinfo.id:"","{playlistinfo.name}":u.playlistinfo?u.playlistinfo.name:"","{timestamp}":(new Date).getTime(),"{document.referrer}":d().referrer,"{window.location.href}":s().location.href,"{random}":Math.floor(1e12*Math.random())},C(this.mediainfo,p),(l=y,h={},Object.keys(l).forEach((function(t){h["{tcf."+t+"}"]=l[t]})),h["{tcf.gdprAppliesInt}"]=l.gdprApplies?1:0,h),{"{usp.uspString}":f},function(t,e,n){var i=new RegExp("{pageVariable\\.([^}]+)}","g"),r={},a=(t.match(i)||[]).concat(Object.keys(n).filter((function(e){return i.test(e)&&t.includes(n[e])})));if(a)return a.forEach((function(t){for(var n,i=t,a=t.slice(14,-1),d=a.split("."),l=s(),h=0;h<d.length;h++)if(h===d.length-1)n=l[d[h]];else if(void 0===(l=l[d[h]]))break;var u=typeof n;null===n?r[i]="null":void 0===n?e[i]?r[i]=e[i]:(o().log.warn('Page variable "'+a+'" not found'),r[i]=""):"string"!==u&&"number"!==u&&"boolean"!==u?(o().log.warn('Page variable "'+a+'" is not a supported type'),r[i]=""):r[i]=n})),r}(t,p,r)),t=S(t,a,e,r,this),p)t=t.replace(m,p[m]);return t}var k={processMetadataTracks:function(t,e){for(var n=t.textTracks(),i=function(n){"metadata"===n.kind&&(t.ads.cueTextTracks.setMetadataTrackMode(n),e(t,n))},o=0;o<n.length;o++)i(n[o]);n.addEventListener("addtrack",(function(t){i(t.track)}))},setMetadataTrackMode:function(t){},getSupportedAdCue:function(t,e){return e},isSupportedAdCue:function(t,e){return!0},getCueId:function(t,e){return e.id}},E=function(t,e){return void 0!==e&&t.ads.includedCues[e]},M=function(t,e){void 0!==e&&""!==e&&(t.ads.includedCues[e]=!0)};function w(){!1!==this.ads._shouldBlockPlay&&(this.paused()||(this.ads.debug("Playback was canceled by cancelContentPlay"),this.pause()),this.ads._cancelledPlay=!0)}k.processAdTrack=function(t,e,n,i){t.ads.includedCues={};for(var r=0;r<e.length;r++){var s=e[r],a=this.getSupportedAdCue(t,s);if(!this.isSupportedAdCue(t,s))return void o().log.warn("Skipping as this is not a supported ad cue.",s);var d=this.getCueId(t,s),l=s.startTime;if(E(t,d))return void o().log("Skipping ad already seen with ID "+d);i&&i(t,a,d,l),n(t,a,d,l),M(t,d)}};var L={},T=o();L.isMiddlewareMediatorSupported=function(){return!T.browser.IS_IOS&&!T.browser.IS_ANDROID&&!!(T.use&&T.middleware&&T.middleware.TERMINATOR)},L.playMiddleware=function(t){return{setSource:function(t,e){e(null,t)},callPlay:function(){if(t.ads&&!0===t.ads._shouldBlockPlay)return t.ads.debug("Using playMiddleware to block content playback"),t.ads._playBlocked=!0,T.middleware.TERMINATOR},play:function(e,n){t.ads&&t.ads._playBlocked&&e?(t.ads.debug("Play call to Tech was terminated."),t.trigger("play"),t.addClass("vjs-has-started"),t.ads._playBlocked=!1):n&&n.catch&&n.catch((function(e){"NotAllowedError"!==e.name||o().browser.IS_SAFARI||t.trigger("pause")}))}}},L.testHook=function(t){T=t};var R=L.playMiddleware,D=L.isMiddlewareMediatorSupported;var I={src:"data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAAMFbW9vdgAAAGxtdmhkAAAAAAAAAAAAAAAAAAAD6AAAACgAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAjB0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAABAAAAAAAAACgAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAABQAAAALQAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAAoAAAAAAABAAAAAAGobWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAAyAAAAAgBVxAAAAAAALWhkbHIAAAAAAAAAAHZpZGUAAAAAAAAAAAAAAABWaWRlb0hhbmRsZXIAAAABU21pbmYAAAAUdm1oZAAAAAEAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAARNzdGJsAAAAr3N0c2QAAAAAAAAAAQAAAJ9hdmMxAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAABQAC0ABIAAAASAAAAAAAAAABFExhdmM2MC4zLjEwMCBsaWJ4MjY0AAAAAAAAAAAAAAAAGP//AAAANWF2Y0MBZAAf/+EAGGdkAB/zZQFAFuhAAAADAEAAAAyDxgxlgAEABmjr48siwPz4+AAAAAAUYnRydAAAAAAAArEQAAKxEAAAABhzdHRzAAAAAAAAAAEAAAABAAACAAAAABxzdHNjAAAAAAAAAAEAAAABAAAAAQAAAAEAAAAUc3RzegAAAAAAAANyAAAAAQAAABRzdGNvAAAAAAAAAAEAAAM1AAAAYXVkdGEAAABZbWV0YQAAAAAAAAAhaGRscgAAAAAAAAAAbWRpcmFwcGwAAAAAAAAAAAAAAAAsaWxzdAAAACSpdG9vAAAAHGRhdGEAAAABAAAAAExhdmY2MC4zLjEwMAAAAAhmcmVlAAADem1kYXQAAAKvBgX//6vcRem95tlIt5Ys2CDZI+7veDI2NCAtIGNvcmUgMTY0IHIzMDk1IGJhZWU0MDAgLSBILjI2NC9NUEVHLTQgQVZDIGNvZGVjIC0gQ29weWxlZnQgMjAwMy0yMDIyIC0gaHR0cDovL3d3dy52aWRlb2xhbi5vcmcveDI2NC5odG1sIC0gb3B0aW9uczogY2FiYWM9MSByZWY9MyBkZWJsb2NrPTE6MDowIGFuYWx5c2U9MHgzOjB4MTEzIG1lPWhleCBzdWJtZT03IHBzeT0xIHBzeV9yZD0xLjAwOjAuMDAgbWl4ZWRfcmVmPTEgbWVfcmFuZ2U9MTYgY2hyb21hX21lPTAgdHJlbGxpcz0xIDh4OGRjdD0xIGNxbT0wIGRlYWR6b25lPTIxLDExIGZhc3RfcHNraXA9MSBjaHJvbWFfcXBfb2Zmc2V0PS0yIHRocmVhZHM9MTIgbG9va2FoZWFkX3RocmVhZHM9MiBzbGljZWRfdGhyZWFkcz0wIG5yPTAgZGVjaW1hdGU9MSBpbnRlcmxhY2VkPTAgYmx1cmF5X2NvbXBhdD0wIGNvbnN0cmFpbmVkX2ludHJhPTAgYmZyYW1lcz0zIGJfcHlyYW1pZD0yIGJfYWRhcHQ9MSBiX2JpYXM9MCBkaXJlY3Q9MSB3ZWlnaHRiPTEgb3Blbl9nb3A9MCB3ZWlnaHRwPTIga2V5aW50PTI1MCBrZXlpbnRfbWluPTI1IHNjZW5lY3V0PTQwIGludHJhX3JlZnJlc2g9MCByY19sb29rYWhlYWQ9NDAgcmM9Y3JmIG1idHJlZT0xIGNyZj0yMy4wIHFjb21wPTAuNjAgcXBtaW49MCBxcG1heD02OSBxcHN0ZXA9NCBpcF9yYXRpbz0xLjQwIGFxPTE6MS4wMACAAAAAu2WIhAAr//712/Msrm6aNt72NzYJPxaInwAZmgAAAwAAAwAAAwAAFmhoUruNAYyHgAAAAwAAHDAAjoAFsABLAATIAGCACcgA/QAbAAN4AISAFoADHAAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAASUE=",type:"video/mp4"},j=function(){function t(){}return t.getState=function(e){if(e)return t.states_&&t.states_[e]?t.states_[e]:void 0},t.registerState=function(e,n){if("string"!=typeof e||!e)throw new Error('Illegal state name, "'+e+'"; must be a non-empty string.');return t.states_||(t.states_={}),t.states_[e]=n,n},t}(),B=function(){function t(t){this.player=t}t._getName=function(){return"Anonymous State"};var e=t.prototype;return e.transitionTo=function(t){var e=this.player;this.cleanup(e);var n=new t(e);e.ads._state=n,e.ads.debug(this.constructor._getName()+" -> "+n.constructor._getName());for(var i=arguments.length,o=new Array(i>1?i-1:0),r=1;r<i;r++)o[r-1]=arguments[r];n.init.apply(n,[e].concat(o))},e.init=function(){},e.cleanup=function(){},e.onPlay=function(){},e.onPlaying=function(){},e.onEnded=function(){},e.onAdEnded=function(){},e.onAdsReady=function(){o().log.warn("Unexpected adsready event")},e.onAdsError=function(){},e.onAdsCanceled=function(){},e.onAdTimeout=function(){},e.onAdStarted=function(){},e.onAdSkipped=function(){},e.onContentChanged=function(){},e.onContentResumed=function(){},e.onReadyForPostroll=function(){o().log.warn("Unexpected readyforpostroll event")},e.onNoPreroll=function(){},e.onNoPostroll=function(){},e.startLinearAdMode=function(){o().log.warn("Unexpected startLinearAdMode invocation (State via "+this.constructor._getName()+")")},e.endLinearAdMode=function(){o().log.warn("Unexpected endLinearAdMode invocation (State via "+this.constructor._getName()+")")},e.skipLinearAdMode=function(){o().log.warn("Unexpected skipLinearAdMode invocation (State via "+this.constructor._getName()+")")},e.isAdState=function(){throw new Error("isAdState unimplemented for "+this.constructor._getName())},e.isWaitingForAdBreak=function(){return!1},e.isContentResuming=function(){return!1},e.inAdBreak=function(){return!1},e.handleEvent=function(t){var e=this.player;"play"===t?this.onPlay(e):"adsready"===t?this.onAdsReady(e):"adserror"===t?this.onAdsError(e):"adscanceled"===t?this.onAdsCanceled(e):"adtimeout"===t?this.onAdTimeout(e):"ads-ad-started"===t?this.onAdStarted(e):"ads-ad-skipped"===t?this.onAdSkipped(e):"contentchanged"===t?this.onContentChanged(e):"contentresumed"===t?this.onContentResumed(e):"readyforpostroll"===t?this.onReadyForPostroll(e):"playing"===t?this.onPlaying(e):"ended"===t?this.onEnded(e):"nopreroll"===t?this.onNoPreroll(e):"nopostroll"===t?this.onNoPostroll(e):"adended"===t&&this.onAdEnded(e)},t}();j.registerState("State",B);var _=function(t){function e(e){var n;return(n=t.call(this,e)||this).contentResuming=!1,n.waitingForAdBreak=!1,n}p(e,t);var n=e.prototype;return n.isAdState=function(){return!0},n.onPlaying=function(){var t=j.getState("ContentPlayback");this.contentResuming&&this.transitionTo(t)},n.onContentResumed=function(){var t=j.getState("ContentPlayback");this.contentResuming&&this.transitionTo(t)},n.isWaitingForAdBreak=function(){return this.waitingForAdBreak},n.isContentResuming=function(){return this.contentResuming},n.inAdBreak=function(){return!0===this.player.ads._inLinearAdMode},e}(B);j.registerState("AdState",_);var W=function(t){function e(){return t.apply(this,arguments)||this}p(e,t);var n=e.prototype;return n.isAdState=function(){return!1},n.onContentChanged=function(t){var e=j.getState("BeforePreroll"),n=j.getState("Preroll");t.ads.debug("Received contentchanged event (ContentState)"),t.paused()?this.transitionTo(e):(this.transitionTo(n,!1),t.pause(),t.ads._pausedOnContentupdate=!0)},e}(B);j.registerState("ContentState",W);var N,F=function(t){function e(){return t.apply(this,arguments)||this}p(e,t),e._getName=function(){return"AdsDone"};var n=e.prototype;return n.init=function(t){t.ads._contentHasEnded=!0,t.trigger("ended")},n.startLinearAdMode=function(){o().log.warn("Unexpected startLinearAdMode invocation (AdsDone)")},e}(j.getState("ContentState"));j.registerState("AdsDone",F);var O={start:function(t){t.ads.debug("Starting ad break"),t.ads._inLinearAdMode=!0,t.trigger("adstart"),t.ads.shouldTakeSnapshots()&&(t.ads.snapshot=function(t){var e;e=o().browser.IS_IOS&&t.ads.isLive(t)&&t.seekable().length>0?t.currentTime()-t.seekable().end(0):t.currentTime();var n=t.$(".vjs-tech"),i=t.textTracks?t.textTracks():[],r=[],s={ended:t.ended(),currentSrc:t.currentSrc(),sources:t.currentSources(),src:t.tech_.src(),currentTime:e,type:t.currentType()};n&&(s.style=n.getAttribute("style"));for(var a=0;a<i.length;a++){var d=i[a];r.push({track:d,mode:d.mode}),d.mode="disabled"}return s.suppressedTracks=r,s}(t)),t.ads.shouldPlayContentBehindAd(t)&&!t.ads.settings.stitchedAds&&(t.ads.preAdVolume_=t.volume(),t.volume(0)),t.addClass("vjs-ad-playing"),t.hasClass("vjs-live")&&t.removeClass("vjs-live"),t.ads.removeNativePoster(),t.ads.preAdPlaybackRate_=t.playbackRate(),t.playbackRate(1),t.controlBar&&t.controlBar.playbackRateMenuButton&&t.controlBar.playbackRateMenuButton.playbackRateSupported&&!t.controlBar.playbackRateMenuButton.hasClass("vjs-hidden")?(t.controlBar.playbackRateMenuButton.hide(),t.ads.showPlaybackMenuOnAdEnd_=!0):t.ads.showPlaybackMenuOnAdEnd_=!1},end:function(t,e){t.ads.debug("Ending ad break"),void 0===e&&(e=function(){}),t.ads.adType=null,t.ads._inLinearAdMode=!1,t.trigger("adend"),t.removeClass("vjs-ad-playing"),t.ads.isLive(t)&&t.addClass("vjs-live"),t.ads.shouldTakeSnapshots()?function(t,e){var n=t.ads.snapshot;if(void 0===e&&(e=function(){}),!0===t.ads.disableNextSnapshotRestore)return t.ads.disableNextSnapshotRestore=!1,delete t.ads.snapshot,void e();var i,r=t.$(".vjs-tech"),s=20,a=n.suppressedTracks,d=function(){for(var t=0;t<a.length;t++)(i=a[t]).track.mode=i.mode},l=function(){var e;if(o().browser.IS_IOS&&t.ads.isLive(t)){if(n.currentTime<0&&(e=t.seekable().length>0?t.seekable().end(0)+n.currentTime:t.currentTime(),t.currentTime(e)),t.paused()){var i=t.play();i&&i.catch&&i.catch((function(t){o().log.warn("Play promise rejected in IOS snapshot resume",t)}))}}else if(n.ended)t.currentTime(t.duration());else{t.currentTime(n.currentTime);var r=t.play();r&&r.catch&&r.catch((function(t){o().log.warn("Play promise rejected in snapshot resume",t)}))}t.ads.shouldRemoveAutoplay_&&(t.autoplay(!1),t.ads.shouldRemoveAutoplay_=!1)},h=function e(){if(t.off("contentcanplay",e),N&&t.clearTimeout(N),(r=t.el().querySelector(".vjs-tech")).readyState>1)return l();if(void 0===r.seekable)return l();if(r.seekable.length>0)return l();if(s--)t.setTimeout(e,50);else try{l()}catch(e){t.ads.error({errorType:o().Error.AdsResumeContentFailed,error:e}),o().log.warn("Failed to resume the content after an advertisement",e)}};if("style"in n&&r.setAttribute("style",n.style||""),t.ads.videoElementRecycled())t.one("resumeended",(function(){delete t.ads.snapshot,e()})),t.one("contentloadedmetadata",d),o().browser.IS_IOS&&!t.autoplay()&&"function"==typeof t.techCall_&&(t.techCall_("setAutoplay",!0),t.ads.shouldRemoveAutoplay_=!0),t.src(n.sources),t.one("contentcanplay",h),N=t.setTimeout(h,2e3);else{if(d(),!t.ended()){var u=t.play();u&&u.catch&&u.catch((function(t){o().log.warn("Play promise rejected in snapshot restore",t)}))}delete t.ads.snapshot,e()}}(t,e):(t.ads.preAdVolume_&&t.volume(t.ads.preAdVolume_),e()),t.playbackRate(t.ads.preAdPlaybackRate_),t.ads.showPlaybackMenuOnAdEnd_&&t.controlBar.playbackRateMenuButton.show()}},U=function(t){function e(){return t.apply(this,arguments)||this}p(e,t),e._getName=function(){return"Preroll"};var n=e.prototype;return n.init=function(t,e,n){if(this.waitingForAdBreak=!0,t.addClass("vjs-ad-loading"),n||t.ads.nopreroll_)return this.resumeAfterNoPreroll(t);var i=t.ads.settings.timeout;"number"==typeof t.ads.settings.prerollTimeout&&(i=t.ads.settings.prerollTimeout),this._timeout=t.setTimeout((function(){t.trigger("adtimeout")}),i),e?this.handleAdsReady():this.adsReady=!1},n.onAdsReady=function(t){t.ads.inAdBreak()?o().log.warn("Unexpected adsready event (Preroll)"):(t.ads.debug("Received adsready event (Preroll)"),this.handleAdsReady())},n.handleAdsReady=function(){this.adsReady=!0,this.readyForPreroll()},n.afterLoadStart=function(t){var e=this.player;e.ads._hasThereBeenALoadStartDuringPlayerLife?t():(e.ads.debug("Waiting for loadstart..."),e.one("loadstart",(function(){e.ads.debug("Received loadstart event"),t()})))},n.noPreroll=function(){var t=this;this.afterLoadStart((function(){t.player.ads.debug("Skipping prerolls due to nopreroll event (Preroll)"),t.resumeAfterNoPreroll(t.player)}))},n.readyForPreroll=function(){var t=this.player;this.afterLoadStart((function(){t.ads.debug("Triggered readyforpreroll event (Preroll)"),t.trigger("readyforpreroll")}))},n.onAdsCanceled=function(t){var e=this;t.ads.debug("adscanceled (Preroll)"),this.afterLoadStart((function(){e.resumeAfterNoPreroll(t)}))},n.onAdsError=function(t){var e=this;o().log("adserror (Preroll)"),t.ads.error({errorType:o().Error.AdsPrerollError}),this.inAdBreak()?t.ads.endLinearAdMode():this.afterLoadStart((function(){e.resumeAfterNoPreroll(t)}))},n.startLinearAdMode=function(){var t=this.player;!this.adsReady||t.ads.inAdBreak()||this.isContentResuming()?o().log.warn("Unexpected startLinearAdMode invocation (Preroll)"):(this.clearTimeout(t),t.ads.adType="preroll",this.waitingForAdBreak=!1,O.start(t),t.ads._shouldBlockPlay=!1)},n.onAdStarted=function(t){t.removeClass("vjs-ad-loading")},n.endLinearAdMode=function(){var t=this.player;this.inAdBreak()&&(t.removeClass("vjs-ad-loading"),t.addClass("vjs-ad-content-resuming"),this.contentResuming=!0,O.end(t))},n.skipLinearAdMode=function(){var t=this,e=this.player;e.ads.inAdBreak()||this.isContentResuming()?o().log.warn("Unexpected skipLinearAdMode invocation"):this.afterLoadStart((function(){e.trigger("adskip"),e.ads.debug("skipLinearAdMode (Preroll)"),t.resumeAfterNoPreroll(e)}))},n.onAdTimeout=function(t){var e=this;this.afterLoadStart((function(){t.ads.debug("adtimeout (Preroll)"),e.resumeAfterNoPreroll(t)}))},n.onNoPreroll=function(t){t.ads.inAdBreak()||this.isContentResuming()?o().log.warn("Unexpected nopreroll event (Preroll)"):this.noPreroll()},n.resumeAfterNoPreroll=function(t){if(this.contentResuming=!0,t.ads._shouldBlockPlay=!1,this.cleanupPartial(t),t.ads._playRequested||t.ads._pausedOnContentupdate)if(t.paused()){t.ads.debug("resumeAfterNoPreroll: attempting to resume playback (Preroll)");var e=t.play();e&&e.then&&e.then(null,(function(t){}))}else t.ads.debug("resumeAfterNoPreroll: already playing (Preroll)"),t.trigger("play"),t.trigger("playing")},n.cleanup=function(t){t.ads._hasThereBeenALoadStartDuringPlayerLife||o().log.warn("Leaving Preroll state before loadstart event can cause issues."),this.cleanupPartial(t)},n.cleanupPartial=function(t){t.removeClass("vjs-ad-loading"),t.removeClass("vjs-ad-content-resuming"),this.clearTimeout(t)},n.clearTimeout=function(t){t.clearTimeout(this._timeout),this._timeout=null},e}(j.getState("AdState"));j.registerState("Preroll",U);var V=function(t){function e(){return t.apply(this,arguments)||this}p(e,t),e._getName=function(){return"BeforePreroll"};var n=e.prototype;return n.init=function(t){this.adsReady=!1,this.shouldResumeToContent=!1,t.ads._shouldBlockPlay=!t.ads.settings.allowVjsAutoplay||!t.autoplay()},n.onAdsReady=function(t){t.ads.debug("Received adsready event (BeforePreroll)"),this.adsReady=!0},n.onPlay=function(t){var e=j.getState("Preroll");t.ads.debug("Received play event (BeforePreroll)"),this.transitionTo(e,this.adsReady,this.shouldResumeToContent)},n.onAdsCanceled=function(t){t.ads.debug("adscanceled (BeforePreroll)"),this.shouldResumeToContent=!0},n.onAdsError=function(){this.player.ads.debug("adserror (BeforePreroll)"),this.player.ads.error({errorType:o().Error.BeforePrerollError}),this.shouldResumeToContent=!0},n.onNoPreroll=function(){this.player.ads.debug("Skipping prerolls due to nopreroll event (BeforePreroll)"),this.shouldResumeToContent=!0},n.skipLinearAdMode=function(){var t=this.player;t.trigger("adskip"),t.ads.debug("skipLinearAdMode (BeforePreroll)"),this.shouldResumeToContent=!0},n.onContentChanged=function(){this.init(this.player)},e}(j.getState("ContentState"));j.registerState("BeforePreroll",V);var x=function(t){function e(){return t.apply(this,arguments)||this}p(e,t),e._getName=function(){return"Midroll"};var n=e.prototype;return n.init=function(t){t.ads.adType="midroll",O.start(t),t.addClass("vjs-ad-loading")},n.onAdStarted=function(t){t.removeClass("vjs-ad-loading")},n.endLinearAdMode=function(){var t=this.player;this.inAdBreak()&&(this.contentResuming=!0,t.addClass("vjs-ad-content-resuming"),t.removeClass("vjs-ad-loading"),O.end(t))},n.onAdsError=function(t){t.ads.error({errorType:o().Error.AdsMidrollError}),this.inAdBreak()&&t.ads.endLinearAdMode()},n.cleanup=function(t){t.removeClass("vjs-ad-loading"),t.removeClass("vjs-ad-content-resuming")},e}(j.getState("AdState"));j.registerState("Midroll",x);var H=function(t){function e(){return t.apply(this,arguments)||this}p(e,t),e._getName=function(){return"Postroll"};var n=e.prototype;return n.init=function(t){if(this.waitingForAdBreak=!0,t.ads._contentEnding=!0,t.ads.nopostroll_){this.resumeContent(t);var e=j.getState("AdsDone");this.transitionTo(e)}else{t.addClass("vjs-ad-loading");var n=t.ads.settings.timeout;"number"==typeof t.ads.settings.postrollTimeout&&(n=t.ads.settings.postrollTimeout),this._postrollTimeout=t.setTimeout((function(){t.trigger("adtimeout")}),n)}},n.startLinearAdMode=function(){var t=this.player;t.ads.inAdBreak()||this.isContentResuming()?o().log.warn("Unexpected startLinearAdMode invocation (Postroll)"):(t.ads.adType="postroll",t.clearTimeout(this._postrollTimeout),this.waitingForAdBreak=!1,O.start(t))},n.onAdStarted=function(t){t.removeClass("vjs-ad-loading")},n.endLinearAdMode=function(){var t=this,e=this.player,n=j.getState("AdsDone");this.inAdBreak()&&(e.removeClass("vjs-ad-loading"),this.resumeContent(e),O.end(e,(function(){t.transitionTo(n)})))},n.skipLinearAdMode=function(){var t=this.player;t.ads.inAdBreak()||this.isContentResuming()?o().log.warn("Unexpected skipLinearAdMode invocation"):(t.ads.debug("Postroll abort (skipLinearAdMode)"),t.trigger("adskip"),this.abort(t))},n.onAdTimeout=function(t){t.ads.debug("Postroll abort (adtimeout)"),this.abort(t)},n.onAdsError=function(t){t.ads.debug("Postroll abort (adserror)"),t.ads.error({errorType:o().Error.AdsPostrollError}),t.ads.inAdBreak()?t.ads.endLinearAdMode():this.abort(t)},n.onContentChanged=function(t){if(this.isContentResuming()){var e=j.getState("BeforePreroll");this.transitionTo(e)}else if(!this.inAdBreak()){var n=j.getState("Preroll");this.transitionTo(n)}},n.onNoPostroll=function(t){this.isContentResuming()||this.inAdBreak()?o().log.warn("Unexpected nopostroll event (Postroll)"):this.abort(t)},n.resumeContent=function(t){this.contentResuming=!0,t.addClass("vjs-ad-content-resuming")},n.abort=function(t){var e=j.getState("AdsDone");this.resumeContent(t),t.removeClass("vjs-ad-loading"),this.transitionTo(e)},n.cleanup=function(t){t.removeClass("vjs-ad-content-resuming"),t.clearTimeout(this._postrollTimeout),t.ads._contentEnding=!1},e}(j.getState("AdState"));j.registerState("Postroll",H);var z=function(t){function e(){return t.apply(this,arguments)||this}p(e,t),e._getName=function(){return"ContentPlayback"};var n=e.prototype;return n.init=function(t){t.ads._shouldBlockPlay=!1},n.onAdsReady=function(t){t.ads.debug("Received adsready event (ContentPlayback)"),t.ads.nopreroll_||(t.ads.debug("Triggered readyforpreroll event (ContentPlayback)"),t.trigger("readyforpreroll"))},n.onReadyForPostroll=function(t){var e=j.getState("Postroll");t.ads.debug("Received readyforpostroll event"),this.transitionTo(e)},n.startLinearAdMode=function(){var t=j.getState("Midroll");this.transitionTo(t)},e}(j.getState("ContentState"));j.registerState("ContentPlayback",z);var G=function(t){function e(){return t.apply(this,arguments)||this}p(e,t),e._getName=function(){return"StitchedContentPlayback"};var n=e.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 t=j.getState("StitchedAdRoll");this.transitionTo(t)},e}(j.getState("ContentState"));j.registerState("StitchedContentPlayback",G);var Z=function(t){function e(){return t.apply(this,arguments)||this}p(e,t),e._getName=function(){return"StitchedAdRoll"};var n=e.prototype;return n.init=function(){this.waitingForAdBreak=!1,this.contentResuming=!1,this.player.ads.adType="stitched",O.start(this.player)},n.onPlaying=function(){},n.onContentResumed=function(){},n.onAdEnded=function(){this.endLinearAdMode(),this.player.trigger("ended")},n.endLinearAdMode=function(){var t=j.getState("StitchedContentPlayback");O.end(this.player),this.transitionTo(t)},e}(j.getState("AdState"));j.registerState("StitchedAdRoll",Z);var Y=function(t){function e(){return t.apply(this,arguments)||this}p(e,t),e._getName=function(){return"OutstreamPending"};var n=e.prototype;return n.init=function(t){this.adsReady=!1},n.onPlay=function(t){var e=j.getState("OutstreamPlayback");t.ads.debug("Received play event (OutstreamPending)"),this.transitionTo(e,this.adsReady)},n.onAdsReady=function(t){t.ads.debug("Received adsready event (OutstreamPending)"),this.adsReady=!0},n.onAdsError=function(){this.player.ads.debug("adserror (OutstreamPending)"),this.adsReady=!1},e}(j.getState("AdState"));j.registerState("OutstreamPending",Y);var q=function(t){function e(){return t.apply(this,arguments)||this}p(e,t),e._getName=function(){return"OutstreamPlayback"};var n=e.prototype;return n.init=function(t,e){t.addClass("vjs-ad-loading"),e?this.handleAdsReady():this.abort(t)},n.onAdsReady=function(t){t.ads.inAdBreak()?o().log.warn("Unexpected adsready event (Preroll)"):(t.ads.debug("Received adsready event (Preroll)"),this.handleAdsReady())},n.abort=function(t){var e=j.getState("OutstreamDone");t.removeClass("vjs-ad-loading"),this.transitionTo(e)},n.onAdStarted=function(t){t.removeClass("vjs-ad-loading")},n.handleAdsReady=function(){this.adsReady=!0,this.readyForOutstreamPlayback()},n.readyForOutstreamPlayback=function(){var t=this.player;this.afterLoadStart((function(){t.trigger("readyforoutstream")}))},n.startLinearAdMode=function(){var t=this.player;this.adsReady&&!t.ads.inAdBreak()&&O.start(t)},n.cleanup=function(t){t.ads._hasThereBeenALoadStartDuringPlayerLife||o().log.warn("Leaving OutstreamPlayback state before loadstart event can cause issues."),this.cleanupPartial(t)},n.cleanupPartial=function(t){t.removeClass("vjs-ad-loading"),t.removeClass("vjs-ad-content-resuming"),this.clearTimeout(t)},n.clearTimeout=function(t){t.clearTimeout(this._timeout),this._timeout=null},n.onAdStarted=function(t){t.removeClass("vjs-ad-loading")},n.onAdsError=function(t){var e=this;o().log("adserror (OutstreamPlayback)"),this.inAdBreak()?t.ads.endLinearAdMode():this.afterLoadStart((function(){e.abort(t)}))},n.onAdTimeout=function(t){var e=this;this.afterLoadStart((function(){t.ads.debug("adtimeout (OutstreamPlayback)"),e.abort(t)}))},n.onAdsCanceled=function(t){var e=this;t.ads.debug("adscanceled (OutstreamPlaybac)"),this.afterLoadStart((function(){e.abort(t)}))},n.endLinearAdMode=function(){var t=this;if(this.inAdBreak()){this.player.removeClass("vjs-ad-loading");var e=j.getState("OutstreamDone");O.end(this.player,(function(){t.transitionTo(e)}))}},n.afterLoadStart=function(t){var e=this.player;e.ads._hasThereBeenALoadStartDuringPlayerLife?t():(e.ads.debug("Waiting for loadstart..."),e.one("loadstart",(function(){e.ads.debug("Received loadstart event"),t()})))},n.skipLinearAdMode=function(){var t=this,e=this.player,n=j.getState("OutstreamDone");this.inAdBreak()?o().log.warn("Unexpected skipLinearAdMode invocation"):this.afterLoadStart((function(){e.trigger("adskip"),e.ads.debug("skipLinearAdMode (OutstreamPlayback)"),t.transitionTo(n)}))},e}(j.getState("AdState"));j.registerState("OutstreamPlayback",q);var Q=function(t){function e(){return t.apply(this,arguments)||this}p(e,t),e._getName=function(){return"OutstreamDone"};var n=e.prototype;return n.init=function(t){t.trigger("ended")},n.startLinearAdMode=function(){o().log.warn("Unexpected startLinearAdMode invocation (OutstreamDone)")},e}(j.getState("AdState"));j.registerState("OutstreamDone",Q);var J=L.isMiddlewareMediatorSupported,X=o().getTech("Html5").Events,K={timeout:5e3,prerollTimeout:void 0,postrollTimeout:void 0,debug:!1,stitchedAds:!1,contentIsLive:void 0,liveCuePoints:!0,allowVjsAutoplay:o().options.normalizeAutoplay||!1},$=function(t){var e=this,n=o().obj.merge(K,t),i=[];X.concat(["firstplay","loadedalldata"]).forEach((function(t){-1===i.indexOf(t)&&i.push(t)})),e.on(i,c),J()||function(t,e){e&&o().log("Using cancelContentPlay to block content playback"),t.on("play",w)}(e,n.debug),e.setTimeout((function(){e.ads._hasThereBeenALoadStartDuringPlayerLife||""===e.src()||o().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),e.on("ended",(function(){e.hasClass("vjs-has-started")||e.addClass("vjs-has-started")})),e.on("contenttimeupdate",(function(){e.removeClass("vjs-waiting")})),e.on(["addurationchange","adcanplay"],(function(){if(!e.ads.settings.stitchedAds&&!e.hasStarted()&&(!e.ads.snapshot||e.currentSrc()!==e.ads.snapshot.currentSrc)&&e.ads.inAdBreak()){var t=e.play();t&&t.catch&&t.catch((function(t){o().log.warn("Play promise rejected when playing ad",t)}))}})),e.on("nopreroll",(function(){e.ads.debug("Received nopreroll event"),e.ads.nopreroll_=!0})),e.on("nopostroll",(function(){e.ads.debug("Received nopostroll event"),e.ads.nopostroll_=!0})),e.on("playing",(function(){e.ads._cancelledPlay=!1,e.ads._pausedOnContentupdate=!1})),e.on("play",(function(){e.ads._playRequested=!0})),e.one("loadstart",(function(){e.ads._hasThereBeenALoadStartDuringPlayerLife=!0})),e.on("loadeddata",(function(){e.ads._hasThereBeenALoadedData=!0})),e.on("loadedmetadata",(function(){e.ads._hasThereBeenALoadedMetaData=!0})),e.ads=function(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:l,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 void 0!==t&&(o().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 new 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(e){return void 0===e&&(e=t),"boolean"==typeof e.ads.settings.contentIsLive?e.ads.settings.contentIsLive:e.duration()===1/0||"8"===o().browser.IOS_VERSION&&0===e.duration()},shouldPlayContentBehindAd:function(e){if(void 0===e&&(e=t),e)return!!e.ads.settings.liveCuePoints&&!o().browser.IS_IOS&&!o().browser.IS_ANDROID&&e.duration()===1/0;throw new Error("shouldPlayContentBehindAd requires a player as a param")},shouldTakeSnapshots:function(e){return void 0===e&&(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){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];1===e.length&&"string"==typeof e[0]?o().log("ADS: "+e[0]):o().log.apply(o(),["ADS:"].concat(e))}},error:function(e){if(void 0===e)return this._error||null;null!==e&&e.errorType?(this._error=e,o().log.error("An error with Ads occured. Type: "+e.errorType+"."),t.trigger({type:"vjsadserror",error:this._error})):this._error=null}}}(e),e.ads.settings=n,n.stitchedAds=!!n.stitchedAds,"outstream"===n.playerMode?(e.src(I),e.ads._state=new(j.getState("OutstreamPending"))(e)):n.stitchedAds?e.ads._state=new(j.getState("StitchedContentPlayback"))(e):e.ads._state=new(j.getState("BeforePreroll"))(e),e.ads._state.init(e),e.ads.cueTextTracks=k,e.ads.adMacroReplacement=b.bind(e),function(t){t.ads.contentSrc=t.currentSrc(),t.ads._seenInitialLoadstart=!1,t.on("loadstart",(function(){if(!t.ads.inAdBreak()){var e=t.currentSrc();e!==t.ads.contentSrc&&(t.ads._seenInitialLoadstart&&t.trigger({type:"contentchanged"}),t.trigger({type:"contentupdate",oldValue:t.ads.contentSrc,newValue:e}),t.ads.contentSrc=e),t.ads._seenInitialLoadstart=!0}}))}(e),e.on("contentchanged",e.ads.reset);var r=function(){var t=e.textTracks();if(!e.ads.shouldPlayContentBehindAd(e)&&e.ads.inAdBreak()&&e.tech_.featuresNativeTextTracks&&o().browser.IS_IOS&&!Array.isArray(e.textTracks()))for(var n=0;n<t.length;n++){var i=t[n];"showing"===i.mode&&(i.mode="disabled")}};e.ready((function(){e.textTracks().addEventListener("change",r)})),e.on(["play","playing","ended","adsready","adscanceled","adskip","adserror","adtimeout","adended","ads-ad-started","ads-ad-skipped","contentchanged","dispose","contentresumed","readyforpostroll","nopreroll","nopostroll"],(function(t){e.ads._state.handleEvent(t.type)})),e.on("dispose",(function(){e.ads.reset(),e.textTracks().removeEventListener("change",r)})),m(),v((function(){})),e.ads.listenToTcf=m,e.ads.updateUsPrivacyString=function(t){return v(t)}};$.VERSION=l,function(t){!function(){if(o().getPlugin)return Boolean(o().getPlugin("ads"));var t=o().getComponent("Player");return Boolean(t&&t.prototype.ads)}(o())&&((o().registerPlugin||o().plugin)("ads",t),D()&&!o().usingContribAdsMiddleware_&&(o().use("*",R),o().usingContribAdsMiddleware_=!0,o().log.debug("Play middleware has been registered with videojs")))}($);function tt(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function et(t){return et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},et(t)}function nt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function it(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,tt(i.key),i)}}function ot(t,e,n){return e&&it(t.prototype,e),n&&it(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function rt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function st(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return rt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?rt(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,o=function(){};return{s:o,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,r=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}var at=function(t,e,n){this.vjsPlayer=t,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("contentended",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)),"onPlay"===this.controller.getSettings().requestMode&&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(e)};at.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)},at.prototype.updateCurrentTime=function(){this.contentPlayheadTracker.seeking||(this.contentPlayheadTracker.currentTime=this.vjsPlayer.currentTime())},at.prototype.checkForSeeking=function(){var t=1e3*(this.vjsPlayer.currentTime()-this.contentPlayheadTracker.previousTime);Math.abs(t)>this.seekCheckInterval+this.seekThreshold?this.contentPlayheadTracker.seeking=!0:this.contentPlayheadTracker.seeking=!1,this.contentPlayheadTracker.previousTime=this.vjsPlayer.currentTime()},at.prototype.checkForResize=function(){var t=this.getPlayerWidth(),e=this.getPlayerHeight();t==this.vjsPlayerDimensions.width&&e==this.vjsPlayerDimensions.height||(this.vjsPlayerDimensions.width=t,this.vjsPlayerDimensions.height=e,this.controller.onPlayerResize(t,e))},at.prototype.localContentEndedListener=function(){for(var t in this.contentComplete||(this.contentComplete=!0,this.controller.onContentComplete()),this.contentEndedListeners)"function"==typeof this.contentEndedListeners[t]&&this.contentEndedListeners[t]();this.vjsPlayer.el()&&this.vjsPlayer.one("play",this.setUpPlayerIntervals.bind(this))},at.prototype.onNoPostroll=function(){this.vjsPlayer.trigger("nopostroll")},at.prototype.playerDisposedListener=function(){this.contentEndedListeners=[],this.controller.onPlayerDisposed(),this.contentComplete=!0,this.vjsPlayer.off("contentended",this.boundContentEndedListener),this.vjsPlayer.ads.adTimeoutTimeout&&clearTimeout(this.vjsPlayer.ads.adTimeoutTimeout);var t=[this.updateTimeIntervalHandle,this.seekCheckIntervalHandle,this.resizeCheckIntervalHandle];for(var e in t)t[e]&&clearInterval(t[e])},at.prototype.onReadyForPreroll=function(){this.controller.onPlayerReadyForPreroll()},at.prototype.onAdTimeout=function(){this.controller.onAdTimeout()},at.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()},at.prototype.onFullscreenChange=function(){this.vjsPlayer.isFullscreen()?this.controller.onPlayerEnterFullscreen():this.controller.onPlayerExitFullscreen()},at.prototype.onVolumeChange=function(){var t=this.vjsPlayer.muted()?0:this.vjsPlayer.volume();this.controller.onPlayerVolumeChanged(t)},at.prototype.injectAdContainerDiv=function(t){this.vjsControls.el().parentNode.appendChild(t)},at.prototype.getContentPlayer=function(){return this.h5Player},at.prototype.getVolume=function(){return this.vjsPlayer.muted()?0:this.vjsPlayer.volume()},at.prototype.setVolume=function(t){this.vjsPlayer.volume(t),0==t?this.vjsPlayer.muted(!0):this.vjsPlayer.muted(!1)},at.prototype.unmute=function(){this.vjsPlayer.muted(!1)},at.prototype.mute=function(){this.vjsPlayer.muted(!0)},at.prototype.play=function(){this.vjsPlayer.play()},at.prototype.togglePlayback=function(){this.vjsPlayer.paused()?this.vjsPlayer.play():this.vjsPlayer.pause()},at.prototype.getPlayerWidth=function(){var t=(getComputedStyle(this.vjsPlayer.el())||{}).width;return t&&0!==parseFloat(t)||(t=(this.vjsPlayer.el().getBoundingClientRect()||{}).width),parseFloat(t)||this.vjsPlayer.width()},at.prototype.getPlayerHeight=function(){var t=(getComputedStyle(this.vjsPlayer.el())||{}).height;return t&&0!==parseFloat(t)||(t=(this.vjsPlayer.el().getBoundingClientRect()||{}).height),parseFloat(t)||this.vjsPlayer.height()},at.prototype.getPlayerOptions=function(){return this.vjsPlayer.options_},at.prototype.getPlayerId=function(){return this.vjsPlayer.id()},at.prototype.toggleFullscreen=function(){this.vjsPlayer.isFullscreen()?this.vjsPlayer.exitFullscreen():this.vjsPlayer.requestFullscreen()},at.prototype.getContentPlayheadTracker=function(){return this.contentPlayheadTracker},at.prototype.onAdError=function(t){this.vjsControls.show();var e=void 0!==t.getError?t.getError():t.stack;this.vjsPlayer.trigger({type:"adserror",data:{AdError:e,AdErrorEvent:t}})},at.prototype.onAdLog=function(t){var e=t.getAdData(),n=void 0!==e.adError?e.adError.getMessage():void 0;this.vjsPlayer.trigger({type:"adslog",data:{AdError:n,AdEvent:t}})},at.prototype.onAdBreakStart=function(){this.contentSource=this.vjsPlayer.currentSrc(),this.contentSourceType=this.vjsPlayer.currentType(),this.vjsPlayer.off("contentended",this.boundContentEndedListener),this.vjsPlayer.ads.startLinearAdMode(),this.vjsControls.hide(),this.vjsPlayer.pause()},at.prototype.onAdBreakEnd=function(){this.vjsPlayer.on("contentended",this.boundContentEndedListener),this.vjsPlayer.ads.inAdBreak()&&this.vjsPlayer.ads.endLinearAdMode(),this.vjsControls.show()},at.prototype.onAdStart=function(){this.vjsPlayer.trigger("ads-ad-started")},at.prototype.onAllAdsCompleted=function(){1==this.contentComplete&&(this.contentSource&&this.vjsPlayer.currentSrc()!=this.contentSource&&this.vjsPlayer.src({src:this.contentSource,type:this.contentSourceType}),this.controller.onContentAndAdsCompleted())},at.prototype.onAdsReady=function(){this.vjsPlayer.trigger("adsready")},at.prototype.changeSource=function(t){this.vjsPlayer.currentSrc()&&(this.vjsPlayer.currentTime(0),this.vjsPlayer.pause()),t&&this.vjsPlayer.src(t),this.vjsPlayer.one("loadedmetadata",this.seekContentToZero.bind(this))},at.prototype.seekContentToZero=function(){this.vjsPlayer.currentTime(0)},at.prototype.triggerPlayerEvent=function(t,e){this.vjsPlayer.trigger(t,e)},at.prototype.addContentEndedListener=function(t){this.contentEndedListeners.push(t)},at.prototype.reset=function(){this.vjsPlayer.off("contentended",this.boundContentEndedListener),this.vjsPlayer.on("contentended",this.boundContentEndedListener),this.vjsControls.show(),this.vjsPlayer.ads.inAdBreak()&&this.vjsPlayer.ads.endLinearAdMode(),this.contentPlayheadTracker.currentTime=0,this.contentComplete=!1};var dt=function(t){this.controller=t,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,!1===this.controller.getSettings().showCountdown&&(this.showCountdown=!1),this.isAdNonlinear=!1,this.createAdContainer()};dt.prototype.createAdContainer=function(){this.assignControlAttributes(this.adContainerDiv,"ima-ad-container"),this.adContainerDiv.style.position="absolute",this.adContainerDiv.style.zIndex=1111,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)},dt.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)},dt.prototype.onAdPlayPauseClick=function(){this.controller.onAdPlayPauseClick()},dt.prototype.onAdMuteClick=function(){this.controller.onAdMuteClick()},dt.prototype.onAdFullscreenClick=function(){this.controller.toggleFullscreen()},dt.prototype.onAdsPaused=function(){this.controller.sdkImpl.adPlaying=!1,this.addClass(this.playPauseDiv,"ima-paused"),this.removeClass(this.playPauseDiv,"ima-playing"),this.showAdControls()},dt.prototype.onAdsResumed=function(){this.onAdsPlaying(),this.showAdControls()},dt.prototype.onAdsPlaying=function(){this.controller.sdkImpl.adPlaying=!0,this.addClass(this.playPauseDiv,"ima-playing"),this.removeClass(this.playPauseDiv,"ima-paused")},dt.prototype.updateAdUi=function(t,e,n,i,o){var r=Math.floor(e/60),s=Math.floor(e%60);s.toString().length<2&&(s="0"+s);var a=": ";o>1&&(a=" ("+i+" "+this.controller.getSettings().adLabelNofN+" "+o+"): "),this.countdownDiv.innerHTML=this.controller.getSettings().adLabel+a+r+":"+s;var d=100*(t/n);this.progressDiv.style.width=d+"%"},dt.prototype.unmute=function(){this.addClass(this.muteDiv,"ima-non-muted"),this.removeClass(this.muteDiv,"ima-muted"),this.sliderLevelDiv.style.width=100*this.controller.getPlayerVolume()+"%"},dt.prototype.mute=function(){this.addClass(this.muteDiv,"ima-muted"),this.removeClass(this.muteDiv,"ima-non-muted"),this.sliderLevelDiv.style.width="0%"},dt.prototype.onAdVolumeSliderMouseDown=function(){document.addEventListener("mouseup",this.boundOnMouseUp,!1),document.addEventListener("mousemove",this.boundOnMouseMove,!1)},dt.prototype.onMouseMove=function(t){this.changeVolume(t)},dt.prototype.onMouseUp=function(t){this.changeVolume(t),document.removeEventListener("mouseup",this.boundOnMouseUp),document.removeEventListener("mousemove",this.boundOnMouseMove)},dt.prototype.changeVolume=function(t){var e=(t.clientX-this.sliderDiv.getBoundingClientRect().left)/this.sliderDiv.offsetWidth;e*=100,e=Math.min(Math.max(e,0),100),this.sliderLevelDiv.style.width=e+"%",0==this.percent?(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(e/100)},dt.prototype.showAdContainer=function(){this.adContainerDiv.style.display="block"},dt.prototype.hideAdContainer=function(){this.adContainerDiv.style.display="none"},dt.prototype.onAdContainerClick=function(){this.isAdNonlinear&&this.controller.togglePlayback()},dt.prototype.reset=function(){this.hideAdContainer()},dt.prototype.onAdError=function(){this.hideAdContainer()},dt.prototype.onAdBreakStart=function(t){this.showAdContainer(),"application/javascript"!==t.getAd().getContentType()||this.controller.getSettings().showControlsForJSAds?this.controlsDiv.style.display="block":this.controlsDiv.style.display="none",this.onAdsPlaying(),this.hideAdControls()},dt.prototype.onAdBreakEnd=function(){var t=this.controller.getCurrentAd();(null==t||t.isLinear())&&this.hideAdContainer(),this.controlsDiv.style.display="none",this.countdownDiv.innerHTML=""},dt.prototype.onAllAdsCompleted=function(){this.hideAdContainer()},dt.prototype.onLinearAdStart=function(){this.removeClass(this.adContainerDiv,"bumpable-ima-ad-container"),this.isAdNonlinear=!1},dt.prototype.onNonLinearAdLoad=function(){this.adContainerDiv.style.display="block",this.addClass(this.adContainerDiv,"bumpable-ima-ad-container"),this.isAdNonlinear=!0},dt.prototype.onPlayerEnterFullscreen=function(){this.addClass(this.fullscreenDiv,"ima-fullscreen"),this.removeClass(this.fullscreenDiv,"ima-non-fullscreen")},dt.prototype.onPlayerExitFullscreen=function(){this.addClass(this.fullscreenDiv,"ima-non-fullscreen"),this.removeClass(this.fullscreenDiv,"ima-fullscreen")},dt.prototype.onPlayerVolumeChanged=function(t){0==t?(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=100*t+"%")},dt.prototype.showAdControls=function(){this.controller.getSettings().disableAdControls||this.addClass(this.controlsDiv,"ima-controls-div-showing")},dt.prototype.hideAdControls=function(){this.removeClass(this.controlsDiv,"ima-controls-div-showing")},dt.prototype.assignControlAttributes=function(t,e){t.id=this.controlPrefix+e,t.className=this.controlPrefix+e+" "+e},dt.prototype.getClassRegexp=function(t){return new RegExp("(^|[^A-Za-z-])"+t+"((?![A-Za-z-])|$)","gi")},dt.prototype.elementHasClass=function(t,e){return this.getClassRegexp(e).test(t.className)},dt.prototype.addClass=function(t,e){t.className=t.className.trim()+" "+e},dt.prototype.removeClass=function(t,e){var n=this.getClassRegexp(e);t.className=t.className.trim().replace(n,"")},dt.prototype.getAdContainerDiv=function(){return this.adContainerDiv},dt.prototype.setShowCountdown=function(t){this.showCountdown=t,this.countdownDiv.style.display=this.showCountdown?"block":"none"};var lt="2.3.0",ht=function(t){this.controller=t,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,!1===this.controller.getSettings().autoPlayAdBreaks&&(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)};ht.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),0==this.controller.getSettings().vpaidAllowed&&this.adsLoader.getSettings().setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.DISABLED),void 0!==this.controller.getSettings().vpaidMode&&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(lt),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})},ht.prototype.requestAds=function(){var t=new google.ima.AdsRequest;if(this.controller.getSettings().adTagUrl?t.adTagUrl=this.controller.getSettings().adTagUrl:t.adsResponse=this.controller.getSettings().adsResponse,this.controller.getSettings().forceNonLinearFullSlot&&(t.forceNonLinearFullSlot=!0),this.controller.getSettings().vastLoadTimeout&&(t.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){t.omidAccessModeRules={};var e=this.controller.getSettings().omidVendorAccess;Object.keys(e).forEach((function(n){t.omidAccessModeRules[n]=e[n]}))}t.linearAdSlotWidth=this.controller.getPlayerWidth(),t.linearAdSlotHeight=this.controller.getPlayerHeight(),t.nonLinearAdSlotWidth=this.controller.getSettings().nonLinearWidth||this.controller.getPlayerWidth(),t.nonLinearAdSlotHeight=this.controller.getSettings().nonLinearHeight||this.controller.getPlayerHeight(),t.setAdWillAutoPlay(this.controller.adsWillAutoplay()),t.setAdWillPlayMuted(this.controller.adsWillPlayMuted());var n=this.controller.getSettings().adsRequest;n&&"object"===et(n)&&Object.keys(n).forEach((function(e){t[e]=n[e]})),this.adsLoader.requestAds(t),this.controller.playerWrapper.vjsPlayer.trigger({type:"ads-request",AdsRequest:t})},ht.prototype.onAdsManagerLoaded=function(t){this.createAdsRenderingSettings(),this.adsManager=t.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 e=this.controller.getSettings().preventLateAdStart;e?e&&!this.isAdTimedOut&&this.controller.onAdsReady():this.controller.onAdsReady(),this.controller.getSettings().adsManagerLoadedCallback&&this.controller.getSettings().adsManagerLoadedCallback()},ht.prototype.onAdsLoaderError=function(t){window.console.warn("AdsLoader error: "+t.getError()),this.controller.onErrorLoadingAds(t),this.adsManager&&this.adsManager.destroy()},ht.prototype.initAdsManager=function(){try{var t=this.controller.getPlayerWidth(),e=this.controller.getPlayerHeight();this.adsManagerDimensions.width=t,this.adsManagerDimensions.height=e,this.adsManager.init(t,e,google.ima.ViewMode.NORMAL),this.adsManager.setVolume(this.controller.getPlayerVolume()),this.initializeAdDisplayContainer()}catch(t){this.onAdError(t)}},ht.prototype.createAdsRenderingSettings=function(){if(this.adsRenderingSettings=new google.ima.AdsRenderingSettings,this.adsRenderingSettings.restoreCustomPlaybackStateOnAdBreakComplete=!0,this.controller.getSettings().adsRenderingSettings)for(var t in this.controller.getSettings().adsRenderingSettings)""!==t&&(this.adsRenderingSettings[t]=this.controller.getSettings().adsRenderingSettings[t])},ht.prototype.onAdError=function(t){var e=void 0!==t.getError?t.getError():t.stack;window.console.warn("Ad error: "+e),this.adsManager.destroy(),this.controller.onAdError(t),this.adsActive=!1,this.adPlaying=!1},ht.prototype.onAdBreakReady=function(t){this.adBreakReadyListener(t)},ht.prototype.onContentPauseRequested=function(t){this.adsActive=!0,this.adPlaying=!0,this.controller.onAdBreakStart(t)},ht.prototype.onContentResumeRequested=function(t){this.adsActive=!1,this.adPlaying=!1,this.controller.onAdBreakEnd()},ht.prototype.onAllAdsCompleted=function(t){this.allAdsCompleted=!0,this.controller.onAllAdsCompleted()},ht.prototype.onAdLoaded=function(t){t.getAd().isLinear()||(this.controller.onNonLinearAdLoad(),this.controller.playContent())},ht.prototype.onAdStarted=function(t){this.currentAd=t.getAd(),this.currentAd.isLinear()?(this.adTrackingTimer=setInterval(this.onAdPlayheadTrackerInterval.bind(this),250),this.controller.onLinearAdStart()):this.controller.onNonLinearAdStart()},ht.prototype.onAdPaused=function(){this.controller.onAdsPaused()},ht.prototype.onAdResumed=function(t){this.controller.onAdsResumed()},ht.prototype.onAdComplete=function(){this.currentAd.isLinear()&&clearInterval(this.adTrackingTimer)},ht.prototype.onAdLog=function(t){this.controller.onAdLog(t)},ht.prototype.onAdPlayheadTrackerInterval=function(){if(null!==this.adsManager){var t=this.adsManager.getRemainingTime(),e=this.currentAd.getDuration(),n=e-t;n=n>0?n:0;var i,o=0;this.currentAd.getAdPodInfo()&&(i=this.currentAd.getAdPodInfo().getAdPosition(),o=this.currentAd.getAdPodInfo().getTotalAds()),this.controller.onAdPlayheadUpdated(n,t,e,i,o)}},ht.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()},ht.prototype.onPlayerDisposed=function(){this.adTrackingTimer&&clearInterval(this.adTrackingTimer),this.adsManager&&(this.adsManager.destroy(),this.adsManager=null)},ht.prototype.onPlayerReadyForPreroll=function(){if(this.autoPlayAdBreaks){this.initAdsManager();try{this.controller.showAdContainer(),this.adsManager.setVolume(this.controller.getPlayerVolume()),this.adsManager.start()}catch(t){this.onAdError(t)}}},ht.prototype.onAdTimeout=function(){this.isAdTimedOut=!0},ht.prototype.onPlayerReady=function(){this.initAdObjects(),(this.controller.getSettings().adTagUrl||this.controller.getSettings().adsResponse)&&"onLoad"===this.controller.getSettings().requestMode&&this.requestAds()},ht.prototype.onPlayerEnterFullscreen=function(){this.adsManager&&this.adsManager.resize(window.screen.width,window.screen.height,google.ima.ViewMode.FULLSCREEN)},ht.prototype.onPlayerExitFullscreen=function(){this.adsManager&&this.adsManager.resize(this.controller.getPlayerWidth(),this.controller.getPlayerHeight(),google.ima.ViewMode.NORMAL)},ht.prototype.onPlayerVolumeChanged=function(t){this.adsManager&&this.adsManager.setVolume(t),this.adMuted=0==t},ht.prototype.onPlayerResize=function(t,e){this.adsManager&&(this.adsManagerDimensions.width=t,this.adsManagerDimensions.height=e,this.adsManager.resize(t,e,google.ima.ViewMode.NORMAL))},ht.prototype.getCurrentAd=function(){return this.currentAd},ht.prototype.setAdBreakReadyListener=function(t){this.adBreakReadyListener=t},ht.prototype.isAdPlaying=function(){return this.adPlaying},ht.prototype.isAdMuted=function(){return this.adMuted},ht.prototype.pauseAds=function(){this.adsManager.pause(),this.adPlaying=!1},ht.prototype.resumeAds=function(){this.adsManager.resume(),this.adPlaying=!0},ht.prototype.unmute=function(){this.adsManager.setVolume(1),this.adMuted=!1},ht.prototype.mute=function(){this.adsManager.setVolume(0),this.adMuted=!0},ht.prototype.setVolume=function(t){this.adsManager.setVolume(t),this.adMuted=0==t},ht.prototype.initializeAdDisplayContainer=function(){this.adDisplayContainer&&(this.adDisplayContainerInitialized||(this.adDisplayContainer.initialize(),this.adDisplayContainerInitialized=!0))},ht.prototype.playAdBreak=function(){this.autoPlayAdBreaks||(this.controller.showAdContainer(),this.adsManager.setVolume(this.controller.getPlayerVolume()),this.adsManager.start())},ht.prototype.addEventListener=function(t,e){this.adsManager&&this.adsManager.addEventListener(t,e)},ht.prototype.getAdsManager=function(){return this.adsManager},ht.prototype.reset=function(){this.adsActive=!1,this.adPlaying=!1,this.adTrackingTimer&&clearInterval(this.adTrackingTimer),this.adsManager&&(this.adsManager.destroy(),this.adsManager=null),this.adsLoader&&!this.contentCompleteCalled&&this.adsLoader.contentComplete(),this.contentCompleteCalled=!1,this.allAdsCompleted=!1};var ut=function(t,e){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(e);var n={debug:this.settings.debug,timeout:this.settings.timeout,prerollTimeout:this.settings.prerollTimeout},i=Object.assign({},n,e.contribAdsSettings||{});this.playerWrapper=new at(t,i,this),this.adUi=new dt(this),this.sdkImpl=new ht(this)};ut.IMA_DEFAULTS={adLabel:"Advertisement",adLabelNofN:"of",debug:!1,disableAdControls:!1,prerollTimeout:1e3,preventLateAdStart:!1,requestMode:"onLoad",showControlsForJSAds:!0,timeout:5e3},ut.prototype.initWithSettings=function(t){this.settings=Object.assign({},ut.IMA_DEFAULTS,t||{}),this.warnAboutDeprecatedSettings(),this.showCountdown=!0,!1===this.settings.showCountdown&&(this.showCountdown=!1)},ut.prototype.warnAboutDeprecatedSettings=function(){var t=this;["adWillAutoplay","adsWillAutoplay","adWillPlayMuted","adsWillPlayMuted"].forEach((function(e){void 0!==t.settings[e]&&console.warn("WARNING: videojs.ima setting "+e+" is deprecated")}))},ut.prototype.getSettings=function(){return this.settings},ut.prototype.getIsMobile=function(){return this.isMobile},ut.prototype.getIsIos=function(){return this.isIos},ut.prototype.injectAdContainerDiv=function(t){this.playerWrapper.injectAdContainerDiv(t)},ut.prototype.getAdContainerDiv=function(){return this.adUi.getAdContainerDiv()},ut.prototype.getContentPlayer=function(){return this.playerWrapper.getContentPlayer()},ut.prototype.getContentPlayheadTracker=function(){return this.playerWrapper.getContentPlayheadTracker()},ut.prototype.requestAds=function(){this.sdkImpl.requestAds()},ut.prototype.setSetting=function(t,e){this.settings[t]=e},ut.prototype.onErrorLoadingAds=function(t){this.adUi.onAdError(),this.playerWrapper.onAdError(t)},ut.prototype.onAdPlayPauseClick=function(){this.sdkImpl.isAdPlaying()?(this.adUi.onAdsPaused(),this.sdkImpl.pauseAds()):(this.adUi.onAdsPlaying(),this.sdkImpl.resumeAds())},ut.prototype.onAdMuteClick=function(){this.sdkImpl.isAdMuted()?(this.playerWrapper.unmute(),this.adUi.unmute(),this.sdkImpl.unmute()):(this.playerWrapper.mute(),this.adUi.mute(),this.sdkImpl.mute())},ut.prototype.setVolume=function(t){this.playerWrapper.setVolume(t),this.sdkImpl.setVolume(t)},ut.prototype.getPlayerVolume=function(){return this.playerWrapper.getVolume()},ut.prototype.toggleFullscreen=function(){this.playerWrapper.toggleFullscreen()},ut.prototype.onAdError=function(t){this.adUi.onAdError(),this.playerWrapper.onAdError(t)},ut.prototype.onAdBreakStart=function(t){this.playerWrapper.onAdBreakStart(),this.adUi.onAdBreakStart(t)},ut.prototype.showAdContainer=function(){this.adUi.showAdContainer()},ut.prototype.onAdBreakEnd=function(){this.playerWrapper.onAdBreakEnd(),this.adUi.onAdBreakEnd()},ut.prototype.onAllAdsCompleted=function(){this.adUi.onAllAdsCompleted(),this.playerWrapper.onAllAdsCompleted()},ut.prototype.onAdsPaused=function(){this.adUi.onAdsPaused()},ut.prototype.onAdsResumed=function(){this.adUi.onAdsResumed()},ut.prototype.onAdPlayheadUpdated=function(t,e,n,i,o){this.adUi.updateAdUi(t,e,n,i,o)},ut.prototype.onAdLog=function(t){this.playerWrapper.onAdLog(t)},ut.prototype.getCurrentAd=function(){return this.sdkImpl.getCurrentAd()},ut.prototype.playContent=function(){this.playerWrapper.play()},ut.prototype.onLinearAdStart=function(){this.adUi.onLinearAdStart(),this.playerWrapper.onAdStart()},ut.prototype.onNonLinearAdLoad=function(){this.adUi.onNonLinearAdLoad()},ut.prototype.onNonLinearAdStart=function(){this.adUi.onNonLinearAdLoad(),this.playerWrapper.onAdStart()},ut.prototype.getPlayerWidth=function(){return this.playerWrapper.getPlayerWidth()},ut.prototype.getPlayerHeight=function(){return this.playerWrapper.getPlayerHeight()},ut.prototype.onAdsReady=function(){this.playerWrapper.onAdsReady()},ut.prototype.onPlayerResize=function(t,e){this.sdkImpl.onPlayerResize(t,e)},ut.prototype.onContentComplete=function(){this.sdkImpl.onContentComplete()},ut.prototype.onNoPostroll=function(){this.playerWrapper.onNoPostroll()},ut.prototype.onContentAndAdsCompleted=function(){for(var t in this.contentAndAdsEndedListeners)"function"==typeof this.contentAndAdsEndedListeners[t]&&this.contentAndAdsEndedListeners[t]()},ut.prototype.onPlayerDisposed=function(){this.contentAndAdsEndedListeners=[],this.sdkImpl.onPlayerDisposed()},ut.prototype.onPlayerReadyForPreroll=function(){this.sdkImpl.onPlayerReadyForPreroll()},ut.prototype.onAdTimeout=function(){this.sdkImpl.onAdTimeout()},ut.prototype.onPlayerReady=function(){this.sdkImpl.onPlayerReady()},ut.prototype.onPlayerEnterFullscreen=function(){this.adUi.onPlayerEnterFullscreen(),this.sdkImpl.onPlayerEnterFullscreen()},ut.prototype.onPlayerExitFullscreen=function(){this.adUi.onPlayerExitFullscreen(),this.sdkImpl.onPlayerExitFullscreen()},ut.prototype.onPlayerVolumeChanged=function(t){this.adUi.onPlayerVolumeChanged(t),this.sdkImpl.onPlayerVolumeChanged(t)},ut.prototype.setContentWithAdTag=function(t,e){this.reset(),this.settings.adTagUrl=e||this.settings.adTagUrl,this.playerWrapper.changeSource(t)},ut.prototype.setContentWithAdsResponse=function(t,e){this.reset(),this.settings.adsResponse=e||this.settings.adsResponse,this.playerWrapper.changeSource(t)},ut.prototype.setContentWithAdsRequest=function(t,e){this.reset(),this.settings.adsRequest=e||this.settings.adsRequest,this.playerWrapper.changeSource(t)},ut.prototype.reset=function(){this.sdkImpl.reset(),this.playerWrapper.reset(),this.adUi.reset()},ut.prototype.addContentEndedListener=function(t){this.playerWrapper.addContentEndedListener(t)},ut.prototype.addContentAndAdsEndedListener=function(t){this.contentAndAdsEndedListeners.push(t)},ut.prototype.setAdBreakReadyListener=function(t){this.sdkImpl.setAdBreakReadyListener(t)},ut.prototype.setShowCountdown=function(t){this.adUi.setShowCountdown(t),this.showCountdown=t,this.adUi.countdownDiv.style.display=this.showCountdown?"block":"none"},ut.prototype.initializeAdDisplayContainer=function(){this.sdkImpl.initializeAdDisplayContainer()},ut.prototype.playAdBreak=function(){this.sdkImpl.playAdBreak()},ut.prototype.addEventListener=function(t,e){this.sdkImpl.addEventListener(t,e)},ut.prototype.getAdsManager=function(){return this.sdkImpl.getAdsManager()},ut.prototype.getPlayerId=function(){return this.playerWrapper.getPlayerId()},ut.prototype.changeAdTag=function(t){this.reset(),this.settings.adTagUrl=t},ut.prototype.pauseAd=function(){this.adUi.onAdsPaused(),this.sdkImpl.pauseAds()},ut.prototype.resumeAd=function(){this.adUi.onAdsPlaying(),this.sdkImpl.resumeAds()},ut.prototype.togglePlayback=function(){this.playerWrapper.togglePlayback()},ut.prototype.adsWillAutoplay=function(){return void 0!==this.settings.adsWillAutoplay?this.settings.adsWillAutoplay:void 0!==this.settings.adWillAutoplay?this.settings.adWillAutoplay:!!this.playerWrapper.getPlayerOptions().autoplay},ut.prototype.adsWillPlayMuted=function(){return void 0!==this.settings.adsWillPlayMuted?this.settings.adsWillPlayMuted:void 0!==this.settings.adWillPlayMuted?this.settings.adWillPlayMuted:void 0!==this.playerWrapper.getPlayerOptions().muted?this.playerWrapper.getPlayerOptions().muted:0==this.playerWrapper.getVolume()},ut.prototype.triggerPlayerEvent=function(t,e){this.playerWrapper.triggerPlayerEvent(t,e)};var ct=function(t,e,n){this.vjsPlayer=t,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(e)};ct.prototype.playerDisposedListener=function(){this.contentEndedListeners=[],this.daiController.onPlayerDisposed()},ct.prototype.onPause=function(){this.daiController.isInAdBreak()&&this.vjsControls.show()},ct.prototype.onPlay=function(){this.daiController.isInAdBreak()&&this.vjsControls.hide()},ct.prototype.onSeekEnd=function(){this.daiController.onSeekEnd(this.vjsPlayer.currentTime())},ct.prototype.onPlayerReady=function(){this.h5Player=document.getElementById(this.getPlayerId()).getElementsByClassName("vjs-tech")[0],this.daiController.onPlayerReady()},ct.prototype.getStreamPlayer=function(){return this.h5Player},ct.prototype.getVjsPlayer=function(){return this.vjsPlayer},ct.prototype.getPlayerOptions=function(){return this.vjsPlayer.options_},ct.prototype.getPlayerId=function(){return this.vjsPlayer.id()},ct.prototype.onAdError=function(t){this.vjsControls.show();var e=void 0!==t.getError?t.getError():t.stack;this.vjsPlayer.trigger({type:"adserror",data:{AdError:e,AdErrorEvent:t}})},ct.prototype.onAdBreakStart=function(){this.vjsControls.hide()},ct.prototype.onAdBreakEnd=function(){this.vjsControls.show()},ct.prototype.reset=function(){this.vjsControls.show()};var At=function(t){this.daiController=t,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"}};At.prototype.initImaDai=function(){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),this.streamManager.addEventListener([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],this.onStreamEvent.bind(this),!1),this.vjsPlayer.textTracks().onaddtrack=this.onAddTrack.bind(this),this.vjsPlayer.trigger({type:"stream-manager",StreamManager:this.streamManager}),this.requestStream()},At.prototype.onAddTrack=function(t){var e=this,n=t.track;"metadata"===n.kind&&(n.mode="hidden",n.addEventListener("cuechange",(function(t){var i,o=st(n.activeCues_);try{for(o.s();!(i=o.n()).done;){var r=i.value,s={};s[r.value.key]=r.value.data,e.streamManager.onTimedMetadata(s)}}catch(t){o.e(t)}finally{o.f()}})))},At.prototype.createAdUiDiv=function(){var t=document.createElement("div");t.id="ad-ui",t.style.height="calc(100% - 3em)",this.streamPlayer.parentNode.appendChild(t),this.adUiDiv=t},At.prototype.onStreamPause=function(){this.isAdBreak&&(this.adUiDiv.style.display="none")},At.prototype.onStreamPlay=function(){this.isAdBreak&&(this.adUiDiv.style.display="block")},At.prototype.onSeekEnd=function(t){if("live"!==this.daiController.getSettings().streamType)if(this.isSnapback)this.isSnapback=!1;else{var e=this.streamManager.previousCuePointForStreamTime(t);e&&!e.played&&(this.isSnapback=!0,this.snapForwardTime=t,this.vjsPlayer.currentTime(e.start))}},At.prototype.onStreamEvent=function(t){switch(t.type){case google.ima.dai.api.StreamEvent.Type.LOADED:this.loadUrl(t.getStreamData().url);break;case google.ima.dai.api.StreamEvent.Type.ERROR:window.console.warn("Error loading stream, attempting to play backup stream. "+t.getStreamData().errorMessage),this.daiController.onErrorLoadingAds(t),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)}},At.prototype.loadUrl=function(t){this.vjsPlayer.ready(function(){var e=this.daiController.getSettings().streamFormat;this.vjsPlayer.src({src:t,type:this.SOURCE_TYPES[e]});var n=this.daiController.getSettings().bookmarkTime;if(n){var i=this.streamManager.streamTimeForContentTime(n);this.isSnapback=!0,this.vjsPlayer.currentTime(i)}}.bind(this))},At.prototype.requestStream=function(){var t,e=this.daiController.getSettings().streamType;if("vod"===e?((t=new google.ima.dai.api.VODStreamRequest).contentSourceId=this.daiController.getSettings().cmsId,t.videoId=this.daiController.getSettings().videoId):"live"===e?(t=new google.ima.dai.api.LiveStreamRequest).assetKey=this.daiController.getSettings().assetKey:window.console.warn("No valid stream type selected"),t.format=this.daiController.getSettings().streamFormat,this.daiController.getSettings().apiKey&&(t.apiKey=this.daiController.getSettings().apiKey),this.daiController.getSettings().authToken&&(t.authToken=this.daiController.getSettings().authToken),this.daiController.getSettings().adTagParameters&&(t.adTagParameters=this.daiController.getSettings().adTagParameters),this.daiController.getSettings().streamActivityMonitorId&&(t.streamActivityMonitorId=this.daiController.getSettings().streamActivityMonitorId),this.daiController.getSettings().omidMode){t.omidAccessModeRules={};var n=this.daiController.getSettings().omidMode;n.FULL&&(t.omidAccessModeRules[google.ima.OmidAccessMode.FULL]=n.FULL),n.DOMAIN&&(t.omidAccessModeRules[google.ima.OmidAccessMode.DOMAIN]=n.DOMAIN),n.LIMITED&&(t.omidAccessModeRules[google.ima.OmidAccessMode.LIMITED]=n.LIMITED)}this.streamManager.requestStream(t),this.vjsPlayer.trigger({type:"stream-request",StreamRequest:t})},At.prototype.onPlayerReady=function(){this.initImaDai()},At.prototype.onPlayerDisposed=function(){this.streamManager&&this.streamManager.reset()},At.prototype.getStreamManager=function(){return this.StreamManager},At.prototype.reset=function(){this.StreamManager&&this.StreamManager.reset()};var pt=function(t,e){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(e);var n={debug:this.settings.debug,timeout:this.settings.timeout,prerollTimeout:this.settings.prerollTimeout},i=Object.assign({},n,e.contribAdsSettings||{});this.playerWrapper=new ct(t,i,this),this.sdkImpl=new At(this)};pt.IMA_DEFAULTS={adLabel:"Advertisement",adLabelNofN:"of",debug:!1,disableAdControls:!1,showControlsForJSAds:!0},pt.prototype.initWithSettings=function(t){this.settings=Object.assign({},pt.IMA_DEFAULTS,t||{}),this.warnAboutDeprecatedSettings(),this.showCountdown=!0,!1===this.settings.showCountdown&&(this.showCountdown=!1)},pt.prototype.warnAboutDeprecatedSettings=function(){var t=this;[].forEach((function(e){void 0!==t.settings[e]&&console.warn("WARNING: videojs.imaDai setting "+e+" is deprecated")}))},pt.prototype.getSettings=function(){return this.settings},pt.prototype.getIsMobile=function(){return this.isMobile},pt.prototype.getIsIos=function(){return this.isIos},pt.prototype.getStreamPlayer=function(){return this.playerWrapper.getStreamPlayer()},pt.prototype.getVjsPlayer=function(){return this.playerWrapper.getVjsPlayer()},pt.prototype.requestStream=function(){this.sdkImpl.requestStream()},pt.prototype.setSetting=function(t,e){this.settings[t]=e},pt.prototype.onErrorLoadingAds=function(t){this.playerWrapper.onAdError(t)},pt.prototype.onAdError=function(t){this.playerWrapper.onAdError(t)},pt.prototype.onAdBreakStart=function(){this.inAdBreak=!0,this.playerWrapper.onAdBreakStart()},pt.prototype.onAdBreakEnd=function(){this.inAdBreak=!1,this.playerWrapper.onAdBreakEnd()},pt.prototype.onPlayerDisposed=function(){this.contentAndAdsEndedListeners=[],this.sdkImpl.onPlayerDisposed()},pt.prototype.isInAdBreak=function(){return this.inAdBreak},pt.prototype.onSeekEnd=function(t){this.sdkImpl.onSeekEnd(t)},pt.prototype.onPlayerReady=function(){this.sdkImpl.onPlayerReady()},pt.prototype.reset=function(){this.sdkImpl.reset(),this.playerWrapper.reset()},pt.prototype.addEventListener=function(t,e){this.sdkImpl.addEventListener(t,e)},pt.prototype.getStreamManager=function(){return this.sdkImpl.getStreamManager()},pt.prototype.getPlayerId=function(){return this.playerWrapper.getPlayerId()},pt.prototype.streamWillAutoplay=function(){return void 0!==this.settings.streamWillAutoplay?this.settings.streamWillAutoplay:!!this.playerWrapper.getPlayerOptions().autoplay},pt.prototype.triggerPlayerEvent=function(t,e){this.playerWrapper.triggerPlayerEvent(t,e)};var gt=function(t,e){this.controller=new ut(t,e),this.addContentAndAdsEndedListener=function(t){this.controller.addContentAndAdsEndedListener(t)}.bind(this),this.addContentEndedListener=function(t){this.controller.addContentEndedListener(t)}.bind(this),this.addEventListener=function(t,e){this.controller.addEventListener(t,e)}.bind(this),this.changeAdTag=function(t){this.controller.changeAdTag(t)}.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(t){this.controller.setAdBreakReadyListener(t)}.bind(this),this.setContentWithAdTag=function(t,e){this.controller.setContentWithAdTag(t,e)}.bind(this),this.setContentWithAdsResponse=function(t,e){this.controller.setContentWithAdsResponse(t,e)}.bind(this),this.setContentWithAdsRequest=function(t,e){this.controller.setContentWithAdsRequest(t,e)}.bind(this),this.setShowCountdown=function(t){this.controller.setShowCountdown(t)}.bind(this)},yt=function(t,e){this.controller=new pt(t,e),this.streamEndedListener=function(t){this.controller.addStreamEndedListener(t)}.bind(this),this.addEventListener=function(t,e){this.controller.addEventListener(t,e)}.bind(this),this.getStreamManager=function(){return this.controller.getStreamManager()}.bind(this)},mt=ot((function t(e,n){nt(this,t),"hls"===(e=e.toLowerCase())||"dash"===e?"dash"!==e?"string"==typeof n?(this.streamFormat=e,this.assetKey=n):window.console.error("assetKey error: value must be string."):window.console.error("streamFormat error: DASH streams are notcurrently supported by this plugin."):window.console.error("VodStream error: incorrect streamFormat.")})),ft=ot((function t(e,n,i){nt(this,t),"hls"===(e=e.toLowerCase())||"dash"===e?"dash"!==e?"string"==typeof n?"string"==typeof i?(this.streamFormat=e,this.cmsId=n,this.videoId=i):window.console.error("videoId error: value must be string."):window.console.error("cmsId error: value must be string."):window.console.error("streamFormat error: DASH streams are notcurrently supported by this plugin."):window.console.error("VodStream error: incorrect streamFormat.")})),vt=o().registerPlugin||o().plugin;vt("ima",(function(t){this.ima=new gt(this,t)})),vt("imaDai",(function(t,e){if(t instanceof mt)e.streamType="live",e.assetKey=t.assetKey;else{if(!(t instanceof ft))return void window.console.error("initDai() first parameter must be an instance of LiveStream or VodStream.");e.streamType="vod",e.cmsId=t.cmsId,e.videoId=t.videoId}e.streamFormat=t.streamFormat,this.imaDai=new yt(this,e)}))}}]);
|
|
2
2
|
//# sourceMappingURL=ima.min.js.map
|