1(globalThis.__LOADABLE_LOADED_CHUNKS__||=[]).push([[140],{77132(e){var t;self,t=()=>(()=>{"use strict";var e={d:(t,i)=>{for(var s in i)e.o(i,s)&&!e.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:i[s]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},t={};e.d(t,{default:()=>E});class i{constructor(){this.lastPlayhead=null}getVersion(){return"7.0.9-Bitmovin8-ads-jsclass"}getPlayhead(){let e=null;return this.player&&this.flags&&this.flags.isStarted&&(e=this.player.getCurrentTime()),e}getTitle(){return this.title}getAdInsertionType(){var e=null;return this.player&&this.player.ads.getModuleInfo&&(e="advertising-ima"==this.player.ads.getModuleInfo().name||"advertising-bitmovin"==this.player.ads.getModuleInfo().name?this.getNpawReference().Constants.AdInsertionType.ClientSide:this.getNpawReference().Constants.AdInsertionType.ServerSide),e}getDuration(){return this.duration}getResource(){return this.src}getRendition(){return this.getNpawUtils().buildRenditionString(this.width,this.height,this.bitrate)}getBitrate(){return 1e3*this.bitrate}getAudioEnabled(){let e=!0;return this.player&&(e=this.player.getVolume()>0&&!this.player.isMuted()),e}getIsSkippable(){return this.skippable}getIsFullscreen(){let e=!1;return this.player&&(e="fullscreen"===this.player.getViewMode()),e}getIsVisible(){let e=!1;return this.player&&this.player.getVideoElement&&this.player.getVideoElement()&&(e=this.getNpawUtils().calculateAdViewability(this.player.getVideoElement())),e}getCreativeId(){return this.creativeId}getPosition(){let e=this.position;const t=this.getVideo().getAdapter();return t&&!t.flags.isJoined&&(e=this.getNpawReference().Constants.AdPosition.Preroll),e}registerListeners(){const e=this.player.exports.PlayerEvent;this.monitorPlayhead(!0,!0),this.references={},this.references[e.AdBreakStarted]=this.breakStartListener.bind(this),this.references[e.AdBreakFinished]=this.breakEndListener.bind(this),this.references[e.AdStarted]=this.adStartListener.bind(this),this.references[e.AdFinished]=this.adEndListener.bind(this),this.references[e.AdQuartile]=this.quartileListener.bind(this),this.references[e.AdSkipped]=this.skipListener.bind(this),this.references[e.AdClicked]=this.clickListener.bind(this),this.references[e.AdError]=this.errorListener.bind(this),this.references[e.Destroy]=this.destroyListener.bind(this),this.references[e.Paused]=this.pauseListener.bind(this),this.references[e.Playing]=this.resumeListener.bind(this),this.references[e.TimeChanged]=this.timeupdateListener.bind(this);for(let e in this.references)this.player.on(e,this.references[e])}pauseListener(){this.firePause()}resumeListener(){this.fireResume()}timeupdateListener(){this.lastPlayhead=this.getPlayhead()}unregisterListeners(){this.monitor&&this.monitor.stop();try{if(this.player&&this.player.off&&this.references){for(let e in this.references)this.player.off(e,this.references[e]);delete this.references}}catch(e){}}breakStartListener(e){this.getVideo().fireInit();const t=this.getVideo().getAdapter();t&&t.firePause();const i=e.adBreak.position;"pre"===i?this.position=this.getNpawReference().Constants.AdPosition.Preroll:"post"===i||t&&0!==t.getDuration()&&(t.getPlayhead()||i)>t.getDuration()-1?this.position=this.getNpawReference().Constants.AdPosition.Postroll:this.position=this.getNpawReference().Constants.AdPosition.Midroll}breakEndListener(e){if(this.fireBreakStop(),this.getVideo().requestBuilder.lastSent.adPosition!==this.getNpawReference().Constants.AdPosition.Postroll){const e=this.getVideo().getAdapter();e&&e.fireResume()}else this.getVideo().fireStop()}adStartListener(e){e.ad&&e.ad.data&&(this.title=e.ad.data.adTitle,this.bitrate=e.ad.data.bitrate,this.creativeId=e.ad.data.creative?e.ad.data.creative.id:void 0,this.src=e.ad.mediaFileUrl,this.height=e.ad.height,this.width=e.ad.width,this.skippable=e.ad.skippable,this.duration=e.ad.duration),this.lastPlayhead=0,this.counter=0,this.fireStart(),this.fireJoin()}adEndListener(e){let t=this.getVideo().getPlayhead();this.fireStop({adPlayhead:this.lastPlayhead,playhead:t}),this.getVideo().requestBuilder.lastSent.adPosition===this.getNpawReference().Constants.AdPosition.Postroll&&this.getVideo().fireStop(),this.lastPlayhead=0}quartileListener(e){let t=1;switch(e.quartile){case"midpoint":t=2;break;case"thirdQuartile":t=3}this.fireQuartile(t)}skipListener(e){let t=this.getVideo().getPlayhead();this.fireSkip({adPlayhead:this.lastPlayhead,playhead:t}),this.getVideo().requestBuilder.lastSent.adPosition===this.getNpawReference().Constants.AdPosition.Postroll&&this.getVideo().fireStop(),this.lastPlayhead=0}clickListener(e){this.fireClick(e.clickThroughUrl)}errorListener(e){const t=e.data?e.data:e;this.fireError(t.code,t.message)}destroyListener(e){this.player=null,this.tag=null;let t=this.getVideo().getPlayhead();this.fireStop({adPlayhead:this.lastPlayhead,playhead:t}),this.lastPlayhead=0,this.getVideo().removeAdsAdapter()}}class s{getResource(e){let t="";const i=this._getShaka(e);return"function"==typeof i.getManifestUri?t=i.getManifestUri():"function"==typeof i.getCurrentSrc&&(t=i.getCurrentSrc()),t}getBitrate(e){let t=-1;const i=this._getShaka(e);if("function"==typeof i.getStats)t=i.getStats().streamBandwidth;else if("function"==typeof i.getVideoTracks&&"function"==typeof i.getVideoTrackCurrentIndex){const e=i.getVideoTrackCurrentIndex(),s=i.getVideoTracks();for(let i in s){const r=s[i];r.index==e&&(t=r.bitrate)}}return t}isUsed(e){return!!this._getShaka(e)}getRendition(e){const t=this._getShaka(e),i=t.getStats();let s=this.getNpawUtils().buildRenditionString(i.width,i.height,i.streamBandwidth);const r=t.getVariantTracks();for(let e in r){const t=r[e];if(t.active&&"video"===t.type){s=this.getNpawUtils().buildRenditionString(t.width,t.height,t.bandwidth);break}}return s}_getShaka(e){const t=e.getTech();return t.shakaPlayer||t._shakaplayerInstance}}class r{getTech(e){const t=e.getTech();return t.vhs||t.hls||t.hls_||t.hlsplayer}getRendition(e){let t=null;const i=this.getTech(e).currentLevel;if(void 0!==i&&-1!==i&&this.getTech(e).levels){const s=this.getTech(e).levels[i];s&&(t=this.getNpawUtils().buildRenditionString(s.width,s.height,s.bitrate))}return t}isUsed(e){return!!this.getTech(e)}getHls(e){return this.getTech(e)}getResource(e){let t=null;return this.getTech(e)&&this.getTech(e).url?t=this.getTech(e).url:this.getHls(e)&&this.getHls(e).source_&&(t=this.getHls(e).source_.src),t}getBitrate(e){let t=null;const i=this.getTech(e).currentLevel;if(void 0!==i&&-1!==i&&this.getTech(e).levels){const s=this.getTech(e).levels[i];s&&s.bitrate&&(t=s.bitrate)}return t}}class a{getTech(e){return e.getTech().hlsProvider}getRendition(e){let t;const i=this.getTech(e).getQuality();return void 0!==i&&i.width&&i.height&&i.bitrate&&(t=this.getNpawUtils().buildRenditionString(i.width,i.height,i.bitrate)),t}isUsed(e){return!!this.getTech(e)}getHls(e){return this.getTech(e)}getResource(e){let t=null;const i=this.getTech(e).getQuality();return void 0!==i&&i.url&&i._urlId&&(t=i.url[i._urlId]),t}getBitrate(e){let t;const i=this.getTech(e).getQuality();return void 0!==i&&i.bitrate&&(t=i.bitrate),t}}class n{getBitrate(e){return e.player.dash.shakaPlayer.getStats().streamBandwidth}getResource(e){let t="";const i=e.player.dash.shakaPlayer;return"function"==typeof i.getManifestUri?t=i.getManifestUri():"function"==typeof i.getAssetUri&&(t=i.getAssetUri()),t}isUsed(e){return e.player.dash&&e.player.dash.shakaPlayer}getRendition(e){const t=e.player.dash.shakaPlayer,i=t.getStats();let s=this.getNpawUtils().buildRenditionString(i.width,i.height,i.streamBandwidth);const r=t.getVariantTracks();for(let e in r){const t=r[e];t.active&&"video"===t.type&&(s=this.getNpawUtils().buildRenditionString(t.width,t.height,t.bandwidth))}return s}}class h{getResource(e){return this._getDashPlayer(e).getSource()}_getDashPlayer(e){return e.player.dash.mediaPlayer}isUsed(e){return e.player.dash&&e.player.dash.mediaPlayer&&!e.player.dash.shakaPlayer}getRendition(e){let t=null;const i=this._getDashPlayer(e);if(i){const e=i.getQualityFor("video");if(e){const s=i.getBitrateInfoListFor("video")[e];s&&(t=this.getNpawUtils().buildRenditionString(s.width,s.height,s.bitrate))}}return t}getBitrate(e){let t=null;const i=this._getDashPlayer(e);if(i){const e=i.getQualityFor("video");e&&(t=i.getBitrateInfoListFor("video")[e].bitrate)}return t}}class l{isUsed(e){return!!this.getHls(e)}getRendition(e){let t=null;const i=this.getHls(e).playlists.media();if(e.player.qualityLevels){const i=e.player.qualityLevels(),s=i[i.selectedIndex];s&&(t=this.getNpawUtils().buildRenditionString(s.width,s.height,s.bitrate))}else if(i&&i.attributes){const e=i.attributes;e.RESOLUTION?t=this.getNpawUtils().buildRenditionString(e.RESOLUTION.width,e.RESOLUTION.height,e.BANDWIDTH):e.BANDWIDTH?t=this.getNpawUtils().buildRenditionString(e.BANDWIDTH):e.NAME&&(t=e.NAME)}return t}getHls(e){return e.getTech().vhs||e.getTech().hls||e.getTech().hls_||e.getTech().hlsplayer}getTotalBytes(e){const t=this.getHls(e);let i=t.bytesReceived;return!i&&t.stats&&(i=t.stats.mediaBytesTransferred-e.acumBytes),i}getBitrate(e){let t=null;const i=this.getHls(e).playlists.media();if(e.player.qualityLevels){const i=e.player.qualityLevels(),s=i[i.selectedIndex];s&&(t=s.bitrate)}else i&&i.attributes&&i.attributes.BANDWIDTH?t=i.attributes.BANDWIDTH:e.player.tech_&&e.player.tech_.vhs&&e.player.tech_.vhs.stats?t=e.player.tech_.vhs.stats.bandwidth:e.player.tech_&&e.player.tech_.hls&&e.player.tech_.hls.bandwidth?t=e.player.tech_.hls.bandwidth:e.player.hls&&e.player.hls.bandwidth&&(t=e.player.hls.bandwidth);return t}}class d{initProperties(){this.isGeneric=!0}getVersion(){return"7.0.10-videojs-ads-jsclass"}registerListeners(){if(this.references={adstart:this.adStartListener.bind(this),adend:this.adEndListener.bind(this),adskip:this.adSkipListener.bind(this),adserror:this.errorListener.bind(this),"ads-cl
1ick":this.clickListener.bind(this)},this.player)for(var e in this.references)this.player.on(e,this.references[e])}unregisterListeners(){if(this.player&&this.references){for(var e in this.references)this.player.off(e,this.references[e]);delete this.references}}adStartListener(e){this.firePlayerLog("adStartListener",{}),this.fireStart(),this.fireJoin()}adEndListener(e){this.firePlayerLog("adEndListener",{}),this.fireStop()}adSkipListener(e){this.firePlayerLog("adSkipListener",{}),this.fireSkip()}errorListener(e){this.firePlayerLog("adErrorListener",{}),this.fireError()}clickListener(e){this.firePlayerLog("adClickListener",{}),this.fireClick()}}class o{isUsed(){return"undefined"!=typeof google&&this.player.ima3&&this.player.ads}getVersion(){let e=null;return"undefined"!=typeof google&&google.ima&&(e="bcove-ima-jsclass "+google.ima.VERSION),e}getPlayhead(){let e=this.getVideo().getAdapter().player;return this.player.ima3&&this.player.ima3&&this.player.ima3.adPlayer&&(e=this.player.ima3.adPlayer),e.currentTime()}getDuration(){let e=null;if(this.player.ads&&this.player.ads.ad&&this.player.ads.ad.duration)e=this.player.ads.ad.duration;else{let t=this.getVideo().getAdapter().player;this.player.ima3&&(t=this.player.ima3.adPlayer),e=t&&t.duration?t.duration():null}return e}getPosition(){let e=this.getNpawReference().Constants.AdPosition.Midroll;if(this.player.ads&&this.player.ads.ad)switch(this.player.ads.ad.type){case"PREROLL":e=this.getNpawReference().Constants.AdPosition.Preroll;break;case"MIDROLL":e=this.getNpawReference().Constants.AdPosition.Midroll;break;case"POSTROLL":e=this.getNpawReference().Constants.AdPosition.Postroll}else this.getVideo().getAdapter().getPlayhead()>=this.getVideo().getAdapter().getDuration()&&(e=this.getNpawReference().Constants.AdPosition.Postroll);return this.getVideo().getAdapter().flags.isJoined||(e=this.getNpawReference().Constants.AdPosition.Preroll),e}getResource(){let e="unknown";return this.player.ima3&&(e=this.player.ima3.currentAd.getMediaUrl()),e}getTitle(){let e=null;return this.player.ima3&&this.player.ima3.currentAd&&(e=this.player.ima3.currentAd.getTitle()),e}getPlayerVersion(){let e=null;return this.player.ima3&&(e=this.player.ima3.VERSION),e}getGivenBreaks(){let e=null;return this.player.ima3&&(e=this.player.ima3.adsManager.getCuePoints().length),e}getBreaksTime(){let e=null;if(this.player.ima3){const t=this.player.ima3.adsManager.getCuePoints();for(let e in t)(!t[e]&&0!==t[e]||-1===t[e])&&(t[e]=this.getVideo().getAdapter().getDuration());e=t}return e}getGivenAds(){let e=null;return this.player.ima3&&this.player.ima3.currentAd&&this.player.ima3.currentAd.getAdPodInfo()&&(e=this.player.ima3.currentAd.getAdPodInfo().getTotalAds()),e}getAudioEnabled(){let e=null;return e=!this.player.muted()&&!!this.player.volume(),e}getIsSkippable(){let e=!1;return this.player.ima3&&(e=this.player.ima3.currentAd&&this.player.ima3.currentAd.isSkippable()),e}getIsFullscreen(){let e=null;if(this.getPlugin().deviceDetector.isIphone())e=!this.getPlugin().deviceDetector.isInBackground;else{let t=null;this.player.ima3&&(t=this.player.ima3.el),e=!!t&&window.innerHeight<=t.clientHeight+30&&window.innerWidth<=t.clientWidth+30}return e}getIsVisible(){let e=null;return this.getPlugin().deviceDetector.isIphone()?e=!this.getPlugin().deviceDetector.isInBackground:this.player.ima3&&(e=this.getNpawUtils().calculateAdViewability(this.player.ima3.el)),e}getBitrate(){let e=-1;return this.player.ima3&&this.player.ima3.currentAd&&this.player.ima3.currentAd.getVastMediaBitrate()&&(e=this.player.ima3.currentAd.getVastMediaBitrate()),e}getCreativeId(){let e=null;return this.player.ima3&&this.player.ima3.currentAd?e=this.player.ima3.currentAd.getCreativeAdId()||this.player.ima3.currentAd.getCreativeId():this.titles&&(e=this.titles[(this.getVideo().requestBuilder.lastSent.adNumber||1)-1]._creativeId),e}registerListeners(){if(this.monitorPlayhead(!0,!1),this.references={"ima3-started":this.startJoinListener.bind(this),"ima3-paused":this.pausedListener.bind(this),"ima3-resumed":this.resumedListener.bind(this),"ima3-complete":this.adEndedListener.bind(this),"ima3-skipped":this.skippedListener.bind(this),"ima3-ad-error":this.errorListener.bind(this),"ads-po
1d-ended":this.podEndListener.bind(this),"ads-click":this.clickListener.bind(this),"ads-first-quartile":this.firstQuartileListener.bind(this),"ads-midpoint":this.secondQuartileListener.bind(this),"ads-third-quartile":this.thirdQuartileListener.bind(this)},this.player)for(let e in this.references)this.player.on(e,this.references[e])}startJoinListener(e){this.getVideo().getAdapter()&&this.getVideo().getAdapter().firePause(),this.fireStart(),this.fireJoin()}pausedListener(e){this.firePause()}resumedListener(e){this.fireResume()}skippedListener(e){this.fireSkip(),this.getVideo().getAdapter()&&this.getVideo().getAdapter().fireResume()}adEndedListener(e){const t=this.getVideo().requestBuilder.lastSent.adPosition===this.getNpawReference().Constants.AdPosition.Preroll?0:this.getVideo().getAdapter().lastPlayhead;this.fireStop({playhead:t,adPlayhead:this.getDuration()})}errorListener(e){if(this.player.ima3)if(e.getError&&e.getError()){const t=e.getError();this.fireError(t.getCode(),t.getMessage())}else this.fireError()}clickListener(e){if(this.player.ima3){let e=null;this.player.ima3.currentAd&&this.player.ima3.currentAd.g&&(e=this.player.ima3.currentAd.g.clickThroughUrl),this.fireClick(e)}}firstQuartileListener(e){this.fireQuartile(1)}secondQuartileListener(e){this.fireQuartile(2)}thirdQuartileListener(e){this.fireQuartile(3)}podEndListener(e){this.fireBreakStop()}unregisterListeners(){if(this.monitor&&this.monitor.stop(),this.player&&this.references){for(let e in this.references)this.player.off(e,this.references[e]);delete this.references}}adPlayerErrorListener(e){const t=e.data.AdError;[1012,1005,301,402,302].indexOf(t.getErrorCode())>=0?this.fireManifest(youbora.Constants.ManifestError.NO_RESPONSE,t.getMessage()):[1007,1009,303].indexOf(t.getErrorCode())>=0?this.fireManifest(youbora.Constants.ManifestError.EMPTY,t.getMessage()):[403,100,503,101,102].indexOf(t.getErrorCode())>=0?this.fireManifest(youbora.Constants.ManifestError.WRONG,t.getMessage()):this.fireError(t.getErrorCode(),t.getMessage())}}class g{getVersion(){return"7.0.3-jwplayer-ads-jsclass"}getDuration(){return this.duration}getResource(){return this.resource}getPlayhead(){return this.playhead}getTitle(){return this.title}getPosition(){var e=this.getNpawReference().Constants.AdPosition.Midroll;return this.getVideo().getAdapter()&&!this.getVideo().getAdapter().flags.isJoined?e=this.getNpawReference().Constants.AdPosition.Preroll:this.position!==this.getNpawReference().Constants.AdPosition.Preroll&&this.position!==this.getNpawReference().Constants.AdPosition.Midroll&&this.position!==this.getNpawReference().Constants.AdPosition.Postroll||(e=this.position),e}getGivenBreaks(){var e=null;return this.manager&&this.manager.adsManager&&this.manager.adsManager.getCuePoints&&(e=this.manager.adsManager.getCuePoints().length),e}getBreaksTime(){var e=null;if(this.manager&&this.manager.adsManager&&this.manager.adsManager.getCuePoints){var t=this.manager.adsManager.getCuePoints();for(var i in t)(!t[i]&&0!==t[i]||-1===t[i])&&(t[i]=this.getVideo()._adapter.getDuration());e=t}return e}getGivenAds(){return this.pod&&this.pod.getTotalAds?this.pod.getTotalAds():null}getAudioEnabled(){return!this.player.getMute()}getIsSkippable(){return this.skippable}getIsFullscreen(){if("function"==typeof this.player.getFullscreen)return this.player.getFullscreen();var e=this.player.getContainer();return window.innerHeight<=e.clientHeight+30&&window.innerWidth<=e.clientWidth+30}getIsVisible(){return this.getNpawUtils().calculateAdViewability(this.player.getContainer())}getCreativeId(){return this.creativeId}registerListeners(){for(var e in this.monitorPlayhead(!0,!1,1200),this.references={adTime:this.adTimeListener.bind(this),adStarted:this.adStartedListener.bind(this),adImpression:this.adImpressionListener.bind(this),adPause:this.adPauseListener.bind(this),adPlay:this.adPlayListener.bind(this),adSkipped:this.adSkippedListener.bind(this),adComplete:this.adCompleteListener.bind(this),adClick:this.adClickListener.bind(this),adError:this.adErrorListener.bind(this),adsManager:this.managerListener.bind(this)},this.references)this.player.on(e,this.references[e])}unregisterListeners(){if(this.monitor&&this.monitor.stop(),this.player&&this.references){for(var e in this.references)this.player.off(e,this.references[e]);delete this.references}}managerListener(e){this.manager=e}adTimeListener(e){this.playhead=e.position,this.duration=e.duration,this.getVideo()._adapter&&this.getVideo()._adapter.firePause(),e.ima&&e.ima.ad&&this._imaMetadata(e.ima.ad),this.firstStarted||(this.fireStart(),this.firstStarted=!0),this.fireJoin(),this._quartileHandler()}_imaMetadata(e){this.creativeId=e.getCreativeId()||e.getCreativeAdId(),this.resource=e.getMediaUrl(),this.clickThrough=e.g?e.g.clickThroughUrl:null,this.pod=e.getAdPodInfo(),this.skippable=!(e.getSkipTimeOffset()<=0)}_quartileHandler(){var e=this.playhead/this.duration;e>.75?this.fireQuartile(3):e>.5?this.fireQuartile(2):e>.25&&this.fireQuartile(1)}adStartedListener(e){this.position=e.adposition,this.resource=e.mediafile&&e.mediafile.file?e.mediafile.file:e.tag,this.title=e.adtitle}adImpressionListener(e){this.position=e.adposition,this.resource=e.mediafile&&e.mediafile.file?e.mediafile.file:e.tag,this.title=e.adtitle||e.tag,this.clickThrough=e.clickThroughUrl}adPauseListener(e){this.firePause()}adPlayListener(e){this.fireResume()}adSkippedListener(e){this.fireSkip(),this.firstStarted=!1}adCompleteListener(e){this.fireStop(),this.firstStarted=!1,this.resetValues()}adClickListener(e){this.fireClick(this.clickThrough)}adErrorListener(e){if(e.message){var t=e.message.toLowerCase();t.indexOf("ad tag empty")>-1?this.fireManifest(this.getNpawReference().Constants.ManifestError.EMPTY,e.message):t.indexOf("error loading ad tag")>-1||t.indexOf("invalid ad tag")>-1||t.indexOf("any valid ads")>-1?this.fireManifest(this.getNpawReference().Constants.ManifestError.WRONG,e.message):!e.adErrorCode||60006!==e.adErrorCode&&10403!==e.adErrorCode?(this.fireError(e.adErrorCode,e.message),this.fireStop(),this.resetValues(),t.indexOf("timeout")>-1&&this.fireBreakStop()):this.fireManifest(this.getNpawReference().Constants.ManifestError.WRONG,e.message)}}resetValues(){this.playhead=void 0,this.duration=void 0,this.position=void 0,this.resource=void 0,this.title=void 0}}class p{getResource(e){var t="",i=this._getShaka(e);return"function"==typeof i.getManifestUri?t=i.getManifestUri():"function"==typeof i.getCurrentSrc&&(t=i.getCurrentSrc()),t}getBitrate(e){var t=-1,i=this._getShaka(e);if("function"==typeof i.getStats)t=i.getStats().streamBandwidth;else if("function"==typeof i.getVideoTracks&&"function"==typeof i.getVideoTrackCurrentIndex){var s=i.getVideoTrackCurrentIndex(),r=i.getVideoTracks();for(var a in r){var n=r[a];n.index==s&&(t=n.bitrate)}}return t}isUsed(e){return!!this._getShaka(e)}getRendition(e){var t=this._getShaka(e),i=t.getStats(),s=this.getNpawUtils().buildRenditionString(i.width,i.height,i.streamBandwidth),r=t.getVariantTracks();for(var a in r){var n=r[a];if(n.active&&"video"===n.type){s=this.getNpawUtils().buildRenditionString(n.width,n.height,n.bandwidth);break}}return s}_getShaka(e){var t=e.getTech();return t.shakaPlayer||t._shakaplayerInstance}}class u{getTech(e){var t=e.getTech();return t.vhs||t.hls||t.hls_||t.hlsplayer}getRendition(e){var t=null,i=this.getTech(e).currentLevel;if(void 0!==i&&-1!==i&&this.getTech(e).levels){var s=this.getTech(e).levels[i];s&&(t=this.getNpawUtils().buildRenditionString(s.width,s.height,s.bitrate))}return t}isUsed(e){return!!this.getTech(e)}getHls(e){return this.getTech(e)}getResource(e){var t=null;return this.getTech(e)&&this.getTech(e).url?t=this.getTech(e).url:this.getHls(e)&&this.getHls(e).source_&&(t=this.getHls(e).source_.src),t}getBitrate(e){var t=null,i=this.getTech(e).currentLevel;if(void 0!==i&&-1!==i&&this.getTech(e).levels){var s=this.getTech(e).levels[i];s&&s.bitrate&&(t=s.bitrate)}return t}}class y{getBitrate(e){return e.player.dash.shakaPlayer.getStats().streamBandwidth}getResource(e){var t="",i=e.player.dash.shakaPlayer;return"function"==typeof i.getManifestUri?t=i.getManifestUri():"function"==typeof i.getAssetUri&&(t=i.getAssetUri()),t}isUsed(e){return e.player.dash&&e.player.dash.shakaPlayer}getRendition(e){var t=e.player.dash.shakaPlayer,i=t.getStats(),s=this.getNpawUtils().buildRenditionString(i.width,i.height,i.streamBandwidth),r=t.getVariantTracks();for(var a in r){var n=r[a];n.active&&"video"===n.type&&(s=this.getNpawUtils().buildRenditionString(n.width,n.height,n.bandwidth))}return s}}class f{getResource(e){return this._getDashPlayer(e).getSource()}_getDashPlayer(e){return e.player.dash.mediaPlayer}isUsed(e){return e.player.dash&&e.player.dash.mediaPlayer&&!e.player.dash.shakaPlayer}getRendition(e){var t=null,i=this._getDashPlayer(e);if(i){var s=i.getQualityFor("video");if(s){var r=i.getBitrateInfoListFor("video")[s];r&&(t=this.getNpawUtils().buildRenditionString(r.width,r.height,r.bitrate))}}return t}getBitrate(e){var t=null,i=this._getDashPlayer(e);if(i){var s=i.getQualityFor("video");s&&(t=i.getBitrateInfoListFor("video")[s].bitrate)}return t}}class c{isUsed(e){return!!this.getHls(e)}getRendition(e){var t=null,i=this.getHls(e).playlists.media();if(e.player.qualityLevels){var s=e.player.qualityLevels(),r=s[s.selectedIndex];r&&(t=this.getNpawUtils().buildRenditionString(r.width,r.height,r.bitrate))}else if(i&&i.attributes){var a=i.attributes;a.RESOLUTION?t=this.getNpawUtils().buildRenditionString(a.RESOLUTION.width,a.RESOLUTION.height,a.BANDWIDTH):a.BANDWIDTH?t=this.getNpawUtils().buildRenditionString(a.BANDWIDTH):a.NAME&&(t=a.NAME)}return t}getHls(e){return e.getTech().vhs||e.getTech().hls||e.getTech().hls_||e.getTech().hlsplayer}getTotalBytes(e){var t=this.getHls(e),i=t.bytesReceived;return!i&&t.stats&&(i=t.stats.mediaBytesTransferred-e.acumBytes),i}getBitrate(e){var t=null,i=this.getHls(e).playlists.media();if(e.player.qualityLevels){var s=e.player.qualityLevels(),r=s[s.selectedIndex];r&&(t=r.bitrate)}else i&&i.attributes&&i.attributes.BANDWIDTH?t=i.attributes.BANDWIDTH:e.player.tech_&&e.player.tech_.vhs&&e.player.tech_.vhs.stats?t=e.player.tech_.vhs.stats.bandwidth:e.player.tech_&&e.player.tech_.hls&&e.player.tech_.hls.bandwidth?t=e.player.tech_.hls.bandwidth:e.player.hls&&e.player.hls.bandwidth&&(t=e.player.hls.bandwidth);return t}}class L{initProperties(){this.isGeneric=!0}getVersion(){return"7.0.4-videojs-ads-jsclass"}registerListeners(){if(this.references={adstart:this.adStartListener.bind(this),adend:this.adEndListener.bind(this),adskip:this.adSkipListener.bind(this),adserror:this.errorListener.bind(this),"ads-cl
1ick":this.clickListener.bind(this),"ima3-first-quartile":this.firstQuartileListener.bind(this),"ima3-midpoint":this.secondQuartileListener.bind(this),"ima3-third-quartile":this.thirdQuartileListener.bind(this),"ads-first-quartile":this.firstQuartileListener.bind(this),"ads-midpoint":this.secondQuartileListener.bind(this),"ads-third-quartile":this.thirdQuartileListener.bind(this)},this.player)for(var e in this.references)this.player.on(e,this.references[e])}firstQuartileListener(e){this.fireQuartile(1)}secondQuartileListener(e){this.fireQuartile(2)}thirdQuartileListener(e){this.fireQuartile(3)}unregisterListeners(){if(this.player&&this.references){for(var e in this.references)this.player.off(e,this.references[e]);delete this.references}}adStartListener(e){this.firePlayerLog("adStartListener",{}),this.fireStart(),this.fireJoin()}adEndListener(e){this.firePlayerLog("adEndListener",{}),this.fireStop()}adSkipListener(e){this.firePlayerLog("adSkipListener",{}),this.fireSkip()}errorListener(e){this.firePlayerLog("adErrorListener",{}),this.fireError()}clickListener(e){this.firePlayerLog("adClickListener",{}),this.fireClick()}}class P{isUsed(){return this.player.ima3&&this.player.ads}getVersion(){var e;return"undefined"!=typeof google&&google.ima&&(e="bcove-ima-jsclass "+google.ima.VERSION),e}getPlayhead(){var e=this.getVideo().getAdapter().player;return this.player.ads&&this.player.ads.ad?this.player.ads.ad.currentTime:e.currentTime()}getDuration(){let e;if(this.player.ads&&this.player.ads.ad&&this.player.ads.ad.duration)e=this.player.ads.ad.duration;else{var t=this.getVideo().getAdapter().player;if(this.player.ima3&&this.player.ima3.currentAdEventInfo)return this.player.ima3.currentAdEventInfo.creativeLength[0];e=t&&t.duration?t.duration():null}return e}getPosition(){let e=this.getNpawReference().Constants.AdPosition.Midroll;const t=this.getVideo().getAdapter();if(this.player.ads&&this.player.ads.ad)switch(this.player.ads.ad.type){case"PREROLL":e=this.getNpawReference().Constants.AdPosition.Preroll;break;case"MIDROLL":e=this.getNpawReference().Constants.AdPosition.Midroll;break;case"POSTROLL":e=this.getNpawReference().Constants.AdPosition.Postroll}else t.flags.isJoined?t.getPlayhead()>.1&&t.getPlayhead()<t.getDuration()?e=this.getNpawReference().Constants.AdPosition.Midroll:t.getPlayhead()>=t.getDuration()&&(e=this.getNpawReference().Constants.AdPosition.Postroll):e=this.getNpawReference().Constants.AdPosition.Preroll;return e}getResource(){var e;return this.player.ima3&&(e=this.player.ima3.currentAd.getMediaUrl()),e}getTitle(){var e;return this.player.ima3&&this.player.ima3.currentAd&&(e=this.player.ima3.currentAd.getTitle()),e}getPlayerVersion(){var e;return this.player.ima3&&(e=this.player.ima3.VERSION),e}getGivenBreaks(){var e;return this.player.ima3&&(e=this.player.ima3.adsManager.getCuePoints().length),e}getBreaksTime(){var e;if(this.player.ima3){var t=this.player.ima3.adsManager.getCuePoints();for(var i in t)(!t[i]&&0!==t[i]||-1===t[i])&&(t[i]=this.getVideo().getAdapter().getDuration());e=t}return e}getGivenAds(){var e;return this.player.ima3&&this.player.ima3.currentAd&&this.player.ima3.currentAd.getAdPodInfo()&&(e=this.player.ima3.currentAd.getAdPodInfo().getTotalAds()),e}getAudioEnabled(){return!this.player.muted()&&!!this.player.volume()}getIsSkippable(){var e=!1;return this.player.ima3&&(e=this.player.ima3.currentAd&&this.player.ima3.currentAd.isSkippable()),e}getIsFullscreen(){var e,t;return this.getPlugin().deviceDetector.isIphone()?e=!this.getPlugin().deviceDetector.isInBackground:(this.player.ima3&&(t=this.player.ima3.el),e=!!t&&window.innerHeight<=t.clientHeight+30&&window.innerWidth<=t.clientWidth+30),e}getIsVisible(){var e;return this.getPlugin().deviceDetector.isIphone()?e=!this.getPlugin().deviceDetector.isInBackground:this.player.ima3&&(e=this.getNpawUtils().calculateAdViewability(this.player.ima3.el)),e}getBitrate(){var e;return this.player.ima3&&this.player.ima3.currentAd&&this.player.ima3.currentAd.getVastMediaBitrate()&&(e=this.player.ima3.currentAd.getVastMediaBitrate(),this.lastBitrate=e),this.lastBitrate&&!e?this.lastBitrate:-1}getCreativeId(){var e;return this.player.ima3&&this.player.ima3.currentAd?e=this.player.ima3.currentAd.getCreativeAdId()||this.player.ima3.currentAd.getCreativeId():this.titles&&(e=this.titles[(this.getVideo().requestBuilder.lastSent.adNumber||1)-1]._creativeId),e}registerListeners(){if(this.monitorPlayhead(!0,!1),this.references={"ads-ad-started":this.startJoinListener.bind(this),"ima3-paused":this.pausedListener.bind(this),"ima3-resumed":this.resumedListener.bind(this),"ima3-complete":this.adEndedListener.bind(this),"ima3-skipped":this.skippedListener.bind(this),"ima3-ad-error":this.errorListener.bind(this),"ima3-first-quartile":this.firstQuartileListener.bind(this),"ima3-midpoint":this.secondQuartileListener.bind(this),"ima3-third-quartile":this.thirdQuartileListener.bind(this),"ads-po
1d-ended":this.podEndListener.bind(this),"ads-click":this.clickListener.bind(this),"ads-first-quartile":this.firstQuartileListener.bind(this),"ads-midpoint":this.secondQuartileListener.bind(this),"ads-third-quartile":this.thirdQuartileListener.bind(this)},this.player)for(var e in this.references)this.player.on(e,this.references[e])}startJoinListener(e){this.getVideo().getAdapter()&&this.getVideo().getAdapter().firePause(),this.fireStart(),this.fireJoin()}pausedListener(e){this.firePause()}resumedListener(e){this.fireResume()}skippedListener(e){this.fireSkip(),this.getVideo().getAdapter()&&this.getVideo().getAdapter().fireResume()}adEndedListener(e){var t=this.getVideo().requestBuilder.lastSent.adPosition===this.getNpawReference().Constants.AdPosition.Preroll?0:this.getVideo().getAdapter().lastPlayhead;this.fireStop({playhead:t,adPlayhead:this.getDuration()}),this.lastBitrate=void 0}errorListener(e){if(this.player.ima3)if(e.getError&&e.getError()){var t=e.getError();this.fireError(t.getCode(),t.getMessage())}else this.fireError()}clickListener(e){var t;this.player.ima3&&(this.player.ima3.currentAd&&this.player.ima3.currentAd.g&&(t=this.player.ima3.currentAd.g.clickThroughUrl),this.fireClick(t))}firstQuartileListener(e){this.fireQuartile(1)}secondQuartileListener(e){this.fireQuartile(2)}thirdQuartileListener(e){this.fireQuartile(3)}podEndListener(e){this.fireBreakStop()}unregisterListeners(){if(this.monitor&&this.monitor.stop(),this.player&&this.references){for(var e in this.references)this.player.off(e,this.references[e]);delete this.references}}adPlayerErrorListener(e){var t=e.data.AdError;[1012,1005,301,402,302].indexOf(t.getErrorCode())>=0?this.fireManifest(youbora.Constants.ManifestError.NO_RESPONSE,t.getMessage()):[1007,1009,303].indexOf(t.getErrorCode())>=0?this.fireManifest(youbora.Constants.ManifestError.EMPTY,t.getMessage()):[403,100,503,101,102].indexOf(t.getErrorCode())>=0?this.fireManifest(youbora.Constants.ManifestError.WRONG,t.getMessage()):this.fireError(t.getErrorCode(),t.getMessage())}}class m{isUsed(){return!this.player.ima3&&this.player.ads}getVersion(){return"7.0.4-videojs-bcove-ads-jsclass"}getPlayhead(){if(this.player.ads.ad)return this.player.ads.ad.currentTime}getPosition(){switch(this.player.ads.pod.ads_pod_index){case 0:return this.getNpawReference().Constants.AdPosition.Preroll;case-1:return this.getNpawReference().Constants.AdPosition.Postroll}return this.getNpawReference().Constants.AdPosition.Midroll}getResource(){if(this.player.ads.currentSrc)return this.player.ads.currentSrc}getTitle(){if(this.player.ads.ad&&this.player.ads.ad.title)return this.player.ads.ad.title}getDuration(){if(this.player.ads.ad&&this.player.ads.ad.duration)return this.lastDuration=this.player.ads.ad.duration,this.lastDuration}getPlayerName(){return"bcove-ads"}getPlayerVersion(){return this.player.ads.VERSION}registerListeners(){for(var e in this.monitorPlayhead(!0,!1),this.references=[],this.references["ads-ad-started"]=this.adStartListener.bind(this),this.references["ads-pause"]=this.adPausedListener.bind(this),this.references["ads-play"]=this.adResumedListener.bind(this),this.references["ads-ad-ended"]=this.adEndedListener.bind(this),this.references["ima3-skipped"]=this.adSkippedListener.bind(this),this.references["ima3-ad-error"]=this.errorListener.bind(this),this.references.adserror=this.errorListener.bind(this),this.references["ads-click"]=this.clickListener.bind(this),this.references["ads-first-quartile"]=this.firstQuartileListener.bind(this),this.references["ads-midpoint"]=this.secondQuartileListener.bind(this),this.references["ads-third-quartile"]=this.thirdQuartileListener.bind(this),this.references)this.player.on(e,this.references[e])}firstQuartileListener(e){this.fireQuartile(1)}secondQuartileListener(e){this.fireQuartile(2)}thirdQuartileListener(e){this.fireQuartile(3)}adStartListener(e){this.getVideo().getAdapter()&&this.getVideo().getAdapter().firePause(),this.fireStart(),this.fireJoin()}adPausedListener(e){this.firePause()}adResumedListener(e){this.fireResume()}adEndedListener(e){this.fireStop({adPlayhead:this.lastDuration});const t=this.getVideo().getAdapter();t&&t.fireResume()}adSkippedListener(e){this.fireStop({skipped:!0});const t=this.getVideo().getAdapter();t&&t.fireResume()}errorListener(e){this.fireError("Ad error")}clickListener(e){var t=null;this.player.ima3&&this.player.ima3.currentAd&&this.player.ima3.currentAd.g&&(t=this.player.ima3.currentAd.g.clickThroughUrl),this.fireClick({url:t})}unregisterListeners(){if(this.monitor&&this.monitor.stop(),this.player&&this.references){for(var e in this.references)this.player.off(e,this.references[e]);this.references=[]}}}class v{getPosition(){var e=this.getNpawReference().Constants.AdPosition,t=e.Midroll,i=this.getVideo();let s="";null!==this.player&&null!==this.player.ads&&null!==this.player.ads.currentAdBreak&&null!==this.player.ads.currentAdBreak.integration&&(s=this.player.ads.currentAdBreak.integration);const r="google-ima"===s;if(i){var a=i.getAdapter();if(a){const s=i.getPlayhead(),n=i.getDuration()||0;s<.1||!r&&!a.flags.isJoined?t=e.Preroll:(r&&s+1>=n||!r&&s+1+this.getDuration()>=n)&&(t=e.Postroll)}}return t}quartileListener(e){var t=this.getPlayhead()/this.duration;t>=.25&&(this.fireQuartile(1),t>=.5&&(this.fireQuartile(2),t>=.75&&this.fireQuartile(3)))}resumeAdListener(e){this.fireResume()}getIsVisible(){try{var e=this.player?this.player.element:null}catch(e){}return!!e&&this.getNpawUtils().calculateAdViewability(e)}skipAdListener(e){this.fireSkip()}_getCurrentAd(){var e=this.player.ads,t=null;return e&&(e.currentAds&&e.currentAds[0]?t=e.currentAds[0]:e&&e.currentAdBreak&&e.currentAdBreak.ads[this.adCount-1]&&(t=e.currentAdBreak.ads[this.adCount-1])),t}errorAdListener(e){this.fireError(),this.flags.isStarted||(this.adCount=(this.adCount||0)+1)}getGivenBreaks(){var e=null;return this.player.ads.scheduledAdBreaks&&(e=this.player.ads.scheduledAdBreaks.length||e),e}getIsSkippable(){var e=this._getCurrentAd();return!(!e||!e.skipOffset)&&e.skipOffset>=0}getIsFullscreen(){var e=!1;return this.player.element&&this.player.element.clientWidth&&this.player.element.clientHeight&&(e=window.innerHeight<=this.player.element.clientHeight+30&&window.innerWidth<=this.player.element.clientWidth+30),e}getVersion(){return"7.0.14-theoplayer2-ads-jsclass"}getAudioEnabled(){return!this.player.muted&&this.player.volume>0}unregisterListeners(){if(this.monitor&&this.monitor.stop(),this.player&&this.player.ads&&this.references){for(var e in this.references)this.player.ads.removeEventListener(e,this.references[e]);delete this.references}if(this.player&&this.playerReferences){for(var t in this.playerReferences)this.player.removeEventListener(t,this.playerReferences[t]);delete this.playerReferences}}
1breakBeginListener(e){this.adCount=0,this.actualSlot=e.ad}registerListeners(){if(this.player.ads){for(var e in this.isDAI=!1,this.getNpawUtils().logAllEvents(this.player.ads),this.monitorPlayhead(!0,!1,2e3),this.references={adbegin:this.playAdListener.bind(this),adend:this.endedAdListener.bind(this),aderror:this.errorAdListener.bind(this),adskip:this.skipAdListener.bind(this),adbreakbegin:this.breakBeginListener.bind(this),adbreakend:this.breakEndListener.bind(this)},"undefined"!=typeof google&&google.ima.dai&&(this.isDAI=!0),this.playerReferences={pause:this.pauseAdListener.bind(this),playing:this.resumeAdListener.bind(this),play:this.resumeAdListener.bind(this),timeupdate:this.quartileListener.bind(this)},this.references)this.player.ads.addEventListener(e,this.references[e]);for(var t in this.playerReferences)this.player.addEventListener(t,this.playerReferences[t])}}getPlayhead(){let e=this.player.currentTime;return 1==this.isDAI&&(e=this.player.currentTime-this.playhead),e}getDuration(){var e=this._getCurrentAd();return e&&e.duration?e.duration:this.player.duration}pauseAdListener(e){this.firePause()}breakEndListener(e){this.fireBreakStop();const t=this.getVideo().getAdapter();t&&t.fireResume(),this.getVideo().requestBuilder.lastSent.givenAds=void 0;const i=this.getNpawReference().Constants.AdPosition.Postroll;this.getPosition()===i&&0===this.player.ads.scheduledAds.length&&this.getVideo().getAdapter().fireStop({},"breakEndListener")}getGivenAds(){return this.actualSlot?this.actualSlot.ads.length:null}endedAdListener(e){const t=this.getVideo().getAdapter();t&&!t.flags.isStarted&&this.fireStart(),this.fireStop({adPlayhead:this.duration})}getResource(){var e=null,t=this._getCurrentAd();return t&&(t.mediaUrl?e=t.mediaUrl:t.mediaFiles&&(e=t.mediaFiles[0].resourceURI||t.mediaFiles[0].contentURL)),e}getTitle(){var e=this._getCurrentAd();return e&&e.title?e.title:"unknown"}playAdListener(e){this.adCount=(this.adCount||0)+1;var t=this.getVideo().getAdapter();t&&(t.ended=!1,t.fireInit(),t.firePause()),this.fireStart({adPlayhead:"0"}),this.fireJoin({adPlayhead:"0"}),this.duration=this.getDuration(),this.playhead=this.player.currentTime}}class A{getVersion(){return"7.0.3-chromecast-caf-ads-js"}getPlayerName(){return"Chromecast CAF Ads"}getPlayhead(){return this.player.getBreakClipCurrentTimeSec()}getDuration(){return this.player.getBreakClipDurationSec()}getPosition(){var e=this.getNpawReference().Constants.AdPosition.Midroll,t=this.plugin.getAdapter();return t&&(!t.flags.isJoined||t.getPlayhead()<1?e=this.getNpawReference().Constants.AdPosition.Preroll:t.getPlayhead()+1>=t.getDuration()&&(e=this.getNpawReference().Constants.AdPosition.Postroll)),e}getTitle(){return"unknown"}getResource(){return"unknown"}getCreativeId(){return this.clipId}getIsVisible(){return!0}getIsFullscreen(){return!0}getIsSkippable(){return this.isSkippable}getGivenAds(){return this.adsInBreak}getBreaksTime(){var e=this.player.getBreaks(),t=[];for(var i in e){var s=e[i].position,r=this.plugin?this.plugin.getAdapter():null;-1===s&&r&&(s=r.getDuration()),-1===t.indexOf(s)&&t.push(s)}return t}getGivenBreaks(){var e=this.player.getBreaks(),t=[];for(var i in e){var s=e[i].position,r=this.plugin?this.plugin.getAdapter():null;-1===s&&r&&(s=r.getDuration()),-1===t.indexOf(s)&&t.push(s)}return t.length}registerListeners(){var e=cast.framework.events;for(var t in this.monitorPlayhead(!0,!1,1200),this.references={},this.references[e.EventType.BREAK_CLIP_LOADING]=this.playListener.bind(this),this.references[e.EventType.BREAK_CLIP_STARTED]=this.joinListener.bind(this),this.references[e.EventType.BREAK_CLIP_ENDED]=this.stopListener.bind(this),this.references[e.EventType.BREAK_STARTED]=this.breakStartListener.bind(this),this.references[e.EventType.BREAK_ENDED]=this.breakEndListener.bind(this),this.references[e.EventType.PAUSE]=this.pauseListener.bind(this),this.references[e.EventType.PLAYING]=this.playingListener.bind(this),this.references)this.player.addEventListener(t,this.references[t])}unregisterListeners(){if(this.monitor&&this.monitor.stop(),this.player&&this.references){for(var e in this.references)this.player.removeEventListener(e,this.references[e]);this.references={}}}playListener(e){var t=this.plugin.getAdapter();t&&(t.fireStart({},"playListener-ads"),t.firePause({},"playListener-ads")),void 0!==e?(this.isSkippable=void 0!==e.whenSkippable,this.clipId=e.breakClipId):(this.isSkippable=!1,this.clipId=null)}joinListener(e){this._quartileTimer||(this._quartileTimer=setInterval(this.sendQuartile.bind(this),1e3));var t=this.plugin?this.plugin.getAdapter():null;t&&t.firePause({},"joinListener-ads"),this.plugin&&this.plugin.isBreakStarted&&(this.fireStart({},"joinListener"),this.fireJoin({},"joinListener"))}breakStartListener(e){this.adsInBreak=e.total,this.fireBreakStart(),this._quartileTimer||(this._quartileTimer=setInterval(this.sendQuartile.bind(this),1e3)),this.fireStart({},"breakStartListener"),this.fireJoin({},"breakStartListener")}stopListener(e){this.fireStop({},"stopListener")}breakEndListener(e){this.adsInBreak=void 0,this.fireBreakStop();var t=this.plugin?this.plugin.getAdapter():null;t&&t.fireResume({},"endListener-ads")}sendQuartile(e){var t=this.getPlayhead(),i=this.getDuration();t>i/4&&(this.fireQuartile(1),t>i/2&&(this.fireQuartile(2),t>.75*i&&(this.fireQuartile(3),this._quartileTimer&&(clearInterval(this._quartileTimer),this._quartileTimer=void 0))))}pauseListener(e){this.flags.isBuffering||this.firePause({},"pauseListener")}playingListener(e){this.fireResume({},"playingListener")}}class S{getVersion(){return"7.0.1-react-native-video-ads-jsclass"}getDuration(){return this.duration||0}getResource(){return this.resource||"N/A"}getPlayhead(){const e=this.getVideo().getAdapter();return e?e.playhead:void 0}getTitle(){return this.title||"N/A"}getPosition(){var e=this.getNpawReference().Constants.AdPosition.Midroll;return this.getVideo().getAdapter()&&!this.getVideo().getAdapter().flags.isJoined&&(e=this.getNpawReference().Constants.AdPosition.Preroll),e}onAdEvent(e){switch(e.event){case"FIRST_QUARTILE":this._quartileHandler(1);break;case"MIDPOINT":this._quartileHandler(2);break;case"THIRD_QUARTILE":this._quartileHandler(3);break;case"STARTED":this.adStartedListener();break;case"COMPLETED":this.adCompleteListener();break;case"CLICK":this.adClickListener();break;case"PAUSED":this.adPauseListener();break;case"RESUMED":this.adPlayListener();break;case"ERROR":this.adErrorListener();break;case"SKIPPED":this.adSkippedListener();break;case"CONTENT_RESUME_REQUESTED":this.adBreakFinished();break;case"CONTENT_PAUSE_REQUESTED":const e=this.getVideo().getAdapter();e.flags.isPaused||(e.firePause(),e.lastPlayhead=e.getPlayhead()),this.showingAds=!0;break;case"ALL_ADS_COMPLETED":this.getVideo().getAdapter().reactPlatform&&"ios"===this.getVideo().getAdapter().reactPlatform&&this.getVideo().getAdapter().fireStop({},"onAdEvent")}}isShowingAds(){return this.showingAds}_quartileHandler(e){this.fireQuartile(e)}adStartedListener(e){this.getVideo().getAdapter()&&this.getVideo().getAdapter().stopTimer&&clearTimeout(this.getVideo().getAdapter().stopTimer),this.showingAds=!0,this.getVideo().getAdapter().cancelSeek(),this.fireStart({},"adStartListener"),this.fireJoin({},"adStartListener")}adPauseListener(e){this.firePause({},"adPauseListener")}adPlayListener(e){this.fireResume({},"adPlayListener")}adSkippedListener(e){this.fireSkip({},"adSkippedListener")}adCompleteListener(e){this.fireStop({},"adCompleteListener"),this.resetValues()}adClickListener(e){this.fireClick(this.clickThrough)}adBreakFinished(e){this.fireBreakStop({},"adBreakFinished"),this.showingAds=!1}adErrorListener(e){if(e.message){var t=e.message.toLowerCase();t.indexOf("ad tag empty")>-1?this.fireManifest(this.getNpawReference().Constants.ManifestError.EMPTY,e.message):t.indexOf("error loading ad tag")>-1||t.indexOf("invalid ad tag")>-1||t.indexOf("any valid ads")>-1?this.fireManifest(this.getNpawReference().Constants.ManifestError.WRONG,e.message):!e.adErrorCode||60006!==e.adErrorCode&&10403!==e.adErrorCode?(this.fireError(e.adErrorCode,e.message),this.fireStop(),this.resetValues(),t.indexOf("timeout")>-1&&this.fireBreakStop()):this.fireManifest(this.getNpawReference().Constants.ManifestError.WRONG,e.message)}}resetValues(){this.playhead=void 0,this.duration=void 0,this.position=void 0,this.resource=void 0,this.title=void 0,this.showingAds=!1}}const E={video:{Hlsjs:class{checkExistsPlayer(){try{return this.checkExistsObjectOnPage(this.player.media)}catch(e){return!0}}getVersion(){return"7.0.6-hlsjs-jsclass"}getPlayhead(){var e=null;return this.getVideo()&&this.getVideo().isBreakStarted?this._lastPlayhead:(this.tag&&(e=this.tag.currentTime),e)}getPlayrate(){var e=null;return this.tag&&(e=this.tag.playbackRate),e}getDroppedFrames(){var e=null;return this.tag&&(e=this.tag.webkitDroppedFrameCount),e}getDuration(){var e=null;
1return this.tag&&!this.getIsLive()&&(e=this.tag.duration),e}getBitrate(){var e=null;return-1!==this.player.currentLevel&&this.player.levels[this.player.currentLevel]&&(e=this.player.levels[this.player.currentLevel].bitrate),e}getRendition(){var e=null;if(-1!==this.player.currentLevel){var t=this.player.levels[this.player.currentLevel];t&&(t.name?e=t.name:t.bitrate&&(e=this.getNpawUtils().buildRenditionString(t.width,t.height,t.bitrate)))}return e}getIsLive(){var e=null;return this.player.levels&&this.player.levels[this.player.currentLevel]&&(e=this.player.levels[this.player.currentLevel].details.live),e}getLatency(){var e=this.player.latency;return e?1e3*e:void 0}getResource(){return this.player.url}getPlayerVersion(){return"undefined"!=typeof Hls?Hls.version:"unknown"}getPlayerName(){return"Hls.js"}registerListeners(){if(this.mediaFound=!(!this.player||!this.player.media),this._lastPlayhead=0,this.mediaFound)for(var e in this.hlsReference||this.hlsMediaReference||(this.tag=this.player?this.player.media:null,this._registerHlsRef()),this.references={play:this.playListener.bind(this),pause:this.pauseListener.bind(this),playing:this.playingListener.bind(this),seeking:this.seekingListener.bind(this),error:this.errorListener.bind(this),ended:this.endedListener.bind(this),progress:this.progressListener.bind(this),waiting:this.bufferingListener.bind(this),timeupdate:this.timeupdateListener.bind(this)},this.player.on(Hls.Events.LEVEL_SWITCHED,this.detectQualityChange.bind(this)),this.references)this.tag.addEventListener(e,this.references[e]);else this._registerHlsRef()}detectQualityChange(e,t){let i;const s=this.player.levels[t.level];s&&(s.name?i=s.name:s.bitrate&&(i=this.getNpawUtils().buildRenditionString(s.width,s.height,s.bitrate))),i&&this.storeNewRendition(i)}_registerHlsRef(){this.hlsReference=this.hlsErrorListener.bind(this),this.hlsMediaReference=this.getTagListener.bind(this),this.player.on("hlsError",this.hlsReference,this),this.player.on("hlsMediaAttached",this.hlsMediaReference)}unregisterListeners(){if(this.monitor&&this.monitor.stop(),this.player&&(this.hlsReference&&this.player.off("hlsError",this.hlsReference,this),this.hlsMediaReference&&this.player.off("hlsMediaAttached",this.hlsMediaReference),this.player.off(Hls.Events.LEVEL_SWITCHED,this.detectQualityChange.bind(this)),this.hlsReference=null,this.hlsMediaReference=null),this.tag&&this.references){for(var e in this.references)this.tag.removeEventListener(e,this.references[e]);delete this.references}}progressListener(e){this._lastPlayhead=this.getPlayhead(),this.flags.isStarted?!this.flags.isJoined&&this.getVideo().getIsLive()&&this.fireJoin({},"progressListener"):this.getPlayhead()>1&&(this.startedOnce||!this.getVideo().getIsLive())&&(this.fireStart({},"progressListener"),this.fireJoin({},"progressListener"))}timeupdateListener(e){this._lastPlayhead=this.getPlayhead(),this.flags.isStarted?!this.flags.isJoined&&this.getVideo().getIsLive()&&this.fireJoin({},"timeupdateListener"):this.getPlayhead()>1&&(this.startedOnce||!this.getVideo().getIsLive())&&(this.fireStart({},"timeupdateListener"),this.fireJoin({},"timeupdateListener"))}playListener(e){this.fireStart({},"playListener"),this.startedOnce=!0}pauseListener(e){this.flags.isBuffering||(this.firePause({},"pauseListener"),this.pauseStamp=e.timeStamp)}playingListener(e){this.fireJoin({},"playingListener"),this.fireBufferEnd({},"playingListener"),this.fireSeekEnd({},"playingListener"),this.fireResume({},"playingListener")}seekingListener(e){this.fireSeekBegin({},!1,"seekingListener")}bufferingListener(e){this.tag&&2!==this.tag.readyState||this.fireBufferBegin({},!1,"bufferingListener")}errorListener(e){this.fireError(this.tag.error.code,"PLAY FAILURE",void 0,void 0,"errorListener")}endedListener(e){const t=this.getVideo().getAdsAdapter();let i=!1;t&&void 0!==t.isDAI&&(t.isDAI||(i=t.player.getCuePoints().includes(-1))),i||this.fireStop({},"endedListener")}hlsErrorListener(e,t){t.fatal&&this.fireFatalError(t.details,"PLAYER FAILURE",void 0,void 0,"hlsErrorListener")}getTagListener(){this.tag=this.player?this.player.media:null,this.mediaFound=!0,this.registerListeners()}},Bitmovin:class{adsAdapters={nativeAdsAdapter:i};getVersion(){return"7.0.9-bitmovin8-jsclass"}getPlayhead(){let e=this.player?this.player.getCurrentTime():null;return this.getVideo().getAdsAdapter()&&this.getVideo().getAdsAdapter().flags.isStarted&&(e=this.lastPlayhead||0),e}getPlayrate(){return this.player?this.player.getPlaybackSpeed():null}getStopParams(){let e={};return this.getVideo().getPlayhead()>0&&(e={playhead:this.getVideo().getPlayhead()}),e}getDroppedFrames(){return this.player?this.player.getDroppedVideoFrames():null}getDuration(){let e=null;return this.player&&(this.lastDuration=this.player.getDuration()||this.lastDuration,e=this.lastDuration),e}getBitrate(){let e=null;if(this.player){const t=this.player.getPlaybackVideoData(),i=this.player.getVideoQuality();i&&i.bitrate?e=i.bitrate:t&&t.bitrate&&(e=t.bitrate)}return e}getRendition(){let e=null;if(this.player){const t=this.player.getPlaybackVideoData(),i=this.player.getVideoQuality();i&&i.bitrate?e=this.getNpawUtils().buildRenditionString(i.width,i.height,i.bitrate):t&&t.bitrate&&(e=this.getNpawUtils().buildRenditionString(t.width,t.height,t.bitrate))}return e}detectQualityChange(e){let t;e.targetQuality&&e.targetQuality.bitrate&&(t=this.getNpawUtils().buildRenditionString(e.targetQuality.width,e.targetQuality.height,e.targetQuality.bitrate)),t&&this.storeNewRendition&&this.storeNewRendition(t)}getTitle(){return this.player?this.player.getSource().title:null}getIsLive(){return this.player?this.player.isLive():null}getResource(){let e=null;if(this.player&&this.player.getSource&&this.player.getSource()){try{if(this.player.getStreamType&&this.player.getStreamType()&&this.player.getSource()[this.player.getStreamType()])return this.player.getSource()[this.player.getStreamType()]}catch(e){}e=this.player.getSource().progressive||this.player.getSource().hls}try{this.player&&this.player.getManifest&&this.player.getManifest()&&
1(e=this.player.getManifest().indexOf("MPD")>0?this.player.getSource().dash:this.player.getSource().hls)}catch(e){this.log.notice("Can't get manifest")}return e}getPlayerVersion(){return this.player?this.player.version:null}getPlayerName(){return"Bitmovin"}_checkAdsAdapter(){const e=this.getVideo().getAdsAdapter();e?e&&!e.player&&e.setPlayer(this.player):(this.plugin.setAdsAdapter(this.getAdapterClass("nativeAdsAdapter"),this.getVideo().getVideoKey()),this.getVideo().getAdsAdapter().registerListeners())}registerListeners(){const e=this.player.exports.PlayerEvent;this.monitorPlayhead(!0,!1),this.references={},this.references[e.Play]=this.playListener.bind(this),this.references[e.Paused]=this.pauseListener.bind(this),this.references[e.Playing]=this.playingListener.bind(this),this.references[e.Error]=this.errorListener.bind(this),this.references[e.Seek]=this.seekingListener.bind(this),this.references[e.TimeShift]=this.seekingListener.bind(this),this.references[e.TimeShifted]=this.seekedListener.bind(this),this.references[e.PlaybackFinished]=this.endedListener.bind(this),this.references[e.TimeChanged]=this.timeupdateListener.bind(this),this.references[e.SourceUnloaded]=this.endedListener.bind(this),this.references[e.Destroy]=this.destroyListener.bind(this),this.references[e.Ready]=this.readyListener.bind(this),this.references[e.AdBreakStarted]=this._checkAdsAdapter.bind(this),this.references[e.VideoPlaybackQualityChanged]=this.detectQualityChange.bind(this);for(let e in this.references)this.player.on(e,this.references[e]);this.plugin.setAdsAdapter(this.getAdapterClass("nativeAdsAdapter"),this.getVideo().getVideoKey()),this.getVideo().getAdsAdapter().registerListeners()}unregisterListeners(){this.monitor&&this.monitor.stop();try{if(this.getVideo()&&this.getVideo().removeAdsAdapter(),this.player&&this.player.off&&this.references){for(let e in this.references)this.player.off(e,this.references[e]);delete this.references}}catch(e){}}readyListener(e){this._checkAdsAdapter()}playListener(e){this.firePlayerLog("playListener",{}),this.lastPlayhead=0,this.fireStart(),this.failedView=!1}timeupdateListener(e){const t=this.lastPlayhead;if(this.getVideo().getAdsAdapter()&&this.getVideo().getAdsAdapter().flags.isStarted||(this.lastPlayhead=this.player.getCurrentTime()),this.getPlayhead()>.2&&(this.getIsLive()||this.getPlayhead()+1<this.getDuration())&&(this.fireStart(),this.failedView=!1,this.flags.isJoined||(this.monitor.skipNextTick(),this.fireJoin())),!this.player.isPaused()&&this.flags.isSeeking)if(this.plugin&&this.plugin.options&&this.plugin.options.ignoreSeekInTimeUpdate){const e=this.player.getCurrentTime();if(null!==this.seekStartPosition){const i=Math.abs(e-this.seekStartPosition),s=Math.abs(this.lastPlayhead-t),r=.25;i>r||s>r?(this.fireSeekEnd({},"timeupdateListener"),this.monitor.skipNextTick(),this.seekStartPosition=null):this.cancelSeek()}}else this.fireSeekEnd({},"timeupdateListener"),this.monitor.skipNextTick()}pauseListener(e){this.firePlayerLog("pauseListener",{}),e.issuer&&"ui-seek"===e.issuer?this.fireSeekBegin({},!1,"pauseListener"):this.firePause()}playingListener(e){this.firePlayerLog("playingListener",{}),this.fireStart(),this.failedView=!1,this.fireResume(),this.flags.isJoined||this.monitor.skipNextTick()}errorListener(e){this.firePlayerLog("errorListener",{}),this.failedView||(this.flags.isStarted||(this.failedView=!0),this.fireError(e.code,e.name),this.fireStop(this.getStopParams()))}seekingListener(e){this.firePlayerLog("seekingListener",{}),this.seekStartPosition=e.position??this.player.getCurrentTime(),this.fireSeekBegin({},!1,"seekingListener")}seekedListener(e){this.firePlayerLog("seekedListener",{}),this.fireSeekEnd({},"seekedListener")}endedListener(e){this.firePlayerLog("endedListener",{}),this.fireStop(this.getStopParams())}destroyListener(e){this.player=null,this.tag=null,this.fireStop(),this.getVideo().removeAdapter()}getVideoBufferLength(){return this.player?this.player.getVideoBufferLength():null}},Videojs:class{adsAdapters={bcoveImaAdsAdapter:o,genericAdsAdapter:d};additionalContexts={contribHlsTech:l,dashTech:h,dashShakaTech:n,hlsJsTech:r,streamrootHlsJsTech:a,shakaTech:s};isInAds(e=!1){try{const t=this.getVideo().getAdsAdapter();return e&&t&&void 0!==t.isDAI&&!t.isDAI?t.player.getCuePoints().includes(-1):this.player.ads&&this.player.ads.inAdBreak&&"function"==typeof this.player.ads.inAdBreak&&this.player.ads.inAdBreak()}catch(e){return!1}}getBitrate(){let e=null;const t=this.getUsedTech();return t&&t.getBitrate&&(e=t.getBitrate(this)),e}checkExistsPlayer(){try{return this.checkExistsObjectOnPage(this.player.el(
1))}catch(e){return!0}}pauseListener(e){this.firePlayerLog("pauseListener",{}),this.firePause({},"pauseListener")}bufferingListener(e){this.firePlayerLog("bufferingListener",{}),this.flags.isSeeking||this.fireBufferBegin({},!1,"bufferingListener")}getRendition(){let e=null;const t=this.getUsedTech();return t&&t.getRendition?e=t.getRendition(this):this.player.videoHeight()&&this.player.videoWidth()&&(e=this.getNpawUtils().buildRenditionString(this.player.videoHeight(),this.player.videoWidth())),e}getPlayerVersion(){let e=null;return"undefined"!=typeof videojs&&(e=videojs.VERSION),e}playListener(e){this.firePlayerLog("playListener",{}),this.isInAds()||(this.flags.isStarted?this.lastSrc&&this.lastSrc!==this.getResource()&&(this.fireStop({},"playListenerNewResource"),this.acumBytesFunc(),this.lastPlayhead=void 0,this._startEvent("playListenerNewResource"),this.lastSrc=this.getResource()):(this.lastSrc=this.getResource(),this._startEvent("playListenerNotStarted")))}loadAdsAdapter(){if(this.getVideo())if(!this.getVideo().getAdsAdapter()||this.getVideo().getAdsAdapter().isGeneric){let e=null;this.getAdapterClass("bcoveImaAdsAdapter").isUsed(this)?e=this.getAdapterClass("bcoveImaAdsAdapter"):null===this.getVideo().getAdsAdapter()&&(e=this.getAdapterClass("genericAdsAdapter"),e.initProperties()),e&&this.getVideo().setAdsAdapter(e,this.plugin,!0)}else this.getVideo().getAdsAdapter().registerImaEvents&&this.getVideo().getAdsAdapter().registerImaEvents()}errorModifyer(e,t,i){this.fatalList=e||[],this.nonFatalList=t||[],this.ignoreList=i||[]}getPlayrate(){return this.player.playbackRate()}timeupdateListener(e){this.isInAds()||(this.getPlayhead()>.1&&(this.fireJoin({},"timeupdateListener"),this.joinPolling&&this.joinPolling.stop(),!this.flags.isPaused&&this.lastSeekPlayhead&&this.lastSeekPlayhead!==this.getPlayhead()&&(this.fireSeekEnd({},"timeupdateListener"),this.lastSeekPlayhead=!1)),this.flags.isJoined||(void 0===this.lastPlayhead&&(this.lastPlayhead=this.getPlayhead()),this.lastPlayhead!==this.getPlayhead()&&(this.player.options_&&this.plugin&&!this.getVideo().options["content.id"]&&(this.getVideo().options["content.id"]=this.player.options_["data-video-id"]),this.fireStart({},"timeupdateListener"),this.fireJoin({},"timeupdateListener"),this.joinPolling&&this.joinPolling.stop(),this.lastPlayhead=void 0)),this.getVideo()._adsAdapter&&!this.getVideo()._adsAdapter.flags.isStarted&&(this.lastPlayhead=this.getPlayhead()))}getPlayhead(){let e=this.player.currentTime();return this.getVideo()._adsAdapter&&this.getVideo()._adsAdapter.flags.isStarted&&(e=this.lastPlayhead||e),e}getDuration(){var e=this.player.duration();return this.player.mediainfo&&void 0!==this.player.mediainfo.duration&&(e=this.player.mediainfo.duration),e}aderrorListener(e){this.loadAdsAdapter(),this.getVideo().getAdsAdapter()&&this.getVideo().getAdsAdapter().adPlayerErrorListener&&this.getVideo().getAdsAdapter().adPlayerErrorListener(e)}_jointimePolling(e){this.getVideo()?this.getVideo().getAdsAdapter()&&this.getVideo().getAdsAdapter().flags.isStarted||(0!==this.lastPlayhead&&"number"==typeof this.lastPlayhead&&this.lastPlayhead!==this.getPlayhead()&&(this.fireJoin({},"jointimePolling"),this.joinPolling&&this.joinPolling.stop()),this.lastPlayhead=this.getPlayhead()):this.joinPolling&&this.joinPolling.stop()}acumBytesFunc(){this.acumBytes+=this.getTotalBytes()||0}adsEndedListener(e){this.firePlayerLog("adsEndedListener",{}),this.adsEnded=!0,this.getVideo().requestBuilder.lastSent.adPosition===this.getNpawReference().Constants.AdPosition.Postroll&&(this.getVideo().getAdapter().fireStop({},"adsEndedListener"),this.acumBytesFunc(),this.lastPlayhead=void 0)}getVersion(){return"7.0.11-videojs-jsclass"}seekedListener(e){this.firePlayerLog("seekedListener",{}),this.flags.isPaused||this.fireSeekEnd({},"seekedListener"),this.lastSeekPlayhead=this.getPlayhead()}getTech(){return this.player.tech({IWillNotUseThisInPlugins:!0})}unregisterListeners(){if(this.monitor&&this.monitor.stop(),this.player&&this.references){try{for(var e in this.references)this.player.off(e,this.references[e])}catch(e){}delete this.references}}_startEvent(e){this.loadAdsAdapter(),this.player.options_&&this.plugin&&!this.plugin.options["content.id"]&&(this.plugin.options["content.id"]=this.player.options_["data-vi
1deo-id"]),this.fireStart({},e),this.flags.isJoined||(this.joinPolling||(this.joinPolling=new(this.getNpawReference().Timer)(this._jointimePolling.bind(this),500)),this.joinPolling.start())}getIsLive(){var e=null;if(this.player.mediainfo&&(e=!0,"number"==typeof this.player.mediainfo.duration&&(e=this.player.mediainfo.duration<1||this.player.mediainfo.duration===1/0)),this.player.duration&&"function"==typeof this.player.duration){e=!0;var t=this.player.duration();"number"==typeof t&&(e=t<1||t===1/0)}return this.player.isLive&&"function"===this.player.isLive&&(e=this.player.isLive()),e}conditionalStop(e){this.firePlayerLog("conditionalStop",{}),this.isInAds(!0)||this.plugin&&(this.adsEnded=!1,this.fireStop({},"conditionalStop"),this.plugin&&!this.getVideo().options["content.id"]&&(this.getVideo().options["content.id"]=null),this.acumBytesFunc(),this.lastPlayhead=void 0)}getTitle(){var e=null;return this.player.mediainfo&&(e=this.player.mediainfo.name),e}getTotalBytes(){var e=null,t=this.getUsedTech();return t&&t.getTotalBytes&&(e=t.getTotalBytes(this)),e}registerListeners(){if(this.monitorPlayhead(!1,!1,1200),this.acumBytes=0,this.ignoreList=[],this.fatalList=[],this.nonFatalList=[],this.references={loadstart:this.loadstartListener.bind(this),adsready:this.loadAdsAdapter.bind(this),play:this.playListener.bind(this),timeupdate:this.timeupdateListener.bind(this),pause:this.pauseListener.bind(this),playing:this.playingListener.bind(this),ended:this.conditionalStop.bind(this),dispose:this.disposeListener.bind(this),seeking:this.seekingListener.bind(this),seeked:this.seekedListener.bind(this),error:this.errorListener.bind(this),adserror:this.aderrorListener.bind(this),adsEnded:this.adsEndedListener.bind(this),texttrackchange:this.textListener.bind(this),waiting:this.bufferingListener.bind(this)},this.player)for(var e in this.references)this.player.on(e,this.references[e]);setTimeout(this.loadAdsAdapter.bind(this),50)}getResource(){var e=null,t=this.getUsedTech();return t&&t.getResource&&(e=t.getResource(this)),e||(e=this.player.currentSrc()),e}textListener(e){if(this.player.textTracks)for(var t=this.player.textTracks(),i=t.length,s=0;s<i;++s)t[s]&&"showing"===t[s].mode&&(this.getVideo().options["content.subtitles"]=t[s].label||t[s].language)}seekingListener(e){this.firePlayerLog("seekingListener",{}),this.fireSeekBegin({},!1,"seekingListener")}disposeListener(e){this.firePlayerLog("disposeListener",{}),this.plugin&&(this.getVideo().fireStop({},"disposeListener"),this.getVideo().removeAdsAdapter(),this.getVideo().removeAdapter())}loadstartListener(e){this.firePlayerLog("loadstartListener",{}),this.loadAdsAdapter()}getPlayerName(){var e="videojs";return this.getAdapterClass("contribHlsTech").isUsed(this)?e+="-hls":this.getAdapterClass("hlsJsTech").isUsed(this)?e+="-hlsjs":this.getAdapterClass("shakaTech").isUsed(this)?e+="-shaka":this.getAdapterClass("dashShakaTech").isUsed(this)?e+="-dash-shaka":this.getAdapterClass("dashTech").isUsed(this)&&(e+="-dash"),this.player.FreeWheelPlugin&&(e+="-fw"),this.player.mediainfo&&(e+="-bcove"),e}playingListener(e){this.firePlayerLog("playingListener",{}),this._startEvent("playingListener"),this.isInAds()||this.flags.isAdPaused||this.fireResume({},"playingListener"),this.getPlayhead()<1&&this.fireSeekEnd({},"playingListener"),this.fireBufferEnd({},"playingListener")}getUsedTech(){var e=null;if(this.getPlugin().getAdaptersProperties().usedTech){switch(this.getPlugin().getAdaptersProperties().usedTech.toLowerCase()){case"hls":this.getAdapterClass("contribHlsTech").isUsed(this)&&(e=this.getAdapterClass("contribHlsTech"));break;case"hlsjs":this.getAdapterClass("hlsJsTech").isUsed(this)&&(e=this.getAdapterClass("hlsJsTech"));break;case"shaka":this.getAdapterClass("shakaTech").isUsed(this)&&(e=this.getAdapterClass("shakaTech"));break;case"dashshaka":this.getAdapterClass("dashShakaTech").isUsed(this)&&(e=this.getAdapterClass("dashShakaTech"));break;case"streamrootHlsJsTech":this.getAdapterClass("streamrootHlsJsTech").isUsed(this)&&(e=this.getAdapterClass("streamrootHlsJsTech"));break;case"dash":this.getAdapterClass("dashTech").isUsed(this)&&(e=this.getAdapterClass("dashTech"))}if(null!=e)return e}return this.getAdapterClass("contribHlsTech").isUsed(this)?e=this.getAdapterClass("contribHlsTech"):this.getAdapterClass("hlsJsTech").isUsed(this)?e=this.getAdapterClass("hlsJsTech"):this.getAdapterClass("shakaTech").isUsed(this)?e=this.getAdapterClass("shakaTech"):this.getAdapterClass("dashShakaTech").isUsed(this)?e=this.getAdapterClass("dashShakaTech"):this.getAdapterClass("dashTech").isUsed(this)?e=this.getAdapterClass("dashTech"):this.getAdapterClass("streamrootHlsJsTech").isUsed(this)&&(e=this.getAdapterClass("streamrootHlsJsTech")),e}errorListener(e){this.firePlayerLog("errorListener",{});var t=!1,i=!1,s=null,r=null;
1this.player.error&&this.player.error()&&(s=Number(this.player.error().code),r=this.player.error().message),null!==s&&(this.ignoreList.includes(s)&&(t=!0),!i&&this.fatalList.includes(s)?i=!0:i&&this.nonFatalList.includes(s)&&(i=!1)),t||(i?(this.fireFatalError(s,r,void 0,void 0,"errorListener"),this.acumBytesFunc(),this.lastPlayhead=void 0,this.crashed=!0):this.fireError(s,r,void 0,void 0,"errorListener"))}},Shaka:class{checkExistsPlayer(){try{return this.checkExistsObjectOnPage(this._getTagFromPlayer())}catch(e){return!0}}getBitrate(){var e=this.player.getStats(),t=null;return void 0!==e.streamBandwidth&&(t=e.streamBandwidth),void 0!==e.streamStats&&(t=e.streamStats.videoBandwidth),t}pauseListener(e){this.firePlayerLog("pauseListener",{}),this.firePause({},"pauseListener")}bufferingListener(e){this.firePlayerLog("bufferingListener-"+e.buffering,{}),this.flags.isJoined?!0===e.buffering?this.fireBufferBegin({},!1,"bufferingListenerEnabled"):!1===e.buffering&&(this.flags.isSeeking?(this.fireSeekEnd({},"bufferingListenerIsSeeking"),this.cancelBuffer()):this.fireBufferEnd({},"bufferingListenerDisabled")):!0===e.buffering?this.fireBufferBegin({},!1,"bufferingListenerEnabled"):!1===e.buffering&&this.fireJoin({},"bufferingListenerNotJoined")}getLatency(){var e=this.player.getStats().liveLatency;return e?1e3*e:void 0}getRendition(){var e=this._getActiveTrack();return e?this.getNpawUtils().buildRenditionString(e.width,e.height,e.bandwidth):null}getPlayerVersion(){var e=null;return"undefined"!=typeof shaka&&(shaka.Player&&(e=shaka.Player.version),shaka.player&&(e=shaka.player.Player.version)),e}playListener(e){this.firePlayerLog("playListener",{}),this._callStart("playListener")}endedListener(e){const t=this.getVideo().getAdsAdapter();let i=!1;t&&void 0!==t.isDAI&&(t.isDAI||(i=t.player.getCuePoints().includes(-1))),i||(this.firePlayerLog("endedListener",{}),this.fireStop({},"endedListener"),this.bytes=0,this.supportBytes=!1)}getPlayrate(){return"function"==typeof this.player.getPlaybackRate&&this.player.getPlaybackRate()||1}timeupdateListener(e){this.getPlayhead()!==this.initialPlayhead&&"number"==typeof this.initialPlayhead?this._callStart("timeupdateListener"):this.initialPlayhead=this.getPlayhead()}getPlayhead(){var e=this.tag||this._getTagFromPlayer();return e?e.currentTime:null}getDuration(){var e=this.tag||this._getTagFromPlayer();return e?e.duration:null}getFramesPerSecond(){var e=this._getActiveTrack();return e?e.frameRate:null}getThroughput(){return this.player.getStats().estimatedBandwidth}getDroppedFrames(){return this.player.getStats().droppedFrames}supportTotalBytes(){return this.supportBytes}getTotalBytes(){return this.bytes}_registerTag(){if(this.tag=this.tag||this._getTagFromPlayer(),this.tag)for(var e in this.references)this.tag.addEventListener(e,this.references[e]);else setTimeout(this._registerTag.bind(this),50)}getVersion(){return"7.0.5-shaka-jsclass"}seekedListener(e){this.firePlayerLog("seekedListener",{}),this.isPlayerOnBuffering()&&this.existPlayerBufferingMethod||(this.flags.isBuffering?this.fireBufferEnd({},"seekedListener"):this.flags.isSeeking&&this.fireSeekEnd({},"seekedListener"))}unregisterListeners(){this.bytes=0,this.supportBytes=!1,this.monitor&&this.monitor.stop();var e=this.tag||this._getTagFromPlayer();if(e&&this.references){for(var t in this.references)e.removeEventListener(t,this.references[t]);delete this.references}if(this.player&&this.referencesPlayer){for(var i in this.referencesPlayer)this.player.removeEventListener(i,this.referencesPlayer[i]);delete this.referencesPlayer}}getIsLive(){return!!this.player.isLive()||!this.getDuration()}_callStart(e){this.flags.isStarted||(this.fireStart({},e),this.initialPlayhead=this.getPlayhead()),this._initialPlayheadChanged()&&this.fireJoin({},e)}getTitle(){var e=this.tag||this._getTagFromPlayer();return e?e.title:null}networkResponseFilter(e,t){try{if(e!=shaka.net.NetworkingEngine.RequestType.SEGMENT)return;t&&t.data&&(this.bytes+=t.data.byteLength)}catch(e){}}registerListeners(){for(var e in this.bytes=0,this.supportBytes=!1,this.existPlayerBufferingMethod=this.player.isBuffering&&"function"==typeof this.player.isBuffering,this.monitorPlayhead(!1,!0),this.references={play:this.playListener.bind(this),loadstart:this.autoplayListener.bind(this),pause:this.pauseListener.bind(this),playing:this.playingListener.bind(this),seeking:this.seekingListener.bind(this),seeked:this.seekedListener.bind(this),ended:this.endedListener.bind(this),timeupdate:this.timeupdateListener.bind(this)},this.referencesPlayer={error:this.errorListener.bind(this),buffering:this.bufferingListener.bind(this),loading:this.loadingListener.bind(this)},this.tag=null,this._registerTag(),this.referencesPlayer)this.player.addEventListener(e,this.referencesPlayer[e]);this.player&&this.player.getNetworkingEngine&&"function"==typeof this.player.getNetworkingEngine&&this.player.getNetworkingEngine().registerResponseFilter&&"function"==typeof this.player.getNetworkingEngine().registerResponseFilter&&(this.supportBytes=!0,this.player.getNetworkingEngine().registerResponseFilter(this.networkResponseFilter.bind(this)))}getResource(){var e=this.tag||this._getTagFromPlayer(),t=e?e.currentSrc:null;
1return this.player.getAssetUri&&this.player.getAssetUri()?t=this.player.getAssetUri():this.player.getManifestUri&&this.player.getManifestUri()&&(t=this.player.getManifestUri()),t}_initialPlayheadChanged(){var e=!1;if(!this.flags.isJoined){var t=this.getPlayhead(),i=this.initialPlayhead||0,s=this.getVideo()?this.getVideo().getIsLive():this.getIsLive();(0!==i&&s||!s)&&t>i?e=!0:s&&(this.initialPlayhead=t)}return e}seekingListener(e){this.firePlayerLog("seekingListener",{}),this.fireSeekBegin({},!1,"seekingListener"),this.getVideo()&&this.getVideo().getIsLive()&&this.autoplayListener()}_getActiveTrack(){var e=null;if(this.player.getVariantTracks){var t=this.player.getVariantTracks();for(var i in t){var s=t[i];!s.active||"video"!==s.type&&"variant"!==s.type||(e=s)}}else if(this.player.getVideoTracks){var r=this.player.getVideoTracks();for(var a in r){var n=r[a];n.active&&(e=n)}}return e}getPlayerName(){return"Shaka"}playingListener(e){this.firePlayerLog("playingListener",{}),this.fireResume({},"playingListener"),this._callStart("playingListener"),this.isPlayerOnBuffering()&&this.existPlayerBufferingMethod||this.fireJoin({},"playingListener")}isPlayerOnBuffering(){return!!this.existPlayerBufferingMethod&&this.player.isBuffering()}loadingListener(e){this.firePlayerLog("loadingListener",{}),this.flags.isStarted&&(this.fireStop({},"loadingListener"),this.bytes=0,this.supportBytes=!1)}autoplayListener(e){this.firePlayerLog("autoplayListener",{});var t=this.tag||this._getTagFromPlayer();t&&t.autoplay&&this._callStart("autoplayListener")}errorListener(e){this.firePlayerLog("errorListener",{});var t=e.detail&&e.detail.code?e.detail.code:e.code,i=e.detail&&e.detail.message?e.detail.message:"unknown",s=e.detail&&e.detail.category?e.detail.category:e.category,r=e.detail&&e.detail.severity?e.detail.severity:e.severity;s&&s<10&&s>0&&(i={1:"network",2:"text",3:"media",4:"manifest",5:"streaming",6:"drm",7:"player",8:"cast",9:"storage"}[s]||i),2===r&&-1===[1002,3016].indexOf(t)?this.fireFatalError(t,i,void 0,void 0,"errorListener"):this.fireError(t,i,void 0,void 0,"errorListener")}_getTagFromPlayer(){return this.player.getMediaElement?this.player.getMediaElement():this.player.a}},Html5:class{checkExistsPlayer(){try{return this.checkExistsObjectOnPage(this.player)}catch(e){return!0}}pauseListener(e){this.firePlayerLog("pauseListener",{}),this.firePause({},"pauseListener")}bufferingListener(e){this.firePlayerLog("waitingListener",{}),this.fireBufferBegin({},!1,"waitingListener")}getIsLive(){return this.player.duration===1/0}playListener(e){this.firePlayerLog("playListener",{}),this.player&&this.playhead&&this.checkReadyState(this.player.readyState,"playListener"),(void 0===this.lastResource||this.getResource()&&this.lastResource!==this.getResource())&&(this.lastResource=this.getResource().split("?")[0]),this.fireStart({},"playListener")}registerListeners(){for(var e in this.monitorPlayhead(!1,!1),this.references={play:this.playListener.bind(this),timeupdate:this.timeupdateListener.bind(this),pause:this.pauseListener.bind(this),playing:this.playingListener.bind(this),error:this.errorListener.bind(this),seeking:this.seekingListener.bind(this),seeked:this.seekedListener.bind(this),ended:this.endedListener.bind(this),loadstart:this.loadStartListener.bind(this),waiting:this.bufferingListener.bind(this),canplay:this.canPlayListener.bind(this),canplaythrough:this.canPlayThroughListener.bind(this),loadedmetadata:this.loadedMetadataListener.bind(this),loadeddata:this.loadedDataListener.bind(this)},this.references)this.player.addEventListener(e,this.references[e])}endedListener(e){const t=this.getVideo().getAdsAdapter();let i=!1;t&&void 0!==t.isDAI&&(t.isDAI||(i=t.player.getCuePoints().includes(-1))),i||(this.firePlayerLog("endedListener",{}),this.fireStop({},"endedListener"))}getPlayrate(){return this.player.playbackRate}canPlayListener(e){this.player&&(this.playhead||this.getVideo()&&this.getVideo().getIsLive())&&this.checkReadyState(this.player.readyState,"canPlayListener")}canPlayThroughListener(e){this.player&&(this.playhead||this.getVideo()&&this.getVideo().getIsLive())&&this.checkReadyState(this.player.readyState,"canPlayThroughListener")}timeupdateListener(e){(this.getPlayhead()>0||this.getVideo()&&this.getVideo().getIsLive())&&!this.player.error&&(this.fireStart({},"timeupdateListener"),this.fireJoin({},"timeupdateListener"))}getResource(){return this.player.currentSrc}getPlayhead(){return this.player.currentTime}getDuration(){return this.player.duration}seekingListener(e){this.firePlayerLog("seekingListener",{}),this.fireSeekBegin({},!1,"seekingListener")}getPlayerName(){return"html5"}playingListener(e){this.firePlayerLog("playingListener",{}),this.fireJoin({},"playingListener"),this.fireResume({},"playingListener"),this.fireSeekEnd({},"playingListener"),this.flags.isBuffering&&this.fireBufferEnd({},"playingListener")}errorListener(e){this.firePlayerLog("errorListener",{});var t=null,i=null;try{e&&e.target&&e.target.error&&(i=e.target.error.code,t=e.target.error.message)}catch(e){}this.fireError(i,t,void 0,void 0,"errorListener")}loadedMetadataListener(e){this.player&&(this.playhead||this.getVideo()&&this.getVideo().getIsLive())&&this.checkReadyState(this.player.readyState,"loadedMetadataListener")}getVersion(){return"7.0.5-html5-jsclass"}seekedListener(e){this.firePlayerLog("seekedListener",{}),this.fireSeekEnd({},"seekedListener")}loadStartListener(e){this.firePlayerLog("loadStartListener",{}),this.flags.isJoined&&this.getResource()&&this.getResource().split("?")[0]!==this.lastResource&&this.fireStop({},"loadStartListener")}unregisterListeners(){if(this.monitor&&this.monitor.stop(),this.player&&this.references)for(var e in this.references)this.player.removeEventListener(e,this.references[e]),delete this.references[e]}loadedDataListener(e){this.player&&(this.playhead||this.getVideo()&&this.getVideo().getIsLive())&&this.checkReadyState(this.player.readyState,"loadedDataListener")}},Flvjs:class{checkExistsPlayer(){try{return this.checkExistsObjectOnPage(this.player)}catch(e){return!0}}pauseListener(e){this.firePlayerLog("pauseListener",{}),this.firePause({},"pauseListener")}stalledListener(e){this.firePlayerLog("stalledListener",{}),this.fireBufferBegin({},!1,"stalledListener")}bufferingListener(e){this.firePlayerLog("waitingListener",{}),this.fireBufferBegin({},!1,"waitingListener")}getIsLive(){return this.player.duration===1/0}playListener(e){this.firePlayerLog("playListener",{}),this.player&&this.playhead&&this.checkReadyState(this.player.readyState,"playListener"),this.fireStart({},"playListener")}registerListeners(){for(var e in this.monitorPlayhead(!1,!1),this.references={play:this.playListener.bind(this),timeupdate:this.timeupdateListener.bind(this),pause:this.pauseListener.bind(this),playing:this.playingListener.bind(this),error:this.errorListener.bind(this),seeking:this.seekingListener.bind(this),seeked:this.seekedListener.bind(this),ended:this.endedListener.bind(this),loadstart:this.loadStartListener.bind(this),stalled:this.stalledListener.bind(this),waiting:this.bufferingListener.bind(this),canplay:this.canPlayListener.bind(this),canplaythrough:this.canPlayThroughListener.bind(this),loadedmediadata:this.loadedMediaDataListener.bind(this),loadeddata:this.loadedDataListener.bind(this)},this.references)this.player.addEventListener(e,this.references[e])}endedListener(e){const t=this.getVideo().getAdsAdapter();let i=!1;t&&void 0!==t.isDAI&&(t.isDAI||(i=t.player.getCuePoints().includes(-1))),i||(this.firePlayerLog("endedListener",{}),this.fireStop({},"endedListener"))}getPlayrate(){return this.player.playbackRate}canPlayListener(e){this.player&&(this.playhead||this.getVideo()&&this.getVideo().getIsLive())&&this.checkReadyState(this.player.readyState,"canPlayListener")}canPlayThroughListener(e){this.player&&(this.playhead||this.getVideo()&&this.getVideo().getIsLive())&&this.checkReadyState(this.player.readyState,"canPlayThroughListener")}timeupdateListener(e){(this.getPlayhead()>0||this.getVideo()&&this.getVideo().getIsLive())&&!this.player.error&&(this.fireStart({},"timeupdateListener"),this.fireJoin({},"timeupdateListener"))}getResource(){return this.player.currentSrc}getPlayhead(){return this.player.currentTime}getDuration(){return this.player.duration}seekingListener(e){this.firePlayerLog("seekingListener",{}),this.fireSeekBegin({},!1,"seekingListener")}getPlayerName(){return"flvjs"}playingListener(e){this.firePlayerLog("playingListener",{}),this.fireJoin({},"playingListener"),this.fireResume({},"playingListener"),this.fireSeekEnd({},"playingListener"),this.flags.isBuffering&&this.fireBufferEnd({},"playingListener")}errorListener(e){this.firePlayerLog("errorListener",{});var t=null,i=null;try{e&&e.target&&e.target.error&&(i=e.target.error.code,t=e.target.error.message)}catch(e){}this.fireError(i,t,void 0,void 0,"errorListener")}loadedMediaDataListener(e){this.player&&(this.playhead||this.getVideo()&&this.getVideo().getIsLive())&&this.checkReadyState(this.player.readyState,"loadedMediaDataListener")}getVersion(){return"7.0.3-flvjs-jsclass"}seekedListener(e){this.firePlayerLog("seekedListener",{}),this.fireSeekEnd({},"seekedListener")}loadStartListener(e){this.firePlayerLog("loadStartListener",{}),this.flags.isJoined&&this.fireStop({},"loadStartListener")}unregisterListeners(){if(this.monitor&&this.monitor.stop(),this.player&&this.references)for(var e in this.references)this.player.removeEventListener(e,this.references[e]),delete this.references[e]}loadedDataListener(e){this.player&&(this.playhead||this.getVideo()&&this.getVideo().getIsLive())&&this.checkReadyState(this.player.readyState,"loadedDataListener")}},Jwplayer:class{adsAdapters={genericAdsAdapter:g};getVersion(){return"7.0.3-jwplayer-jsclass"}checkExistsPlayer(){try{return this.checkExistsObjectOnPage(this.player.getConfig().mediaElement)}catch(e){return!0}}getPlayhead(){if(this.getVideo()&&this.getVideo().isBreakStarted)return this._lastPlayhead;var e=this.player.getPosition();return e&&e<0&&(e=Math.abs(e),this.monitor&&this.monitor.stop()),e}getPlayrate(){var e=1;return this.tag&&this.tag.playbackRate?e=this.tag.playbackRate:this.player.getPlaybackRate&&(e=this.player.getPlaybackRate()),e}getDuration(){return this.duration||this.player.getDuration()||null}getBitrate(){var e=-1,t=this.player.getVisualQuality();return"number"==typeof this.player.getCurrentQuality()&&this.player.getQualityLevels()&&-1!==this.player.getCurrentQuality()&&(t=this.player.getQualityLevels()[this.player.getCurrentQuality()])&&t.bitrate&&(e=t.bitrate),t=this.player.getVisualQuality(),e<=0&&t&&t.bitrate?e=t.bitrate:e<=0&&t&&t.level&&t.level.bitrate&&(e=t.level.bitrate),e}getRendition(){var e=null,t=this.player.getVisualQuality();return t&&null!==t&&t.level?e=this.getNpawUtils().buildRenditionString(t.level.width,t.level.height,t.level.bitrate||0):"number"==typeof this.player.getCurrentQuality()&&this.player.getQualityLevels()&&-1!==this.player.getCurrentQuality()&&((t=this.player.getQualityLevels()[this.player.getCurrentQuality()])&&"auto"===t.label?e=this.getNpawUtils().buildRenditionString(t.bandwidth):t&&t.label?e=t.label:-1===this.player.getCurrentQuality()&&(e="auto")),e}getTitle(){return this.title}getIsLive(){var e=!1;return"boolean"==typeof this.isLive?e=this.isLive:this.getDuration()<=0&&(e=!0),e}getResource(){return this.player.getPlaylistItem().file}getPlayerVersion(){return this.player.version}getPlayerName(){return"JWPlayer"}setOptions(e){e&&e.media&&(this.isLive=e.media.isLive||this.isLive,this.title=e.media.title||this.title),e&&(this.isLive=e["content.isLive"]||this.isLive,this.title=e["content.title"]||this.title),this.getVideo().mergeOptions(e)}registerListeners(){for(var e in this._lastPlayhead=0,this.monitorPlayhead(!0,!0),this.references={beforePlay:this.beforeplayListener.bind(this),buffer:this.bufferListener.bind(this),play:this.playListener.bind(this),pause:this.pauseListener.bind(this),error:this.errorListener.bind(this),seek:this.seekingListener.bind(this),seeked:this.seekedListener.bind(this),complete:this.endedListener.bind(this),meta:this.metaListener.bind(this),playlistItem:this.playlistItemListener.bind(this),setupError:this.setupErrorListener.bind(this),idle:this.idleListener.bind(this),firstFrame:this.firstFrameListener.bind(this),time:this.timeListener.bind(this),adsManager:this.managerListener.bind(this),remove:this.removeListener.bind(this),playbackRateChanged:this.playrateListener.bind(this)},this.references)this.player.on(e,this.references[e])}unregisterListeners(){if(this.monitor&&this.monitor.stop(),this.player&&this.references){for(var e in this.references)this.player.off(e,this.references[e]);delete this.references}}timeListener(e){if(this._lastPlayhead=this.getPlayhead(),this.fatalErrored)return null;0!==e.position&&this._start({},"timeListener");var t=e.position;(e.currentTime||e.position)&&((this.previousPosition&&this.previousPosition<t||this.getIsLive())&&this.fireJoin({},"timeListener"),this.previousPosition=t)}playlistItemListener(e){this.firePlayerLog("playlistItemListener",{});var t=this.player.getPlaylistItem();if(t&&t.file.indexOf("/VideoError.mp4")>-1)return null;this.duration=void 0,this.throughput=-1,this.setOptions(this.player.getConfig().youbora),this.setOptions(t.y
1oubora),this.fireStop({},"playlistItemListener")}setupErrorListener(e){this.firePlayerLog("setupErrorListener",{}),this.fireError(e.message,void 0,void 0,void 0,"setupErrorListener")}checkForClientSideAds(){var e=this.getVideo().getAdsAdapter(),t=!1;return e&&void 0!==e.isDAI&&(e.isDAI||(t=e.player.getCuePoints().includes(-1))),t}idleListener(e){this.firePlayerLog("idleListener",{}),e.reason&&"complete"!==e.reason||this.checkForClientSideAds()||this.fireStop({},"idleListener")}firstFrameListener(e){this.firePlayerLog("firstFrameListener",{}),this.tag=this.player.getConfig().mediaElement,this.fireJoin({},"firstFrameListener")}beforeplayListener(e){this.firePlayerLog("beforeplayListener",{}),this.duration=void 0,this.throughput=-1,this.player.getPlaylistItem().youbora||this.setOptions(this.player.getConfig().youbora),this.flags.isStarted||(this._start({},"beforeplayListener"),this.tag=this.player.getConfig().mediaElement,this.fatalErrored=!1,this.getVideo().getAdsAdapter()||this.getVideo().setAdsAdapter(this.getAdapterClass("genericAdsAdapter"),this.plugin))}managerListener(e){this.firePlayerLog("managerListener",{}),this.getVideo().getAdsAdapter()||(this.getVideo().setAdsAdapter(this.getAdapterClass("genericAdsAdapter"),this.plugin),this.getVideo().getAdsAdapter().managerListener(e))}bufferListener(e){this.firePlayerLog("bufferListener",{}),this.flags.isPaused||this.fireBufferBegin({},!1,"firstFrameListener")}playListener(e){this.firePlayerLog("playListener",{}),this.fireBufferEnd({},"playListener"),this.fireSeekEnd({},"playListener"),this.fireResume({},"playListener"),this.monitor.skipNextTick()}pauseListener(e){this.firePlayerLog("pauseListener",{}),this.flags.isSeeking&&this.fireSeekEnd({},"playListener"),this.firePause({},"pauseListener")}errorListener(e){this.firePlayerLog("errorListener",{}),e.message&&e.message.toLowerCase().includes("casting failed to load")||(e.code?this.fireError(e.code,e.message,void 0,void 0,"errorListener"):this.fireError(e.message,void 0,void 0,void 0,"errorListener"),(!e.message||e.message.toLowerCase().includes("network error")||e.message.toLowerCase().includes("could not be played")||e.message.toLowerCase().includes("cannot load")||e.message.toLowerCase().includes("cannot be played")||e.message.toLowerCase().includes("down")||e.message.toLowerCase().includes("fragloaderror")||e.message.toLowerCase().includes("levelloadtimeout")||e.message.toLowerCase().includes("file not found"))&&this.fireStop({},"errorListener"),e.code&&(e.code<3e5||e.code>309e3)&&(this.fireStop({},"errorListener"),this.fatalErrored=!0))}seekingListener(e){this.firePlayerLog("seekingListener",{}),this.fireSeekBegin({},!1,"seekingListener")}seekedListener(e){this.firePlayerLog("seekedListener",{}),"paused"!==this.player.getState()&&(this.fireSeekEnd({},"seekedListener"),this.monitor.skipNextTick())}endedListener(e){this.checkForClientSideAds()||(this.firePlayerLog("endedListener",{}),this.fireStop({},"endedListener"))}removeListener(e){this.firePlayerLog("removeListener",{}),this.getVideo().fireStop({},"removeListener")}playrateListener(e){this.monitor&&this.monitor.skipNextTick()}_start(e,t){!this.flags.isStarted&&this.player&&this.getVideo()&&(this._getDrm(),this.fireStart(e,t))}_getDrm(e){var t=this.player.getPlaylistItem(this.player.getPlaylistIndex());for(var i in t.allSources){var s=t.allSources[i];if(s.file===t.file&&s.drm&&"function"==typeof Object.keys){var r=Object.keys(s.drm);1===r.length&&this.getVideo().mergeOptions({"content.drm":r[0]});break}}}metaListener(e){this.duration=e.duration||this.duration,e.metadata&&(this.duration=e.metadata.duration||this.duration)}},Dashjs:class{checkExistsPlayer(){try{return this.checkExistsObjectOnPage(this.player.getVideoElement())}catch(e){return!0}}getVersion(){return"7.0.13-dashjs-jsclass"}getPlayhead(){var e=null;return this.player&&(e=this.isLive?this.player.timeAsUTC():this.player.time()),e}getDroppedFrames(){var e=0;return this.player&&(e=this.player.getDashMetrics().getCurrentDroppedFrames().droppedFrames),e}getDuration(){var e=null;return this.player&&(e=this.player.duration()),e}getBitrate(){var e=this._getRenditionInfo();return e?e.bitrate:null}getRendition(){var e=this._getRenditionInfo();return e?this.getNpawUtils().buildRenditionString(e.width,e.height,e.bitrate):null}_getRenditionInfo(){var e=null;if(this.player){var t=this.player.getQualityFor("video");t&&(e=this.player.getBitrateInfoListFor("video")[t])}return e}getThroughput(){if(this.getCdnTraffic()&&0!==this.getCdnTraffic()&&this.plugin&&this.plugin.getPingTime()){this.lastDataValue||(this.lastDataValue=0);var e=this.lastDataValue;return this.lastDataValue=this.getCdnTraffic()+this.getP2PTraffic(),Math.round((this.lastDataValue-e)/this.plugin.getPingTime())}if(!this.throughput&&this.player&&this.player.getMetricsFor){var t=this.player.getMetricsFor("video"),i=this.player.getDashMetrics().getHttpRequests(t);if(!i)return null;for(var s=0,r=0,a=0;a<i.length;a++){var n=i[a];if("MediaSegment"===n.type&&n.responsecode>=200&&n.responsecode<400&&"video"===n._stream){var h=n._responseHeaders.match(/Content-Length: (.+)/i);if(h){var l=(n.interval-(n.tresponse-n.trequest))/1e3;s+=h[1]/l*8,r++}}}if(!s)return null;this.throughput=s/r}if(!this.throughput&&this.player&&this.player.getAverageThroughput){var d=this.player.getAverageThroughput("video"),o=this.player.getAverageThroughput("audio");this.throughput=1e3*(d+o)}return this.throughput}getIsLive(){return this.isLive||(this.isLive=!1),this.isLive}getResource(){var e=null;if(this.player)try{var t=this.player.getSource();"string"==typeof t&&(e=t)}catch(e){}return e}getPlayrate(){return this.player?this.player.getPlaybackRate():1}getPlayerName(){return"dashJS"}getPlayerVersion(){var e=null;return this.player&&(e=this.player.getVersion()),e}getLatency(){var e=null;return this.getIsLive()&&this.player&&this.player.getCurrentLiveLatency&&(e=1e3*this.player.getCurrentLiveLatency()),e}registerListeners(){this.emptyVideoBuffer=!1,this.emptyAudioBuffer=!1,this.emptyTextBuffer=!1;var e=dashjs.MediaPlayer.events;if(this.references={},this.references[e.MANIFEST_LOADED]=this.manifestLoaded.bind(this),this.references[e.PLAYBACK_STARTED]=this.playbackStarted.bind(this),this.references[e.PLAYBACK_WAITING]=this.playbackWaiting.bind(this),this.references[e.PLAYBACK_STALLED]=this.playbackStalled.bind(this),this.references[e.PLAYBACK_PLAYING]=this.playbackPlaying.bind(this),this.references[e.PLAYBACK_SEEKED]=this.playbackPlaying.bind(this),this.references[e.PLAYBACK_PAUSED]=this.playbackPaused.bind(this),this.references[e.PLAYBACK_ENDED]=this.playbackEnded.bind(this),this.references[e.ERROR]=this.errorListener.bind(this),this.references[e.PLAYBACK_ERROR]=this.playbackError.bind(this),this.references[e.PLAYBACK_SEEKING]=this.playbackSeeking.bind(this),this.references[e.BUFFER_LOADED]=this.processBufferLoaded.bind(this),this.references[e.BUFFER_EMPTY]=this.processBufferEmpty.bind(this),this.player)for(var t in this.references)this.player.on(t,this.references[t])}unregisterListeners(){if(this.emptyVideoBuffer=!1,this.emptyAudioBuffer=!1,this.emptyTextBuffer=!1,this.player&&this.references){for(var e in this.references)this.player.off(e,this.references[e]);delete this.references}}processBufferEmpty(e){"video"===e.mediaType?this.emptyVideoBuffer=!0:"audio"===e.mediaType?this.emptyAudioBuffer=!0:"text"===e.mediaType&&(this.emptyTextBuffer=!0)}processBufferLoaded(e){"video"===e.mediaType?this.emptyVideoBuffer=!1:"audio"===e.mediaType?this.emptyAudioBuffer=!1:"text"===e.mediaType&&(this.emptyTextBuffer=!1)}manifestLoaded(e){this.firePlayerLog("manifestLoaded",{}),this.isLive=e.data&&"dynamic"===e.data.type}playbackStarted(e){this.firePlayerLog("playbackStarted",{}),this.fireStart({},"playbackStarted")}playbackPaused(e){this.firePlayerLog("playbackPaused",{}),this.firePause({},"playbackPaused")}playbackPlaying(e){this.firePlayerLog("playbackPlaying",{}),this.flags.isSeeking?this.fireSeekEnd({},"playbackPlaying"):this.flags.isPaused&&this.fireResume({},"playbackPlaying"),this.fireBufferEnd({},"playbackPlaying"),this.fireJoin({},"playbackPlaying")}playbackWaiting(e){var t=this.isLegacyBufferBehaviourEnabled();this.firePlayerLog("playbackWaiting",{}),t&&!this.emptyVideoBuffer||this.fireBufferBegin({},!1,"playbackWaiting")}playbackStalled(e){this.firePlayerLog("playbackStalled",{}),this.fireBufferBegin({},!1,"playbackStalled")}errorListener(e){this.firePlayerLog("errorListener",{}),e.error.code?this.fireError(e.error.code,e.error.message,void 0,void 0,"errorListener"):this.fireError(e.error,"Error",void 0,void 0,"errorListener")}playbackError(e){this.firePlayerLog("playbackError",{}),e.error.code?this.fireError(e.error.code,e.error.message,void 0,void 0,"playbackError"):this.fireError(e.error,"Playback error",void 0,void 0,"playbackError")}playbackSeeking(e){this.firePlayerLog("playbackSeeking",{}),this.isLive&&this.fireStart({},"playbackSeeking"),this.fireSeekBegin({},!1,"playbackSeeking")}playbackEnded(e){const t=this.getVideo().getAdsAdapter();let i=!1;t&&void 0!==t.isDAI&&(t.isDAI||(i=t.player.getCuePoints().includes(-1))),e.isLast&&!i&&(this.firePlayerLog("playbackEnded",{}),this.fireStop({},"playbackEnded"))}getCdnTraffic(){if(this.player.getMetricsFor){var e=this.player.getMetricsFor("p2pweb");if(!e)return this.getNpawReference().Adapter.prototype.getCdnTraffic();var t=e.metricsP2PWeb;return t.videoAvgLength*t.chunksFromCDN+t.audioAvgLength*t.chunksFromCDN}return null}getP2PTraffic(){if(this.player.getMetricsFor){var e=this.player.getMetricsFor("p2pweb");if(!e)return this.getNpawReference().Adapter.prototype.getP2PTraffic();var t=e.metricsP2PWeb;return t.videoAvgLength*t.chunksFromP2P+t.audioAvgLength*t.chunksFromP2P}return null}},Nagra:class{checkExistsPlayer(){try{return this.checkExistsObjectOnPage(this.player.el_)}catch(e){return!0}}pauseListener(e){this.firePlayerLog("pauseListener",{}),this.firePause({},"pauseListener")}stalledListener(e){this.firePlayerLog("stalledListener",{}),this.fireBufferBegin({},!1,"stalledListener")}bufferingListener(e){this.firePlayerLog("waitingListener",{}),this.fireBufferBegin({},!1,"waitingListener")}getIsLive(){return!!this.player.el_&&this.player.el_.duration===1/0}playListener(e){this.firePlayerLog("playListener",{}),this.player&&this.checkReadyState(this.player.readyState,"playListener"),this.fireStart({},"playListener")}registerListeners(){for(var e in this.monitorPlayhead(!1,!1),this.references={play:this.playListener.bind(this),timeupdate:this.timeupdateListener.bind(this),pause:this.pauseListener.bind(this),playing:this.playingListener.bind(this),error:this.errorListener.bind(this),seeking:this.seekingListener.bind(this),seeked:this.seekedListener.bind(this),ended:this.endedListener.bind(this),loadstart:this.loadStartListener.bind(this),stalled:this.stalledListener.bind(this),waiting:this.bufferingListener.bind(this),canplay:this.canPlayListener.bind(this),canplaythrough:this.canPlayThroughListener.bind(this),loadedmediadata:this.loadedMediaDataListener.bind(this),loadeddata:this.loadedDataListener.bind(this)},this.references)this.player.on(e,this.references[e])}endedListener(e){this.firePlayerLog("endedListener",{}),this.fireStop({},"endedListener")}getPlayrate(){return this.player.playbackRate()}canPlayListener(e){this.player&&this.checkReadyState(this.player.readyState,"canPlayListener")}canPlayThroughListener(e){this.player&&this.checkReadyState(this.player.readyState,"canPlayThroughListener")}timeupdateListener(e){(this.getPlayhead()>.1||this.getVideo()&&this.getVideo().getIsLive())&&!this.player.el_.error&&(this.fireStart({},"timeupdateListener"),this.fireJoin({},"timeupdateListener"))}getResource(){return this.player.currentSrc()}getPlayhead(){return this.player.currentTime()}getDuration(){return this.player.duration()}seekingListener(e){this.firePlayerLog("seekingListener",{}),this.fireSeekBegin({},!1,"seekingListener")}getPlayerName(){return"nagra"}playingListener(e){this.firePlayerLog("playingListener",{}),this.fireResume({},"playingListener"),this.fireSeekEnd({},"playingListener"),this.flags.isBuffering&&this.fireBufferEnd({},"playingListener")}errorListener(e){this.firePlayerLog("errorListener",{});var t=null,i=null;try{e&&e.target&&e.target.error&&(i=e.target.error.code,t=e.target.error.message)}catch(e){}this.fireError(i,t,void 0,void 0,"errorListener")}loadedMediaDataListener(e){this.player&&this.checkReadyState(this.player.readyState,"loadedMediaDataListener")}getVersion(){return"7.0.1-nagra-jsclass"}seekedListener(e){this.firePlayerLog("seekedListener",{}),this.fireSeekEnd({},"seekedListener")}loadStartListener(e){this.firePlayerLog("loadStartListener",{}),this.flags.isJoined&&this.fireStop({},"loadStartListener")}unregisterListeners(){if(this.monitor&&this.monitor.stop(),this.player&&this.references)for(var e in this.references)this.player.removeEventListener(e,this.references[e]),delete this.references[e]}loadedDataListener(e){this.player&&this.checkReadyState(this.player.readyState,"loadedDataListener")}getPlayerVersion(){var e="Nagra";return window.OTV.versions.product&&(e+=window.OTV.versions.product),e}getThroughput(){return this.player&&this.player.otvtoolkit().networkStatistics.getNetworkUsage().downloadBitrate?this.player.otvtoolkit().networkStatistics.getNetworkUsage().downloadBitrate:null}getBitrate(){return this.player&&this.player.otvtoolkit().playbackStatistics.get
1StreamBitrate()?this.player.otvtoolkit().playbackStatistics.getStreamBitrate():null}getDroppedFrames(){let e=0;return this.player.otvtoolkit().renderingStatistics.getFrameDrops()&&(e=this.player.otvtoolkit().renderingStatistics.getFrameDrops()),e}getFramesPerSecond(){let e=null;return this.player.otvtoolkit().renderingStatistics.getFramesPerSecondNominal()&&(e=this.player.otvtoolkit().renderingStatistics.getFramesPerSecondNominal()),e}getRendition(){let e,t,i,s=this.player.tech_.shaka_.getVariantTracks();if(null!==s)for(const r of s)!0===r.active&&(e=r.width,t=r.height,i=r.bandwidth);return this.getNpawUtils().buildRenditionString(e,t,i)}},Brightcove:class{adsAdapters={bcoveAdsAdapter:m,bcoveImaAdsAdapter:P,genericAdsAdapter:L};additionalContexts={contribHlsTech:c,dashTech:f,dashShakaTech:y,hlsJsTech:u,shakaTech:p};isInAds(){try{return this.player.ads&&this.player.ads.inAdBreak&&"function"==typeof this.player.ads.inAdBreak&&this.player.ads.inAdBreak()}catch(e){return!1}}getBitrate(){var e=null,t=this.getUsedTech();return t&&t.getBitrate&&(e=t.getBitrate(this)),e}checkExistsPlayer(){try{return this.checkExistsObjectOnPage(this.player.el())}catch(e){return!0}}pauseListener(e){this.firePlayerLog("pauseListener",{}),this.firePause({},"pauseListener")}bufferingListener(e){this.firePlayerLog("bufferingListener",{}),this.flags.isSeeking||this.fireBufferBegin({},!1,"bufferingListener")}getRendition(){var e=null,t=this.getUsedTech();return t&&t.getRendition&&(e=t.getRendition(this)),e}getPlayerVersion(){var e=null;return"undefined"!=typeof videojs&&(e=videojs.VERSION),e}playListener(e){this.firePlayerLog("playListener",{}),this.isInAds()||(this.flags.isStarted?this.lastSrc&&this.lastSrc!==this.getResource()&&(this.fireStop({},"playListenerNewResource"),this.acumBytesFunc(),this.lastPlayhead=void 0,this._startEvent("playListenerNewResource"),this.lastSrc=this.getResource()):(this.lastSrc=this.getResource(),this._startEvent("playListenerNotStarted")))}loadAdsAdapter(){var e;if(null===this.plugin.getAdsAdapter())if(this.getAdapterClass("bcoveImaAdsAdapter").isUsed()){if(e=this.getAdapterClass("bcoveImaAdsAdapter")){this.plugin.setAdsAdapter(e,this.getVideo().getVideoKey());const t=Object.keys(this.getAdapterClasses()).filter(e=>e.toLowerCase().includes("ads"));for(const e of t)this.getAdapterClass(e).unregisterListeners();this.getVideo().getAdsAdapter().registerListeners()}}else this.loadVideoJSAdsAdapter()}loadVideoJSAdsAdapter(){if(this.getVideo())if(!this.getVideo().getAdsAdapter()||this.getVideo().getAdsAdapter().isGeneric){var e=null;if(this.getAdapterClass("bcoveAdsAdapter").isUsed()?e=this.getAdapterClass("bcoveAdsAdapter"):null===this.getVideo().getAdsAdapter()&&(e=this.getAdapterClass("genericAdsAdapter")).initProperties(),e){this.plugin.setAdsAdapter(e,this.getVideo().getVideoKey());const t=Object.keys(this.getAdapterClasses()).filter(e=>e.toLowerCase().includes("ads"));for(const e of t)this.getAdapterClass(e).unregisterListeners();this.getVideo().getAdsAdapter().registerListeners()}}else this.getVideo().getAdsAdapter().registerImaEvents&&this.getVideo().getAdsAdapter().registerImaEvents()}errorModifyer(e,t,i){this.fatalList=e||[],this.nonFatalList=t||[],this.ignoreList=i||[]}getPlayrate(){return this.player.playbackRate()}timeupdateListener(e){this.isInAds()||(this.getPlayhead()>.1&&(this.fireJoin({},"timeupdateListener"),this.joinPolling&&this.joinPolling.stop(),!this.flags.isPaused&&this.lastSeekPlayhead&&this.lastSeekPlayhead!==this.getPlayhead()&&(this.fireSeekEnd({},"timeupdateListener"),this.lastSeekPlayhead=!1)),this.flags.isJoined||(void 0===this.lastPlayhead&&(this.lastPlayhead=this.getPlayhead()),this.lastPlayhead!==this.getPlayhead()&&(this.player.options_&&this.plugin&&!this.getVideo().options["content.id"]&&(this.getVideo().options["content.id"]=this.player.options_["data-video-id"]),this.fireStart({},"timeupdateListener"),this.fireJoin({},"timeupdateListener"),this.joinPolling&&this.joinPolling.stop(),this.lastPlayhead=void 0)),this.getVideo()._adsAdapter&&!this.getVideo()._adsAdapter.flags.isStarted&&(this.lastPlayhead=this.getPlayhead()))}getPlayhead(){return this.player.currentTime()}getDuration(){return this.player.mediainfo&&void 0!==this.player.mediainfo.duration?this.player.mediainfo.duration:this.getVideoJSDuration()}getVideoJSDuration(){var e=this.player.duration();return this.player.mediainfo&&void 0!==this.player.mediainfo.duration&&(e=this.player.mediainfo.duration),e}aderrorListener(e){this.loadAdsAdapter(),this.getVideo().getAdsAdapter()&&this.getVideo().getAdsAdapter().adPlayerErrorListener&&this.getVideo().getAdsAdapter().adPlayerErrorListener(e)}_jointimePolling(e){this.getVideo()?this.getVideo().getAdsAdapter()&&this.getVideo().getAdsAdapter().flags.isStarted||(0!==this.lastPlayhead&&"number"==typeof this.lastPlayhead&&this.lastPlayhead!==this.getPlayhead()&&(this.fireJoin({},"jointimePolling"),this.joinPolling&&this.joinPolling.stop()),this.lastPlayhead=this.getPlayhead()):this.joinPolling&&this.joinPolling.stop()}acumBytesFunc(){this.acumBytes+=this.getTotalBytes()||0}adsEndedListener(e){this.firePlayerLog("adsEndedListener",{}),this.adsEnded=!0,this.getVideo().requestBuilder.lastSent.adPosition===this.getNpawReference().Constants.AdPosition.Postroll&&(this.getVideo().fireStop({},"adsEndedListener"),this.acumBytesFunc(),this.lastPlayhead=void 0)}getVersion(){return"7.0.4-brightcove-videojs-jsclass"}seekedListener(e){this.firePlayerLog("seekedListener",{}),this.lastSeekPlayhead=this.getPlayhead()}getTech(){return this.player.tech({IWillNotUseThisInPlugins:!0})}unregisterListeners(){if(this.monitor&&this.monitor.stop(),this.player&&this.references){try{for(var e in this.references)this.player.off(e,this.references[e])}catch(e){}delete this.references}}_startEvent(e){this.loadAdsAdapter(),this.player.options_&&this.plugin&&!this.plugin.options["content.id"]&&(this.plugin.options["content.id"]=this.player.options_["data-vi
1deo-id"]),this.fireStart({},e),this.flags.isJoined||(this.joinPolling||(this.joinPolling=new(this.getNpawReference().Timer)(this._jointimePolling.bind(this),500)),this.joinPolling.start())}getIsLive(){var e=null;if(this.player.mediainfo&&(e=!0,"number"==typeof this.player.mediainfo.duration&&(e=this.player.mediainfo.duration<1||this.player.mediainfo.duration===1/0)),this.player.duration&&"function"==typeof this.player.duration){e=!0;var t=this.player.duration();"number"==typeof t&&(e=t<1||t===1/0)}return this.player.isLive&&"function"===this.player.isLive&&(e=this.player.isLive()),e}conditionalStop(e){this.firePlayerLog("conditionalStop",{}),this.isInAds()||this.plugin&&(this.adsEnded=!1,this.fireStop({},"conditionalStop"),this.plugin&&!this.getVideo().options["content.id"]&&(this.getVideo().options["content.id"]=null),this.acumBytesFunc(),this.lastPlayhead=void 0)}getTitle(){return this.player.mediainfo?this.player.mediainfo.name:this.getVideoJSTitle()}getVideoJSTitle(){var e=null;return this.player.mediainfo&&(e=this.player.mediainfo.name),e}getTotalBytes(){var e=null,t=this.getUsedTech();return t&&t.getTotalBytes&&(e=t.getTotalBytes(this)),e}registerListeners(){if(this.monitorPlayhead(!1,!1,1200),this.acumBytes=0,this.ignoreList=[],this.fatalList=[],this.nonFatalList=[],this.references={loadstart:this.loadstartListener.bind(this),adsready:this.loadAdsAdapter.bind(this),play:this.playListener.bind(this),timeupdate:this.timeupdateListener.bind(this),pause:this.pauseListener.bind(this),playing:this.playingListener.bind(this),ended:this.conditionalStop.bind(this),dispose:this.disposeListener.bind(this),seeking:this.seekingListener.bind(this),seeked:this.seekedListener.bind(this),error:this.errorListener.bind(this),adserror:this.aderrorListener.bind(this),adsEnded:this.adsEndedListener.bind(this),texttrackchange:this.textListener.bind(this),waiting:this.bufferingListener.bind(this)},this.player)for(var e in this.references)this.player.on(e,this.references[e]);setTimeout(this.loadAdsAdapter.bind(this),50)}getResource(){var e=null,t=this.getUsedTech();return t&&t.getResource&&(e=t.getResource(this)),e||(e=this.player.currentSrc()),e}textListener(e){if(this.player.textTracks)for(var t=this.player.textTracks(),i=t.length,s=0;s<i;++s)t[s]&&"showing"===t[s].mode&&(this.getVideo().options["content.subtitles"]=t[s].label||t[s].language)}seekingListener(e){this.firePlayerLog("seekingListener",{}),this.fireSeekBegin({},!1,"seekingListener")}disposeListener(e){this.firePlayerLog("disposeListener",{}),this.plugin&&(this.getVideo().fireStop({},"disposeListener"),this.getVideo().removeAdsAdapter(),this.getVideo().removeAdapter())}loadstartListener(e){this.firePlayerLog("loadstartListener",{}),this.loadAdsAdapter()}getPlayerName(){var e=this.getVideoJSPlayerName();return this.player&&this.player.mediainfo&&(e+="-bcove"),e}getVideoJSPlayerName(){var e="videojs";return this.getAdapterClass("contribHlsTech").isUsed(this)?e+="-hls":this.getAdapterClass("hlsJsTech").isUsed(this)?e+="-hlsjs":this.getAdapterClass("shakaTech").isUsed(this)?e+="-shaka":this.getAdapterClass("dashShakaTech").isUsed(this)?e+="-dash-shaka":this.getAdapterClass("dashTech").isUsed(this)&&(e+="-dash"),this.player.FreeWheelPlugin&&(e+="-fw"),this.player.mediainfo&&(e+="-bcove"),e}playingListener(e){this.firePlayerLog("playingListener",{}),this._startEvent("playingListener"),this.fireResume({},"playingListener"),this.getPlayhead()<1&&this.fireSeekEnd({},"playingListener"),this.fireBufferEnd({},"playingListener")}getUsedTech(){var e=null;if(this.getPlugin().getAdaptersProperties().usedTech){switch(this.getPlugin().getAdaptersProperties().usedTech.toLowerCase()){case"hls":this.getAdapterClass("contribHlsTech").isUsed(this)&&(e=this.getAdapterClass("contribHlsTech"));break;case"hlsjs":this.getAdapterClass("hlsJsTech").isUsed(this)&&(e=this.getAdapterClass("hlsJsTech"));break;case"shaka":this.getAdapterClass("shakaTech").isUsed(this)&&(e=this.getAdapterClass("shakaTech"));break;case"dashshaka":this.getAdapterClass("dashShakaTech").isUsed(this)&&(e=this.getAdapterClass("dashShakaTech"));break;case"dash":this.getAdapterClass("dashTech").isUsed(this)&&(e=this.getAdapterClass("dashTech"))}if(null!=e)return e}return this.getAdapterClass("contribHlsTech").isUsed(this)?e=this.getAdapterClass("contribHlsTech"):this.getAdapterClass("hlsJsTech").isUsed(this)?e=this.getAdapterClass("hlsJsTech"):this.getAdapterClass("shakaTech").isUsed(this)?e=this.getAdapterClass("shakaTech"):this.getAdapterClass("dashShakaTech").isUsed(this)?e=this.getAdapterClass("dashShakaTech"):this.getAdapterClass("dashTech").isUsed(this)&&(e=this.getAdapterClass("dashTech")),e}errorListener(e){this.firePlayerLog("errorListener",{}),this.fireError(null,null,void 0,void 0,"errorListener")}},Theoplayer:class{adsAdapters={nativeAdsAdapter:v};checkExistsPlayer(){try{if(this.player.element)return this.checkExistsObjectOnPage(this.player.element)}catch(e){return!0}}getBitrate(){var e=-1,t=this.getActiveQuality();return t&&t.bandwidth&&(e=t.bandwidth),e}pauseListener(e){this.firePlayerLog("pauseListener",{}),this.flags.isSeeking||this.firePause({},"pauseListener")}offlineListener(e){this.firePlayerLog("offlineListener",{}),this.fireError("OFFLINE_SOURCE","OFFLINE_SOURCE",void 0,void 0,"offlineListener")}getRendition(){this._setLanguage();var e=null,t=this.getActiveQuality();
1return t?e=t.name&&isNaN(t.name)?t.name:this.getNpawUtils().buildRenditionString(t.width,t.height,t.bandwidth):this.player.videoHeight&&this.player.videoWidth&&(e=this.getNpawUtils().buildRenditionString(this.player.videoWidth,this.player.videoHeight,0)),e}getLatency(){var e=null;return this.getIsLive()&&null!==this.player.currentProgramDateTime&&(e=(new Date).getTime()-this.player.currentProgramDateTime),e}getPlayerVersion(){var e="THEOplayer";return"undefined"!=typeof THEOplayer?e+=THEOplayer.version:"undefined"!=typeof theoplayer&&(e+=theoplayer.version),e}playListener(e){this.firePlayerLog("playListener",{}),this.player.autoplay||this.fireInit({},"playListener")}endedListener(e){this.firePlayerLog("endedListener",{}),this.flags.isStarted&&(this.fireStop({},"endedListener"),this.ended=!0)}getPlayrate(){try{return this.player.playbackRate}catch(e){}return 0}getActiveQuality(){for(var e=this.player.videoTracks,t=0;t<e.length;t++){var i=e.item(t);if(i.enabled)return i.activeQuality}return{}}playrateListener(e){this.monitor&&this.monitor.skipNextTick()}getPlayhead(){var e=null;try{this.player.ads&&this.player.ads.playing||this.flags.isSeeking&&this.flags.isPaused?e=this.lastPlayhead:(this.lastPlayhead=this.player.currentTime,e=this.player.currentTime)}catch(e){}return e}getDuration(){var e=null;return this.player.ads&&this.player.ads.playing?e=this.lastDuration||e:(this.lastDuration=this.player.duration,e=this.lastDuration),e}getThroughput(){return this.player&&this.player.metrics&&this.player.metrics.currentBandwidthEstimate?this.player.metrics.currentBandwidthEstimate:null}getDroppedFrames(){return this.player.metrics?this.player.metrics.droppedVideoFrames:null}getVersion(){return"7.0.14-theoplayer2-jsclass"}unregisterListeners(){if(this.getVideo()&&this.getVideo().removeAdsAdapter(),this.monitor&&this.monitor.stop(),this.player&&this.references){for(var e in this.references)this.player.removeEventListener(e,this.references[e]);delete this.references}if(this.player&&this.player.network&&this.networkReferences){for(var t in this.player.network.removeRequestInterceptor(this.requestInterceptor),this.player.network.removeResponseInterceptor(this.responseInterceptor),this.networkReferences)this.player.network.removeEventListener(t,this.networkReferences[t]);delete this.networkReferences,delete this.requestInterceptor,delete this.responseInterceptor}}stateChangeListener(e){1===e.readyState&&this.player.src!==this.previousSrc&&void 0!==this.player.src&&(this.fireInit({},"stateChangeListener"),this.previousSrc=this.player.src),0===e.currentTime&&0===e.readyState&&this.player.src!==this.previousSrc&&void 0!==this.player.src&&(this.fireStop(),this.previousSrc=this.player.src)}_segmentUrl(){var e=null;return this.getVideo()&&this.getVideo().options&&!this.getVideo().options["parse.manifest"]&&this.parsedUrl&&(e={parsedResource:this.parsedUrl}),e}getIsLive(){return isNaN(this.player.duration)?null:this.player.duration===1/0}_setLanguage(){if(this.getVideo()){var e=this.player.audioTracks;for(var t in e){var i=e[t];i.activeQuality&&(this.getVideo().options["content.language"]="und"===i.language?i.name||i.label:i.language)}}}registerListeners(){for(var e in this.getNpawUtils().logAllEvents(this.player),this.monitorPlayhead(!1,!0),this.references={play:this.playListener.bind(this),playing:this.playingListener.bind(this),pause:this.pauseListener.bind(this),seeking:this.seekingListener.bind(this),ended:this.endedListener.bind(this),error:this.errorListener.bind(this),readystatechange:this.stateChangeListener.bind(this),sourcechange:this.endedListener.bind(this),timeupdate:this.timeUpdateListener.bind(this),ratechange:this.playrateListener.bind(this),waiting:this.waitingListener.bind(this)},this.networkReferences={offline:this.offlineListener.bind(this)},this.references)this.player.addEventListener(e,this.references[e]);if(this.player.network)for(var t in this.networkReferences)this.player.network.addEventListener(t,this.networkReferences[t]);!this.getVideo().getAdsAdapter()&&this.player.ads&&(this.getAdapterClass("nativeAdsAdapter")._updatePlayer(this.player),this.plugin.setAdsAdapter(this.getAdapterClass("nativeAdsAdapter"),this.getVideo().getVideoKey()))}getResource(){return this.player.src&&!this.previousSrc&&(this.previousSrc=this.player.src),this.player.src||null}getURLToParse(){return this.parsedUrl}seekingListener(e){this.firePlayerLog("seekingListener",{}),this.fireSeekBegin({},!1,"seekingListener")}timeUpdateListener(e){this.player.ads&&this.player.ads.playing||(this.flags.isStarted||!e.currentTime||this.ended||(this.getIsLive()||e.currentTime+1<this.getDuration())&&(this.fireStart(this._segmentUrl(),"timeUpdateListener"),this.fireJoin(this._segmentUrl(),"timeUpdateListener")),this.flags.isPaused||(this.fireSeekEnd({},"timeUpdateListener"),this.fireBufferEnd({},"timeUpdateListener")))}getPlayerName(){return"THEOplayer"}playingListener(e){this.firePlayerLog("playingListener",{}),this.getVideo().getAdsAdapter()&&this.getVideo().getAdsAdapter().flags.isStarted||(this.flags.isSeeking&&!this.flags.isPaused&&this.fireSeekEnd({},"playingListener"),this.flags.isBuffering&&!this.flags.isPaused&&this.fireBufferEnd({},"playingListener"),this.fireResume({},"playingListener"),this.player.ads&&this.player.ads.playing||(this.ended=!1,this.fireStart(this._segmentUrl(),"playingListener")),this.fireJoin({},"playingListener"))}waitingListener(e){this.firePlayerLog("waitingListener",{}),this.flags.isPaused||this.flags.isSeeking||this.fireBufferBegin({},!1,"waitingListener")}errorListener(e){var t,i,s,r,a,n,h,l,d;this.firePlayerLog("errorListener",{}),e.errorObject?(t=e.errorObject.code,r=e.errorObject.message,h=!!e.errorObject.cause&&e.errorObject.cause.message):r=e.error,this.player&&this.player.errorObject&&(i=this.player.errorObject.code,a=this.player.errorObject.message,l=!!this.player.errorObject.cause&&this.player.errorObject.cause.message),this.player&&this.player.error&&(s=this.player.error.code,n=this.player.error.message,d=this.player.error.cause);var o=[];r&&o.push("event: "+r),a&&o.push("player.errorObject: "+a),n&&o.push("player.error: "+n);var g=[];h&&g.push("event: "+h),l&&g.push("player.errorObject: "+l),d&&g.push("player.error: "+d);var p=[];t&&p.push("event: "+t),i&&p.push("player.errorObject: "+i),s&&p.push("player.error: "+s);var u=t||i||s||"GENERIC_ERROR",y="[MESSAGES] "+o.join(" - ")+" - [CAUSES] "+g.join(" - ")+" - [CODES] "+p.join(" - ");this.fireFatalError(u,y,void 0,void 0,"errorListener")}},NagraReactNative:class{getVersion(){return"7.0.1-nagra-react-native-jsclass"}getPlayhead(){return this.playhead}getIsLive(){return!this.duration}getDuration(){return this.duration}getResource(){return this.resource}setPlatform(e){this.reactPlatform=e}getRendition(){return this.width&&this.height?this.getNpawUtils().buildRenditionString(this.width,this.height):null}getPlayerName(){return"Nagra React Native"}unregisterListeners(){this.monitor&&this.monitor.stop()}onLoad(e){var t=e.naturalSize;t&&(this.width=Math.round(t.width),this.height=Math.round(t.height)),this.duration=e.duration,this.fireStart()}onLoadStart(e){this.resource=e.src,this.fireStart(),this.flags.isJoined||(this.isWaiting=!1,this.fireJoin()),this.fireBufferEnd({},"onLoadStart"),this.fireResume(),this.pausePlayhead=null}onPlaying(e){this.fireStart(),this.flags.isJoined||(this.isWaiting=!1,this.fireJoin()),this.pausePlayhead&&Math.abs(this.getPlayhead()-this.pausePlayhead)>.5&&!this.flags.isPaused&&(this.fireSeekEnd({},"onPlaying"),this.pausePlayhead=null),this.reactPlatform&&"ios"==this.reactPlatform&&!this.pausePlayhead&&(this.fireSeekEnd({},"onPlaying"),this.pausePlayhead=null),this.fireBufferEnd({},"onPlaying"),this.fireResume()}onProgress(e){this.playhead=e.currentTime,this.fireStart(),this.playhead>.5&&!this.flags.isJoined&&this.fireJoin(),this.pausePlayhead&&!this.flags.isPaused&&(Math.abs(this.getPlayhead()-this.pausePlayhead)>2?this.fireSeekEnd({},"onProgress"):this.isWaiting?(this.fireBufferBegin({},!0,"onProgress"),this.fireBufferEnd({},"onProgress")):(this.cancelSeek(),this.chronos.pause.pauseTime=null),this.isWaiting=!1,this.pausePlayhead=null)}onSeek(e){this.reactPlatform&&"ios"==this.reactPlatform&&this.fireSeekBegin({},!1,"onSeek")}onWaiting(e){this.isWaiting=!0,this.fireBufferBegin({},!1,"onWaiting")}
1onPaused(e){this.reactPlatform&&"android"==this.reactPlatform&&(this.pausePlayhead=this.getPlayhead(),this.fireSeekBegin({},!0,"onPaused")),this.firePause(),this.reactPlatform&&"android"==this.reactPlatform&&(this.chronos.pause.startTime=(new Date).getTime())}onError(e){this.fireError(e.code,e.nativeError)}onStopped(e){this.fireStop()}onEnd(e){this.fireStop()}},Chromecast:class{getPlayhead(){return this.player.getEstimatedTime||this.player.currentTime}getVersion(){return"7.0.2-chromecast-jsclass"}getDuration(){return this.player.duration}getBitrate(){if(this.castPlayer&&this.castPlayer.getStreamingProtocol){const e=this.castPlayer.getStreamingProtocol();let t=0;try{e.getStreamCount&&e.getStreamCount()>0&&(t=e.getStreamCount())}catch(e){}for(let t=0;t<e.getStreamCount();t++){const i=e.getStreamInfo(t);if(0===i.mimeType.indexOf("video/")){const s=e.getQualityLevel(t);if(i.bitrates&&i.bitrates[s])return i.bitrates[s]}}}}getRendition(){let e;if(this.player&&this.player.videoHeight&&this.player.videoWidth){let t=this.getVideo().getBitrate();t<=0&&(t=this.plugin.requestBuilder.lastSent.bitrate||-1),e=this.getNpawUtils().buildRenditionString(this.player.videoWidth,this.player.videoHeight,t)}return e}getResource(){let e;return this.player.currentSrc.startsWith("blob:")?this.castPlayer&&(e=this.castPlayer.getHost().url):e=this.player.currentSrc,e}getPlayrate(){return this.player.playbackRate}getDroppedFrames(){return this.player.webkitDroppedFrameCount}getPlayerVersion(){let e;return"undefined"!=typeof cast&&cast.player&&cast.player.api&&(e=cast.player.api.VERSION),e}getPlayerName(){return"Chromecast"}registerListeners(){this.getNpawUtils().logAllEvents(this.player),this.monitorPlayhead(!0,!1,1200),this.references={loadstart:this.playListener.bind(this),pause:this.pauseListener.bind(this),playing:this.playingListener.bind(this),error:this.errorListener.bind(this),seeking:this.seekingListener.bind(this),abort:this.endedListener.bind(this),ended:this.endedListener.bind(this),buffering:this.bufferingListener.bind(this)},this.hostReferences={onAutoPause:this.autoPauseListener.bind(this)};for(let e in this.references)this.player.addEventListener(e,this.references[e]);if(this.castPlayer&&this.castPlayer.getHost&&this.castPlayer.getHost()){let e=this.castPlayer.getHost();for(let t in this.hostReferences)e[t]=this.hostReferences[t]}this.registerModelVersion()}unregisterListeners(){if(this.monitor&&this.monitor.stop(),this.player&&this.references){if("function"==typeof this.player.removeEventListener)for(let e in this.references)this.player.removeEventListener(e,this.references[e]);delete this.references}if(this.castPlayer&&this.castPlayer.getHost&&this.castPlayer.getHost()){const e=this.castPlayer.getHost();for(let t in this.hostReferences)e[t]=void 0;delete this.hostReferences}}registerModelVersion(){if(void 0===this.getVideo().options["device.model"]){try{const{hardwareConcurrency:e,userAgent:t}=window.navigator,i=cast.receiver.CastReceiverManager.getInstance();if(i.canDisplayType('video/mp4; codecs="avc1.640033'))return void(this.getVideo().options["device.model"]="Chromecast with Google TV");if(t.includes("Android"))return void(this.getVideo().options["device.model"]="Chromecast Android");if(i.canDisplayType("video/mp4; codecs=hev1.1.6.L93.B0"))return void(this.getVideo().options["device.model"]="Chromecast Ultra");if(i.canDisplayType("video/mp4; codecs=avc1.64002A"))return void(this.getVideo().options["device.model"]="Chromecast 3");if(2===e)return void(this.getVideo().options["device.model"]="Chromecast 2");if(1===e)return void(this.getVideo().options["device.model"]="Chromecast 1")}catch(e){}this.getVideo().options["device.model"]="Chromecast"}}playListener(e){this.flags.isStarted&&this.fireStop({},"playListener"),this.fireStart({},"playListener")}pauseListener(e){this.flags.isBuffering||this.firePause({},"pauseListener")}playingListener(e){this.fireResume({},"playingListener"),this.fireSeekEnd({},"playingListener"),this.fireBufferEnd({},"playingListener"),this.fireJoin({},"playingListener")}errorListener(e){this.fireError(e)}endedListener(e){this.fireStop({},"endedListener")}seekingListener(e){this.fireSeekBegin({},!1,"seekingListener")}bufferingListener(e){this.flags.isPaused&&this.fireResume({},"bufferingListener"),this.fireBufferBegin({},!1,"bufferingListener")}autoPauseListener(e){e?(this.fireResume({},"autoPauseListener"),this.fireBufferBegin({},!1,"autoPauseListener")):this.fireBufferEnd({},"autoPauseListener")}},ChromecastCaf:class{adsAdapters={nativeAdsAdapter:A};getVersion(){return"7.0.3-chromecast-caf-jsclass"}getPlayhead(){return this.player.getCurrentTimeSec()}getPlayrate(){let e=this.player.getPlaybackRate();return e||this.flags.isPaused||(e=1),e}getDroppedFrames(){return this.castMediaElement?this.castMediaElement.webkitDroppedFrameCount:void 0}getDuration(){return this.player.getDurationSec()}getBitrate(){return this.bitrate||0}getThroughput(){let e=this.throughput||-1;if(!this.throughput&&this.castMediaElement&&this.castMediaElement.webkitVideoDecodedByteCount&&this.castMediaElement.webkitAudioDecodedByteCount){const t=this.castMediaElement.webkitVideoDecodedByteCount,i=this.castMediaElement.webkitAudioDecodedByteCount,s=this.actualCount||0;this.actualCount=t&&i>t?t:i+t;const r=JSON.parse(this.plugin.getStoredData()).q.pt||5;e=Math.round((this.actualCount-s)/(r/1e3))}return e}getRendition(){const e=this.castMediaElement?this.castMediaElement.videoWidth:void 0,t=this.castMediaElement?this.castMediaElement.videoHeight:void 0;return this.getNpawUtils().buildRenditionString(e,t,this.getBitrate())}getTitle(){return this.player.getMediaInformation().metadata.title}getIsLive(){return-1===this.getDuration()}getResource(){let e;return this.player.getMediaInformation()&&(e=this.player.getMediaInformation().contentUrl||this.player.getMediaInformation().contentId),e}getPlayerVersion(){return cast&&cast.framework?cast.framework.VERSION:void 0}getPlayerName(){return"Chromecast"}registerListeners(){this.castMediaElement=void 0;for(let e in this.player)if("object"==typeof this.player[e])for(let t in this.player[e])this.player[e][t]&&"castMediaElement"===this.player[e][t].id&&(this.castMediaElement=this.player[e][t]);const e=cast.framework.events,t=cast.framework.events.DetailedErrorCode;for(var i in this.errorFilter=[t.MEDIAKEYS_UNKNOWN,t.MEDIAKEYS_UNSUPPORTED,t.MEDIAKEYS_WEBCRYPTO,t.SEGMENT_NETWORK,t.HLS_NETWORK_INVALID_SEGMENT,t.DASH_MANIFEST_NO_MIMETYPE,t.DASH_INVALID_SEGMENT_INFO,t.TEXT_UNKNOWN,t.SEGMENT_UNKNOWN,t.BREAK_SEEK_INTERCEPTOR_ERROR,t.APP,t.IMAGE_ERROR,t.LOAD_INTERRUPTED,t.MEDIA_ERROR_MESSAGE],this.getNpawUtils().logAllEvents(this.player,[null,e.EventType.PLAY,e.EventType.PAUSE,e.EventType.PLAYING,e.EventType.STALLED,e.EventType.SEEKING,e.EventType.SEEKED,e.EventType.ER
1ROR,e.EventType.CLIP_ENDED,e.EventType.BITRATE_CHANGED,e.EventType.SEGMENT_DOWNLOADED,e.EventType.BUFFERING,e.EventType.EMSG,e.EventType.ID3,e.EventType.MEDIA_FINISHED,e.EventType.MEDIA_STATUS,e.EventType.CACHE_HIT,e.EventType.BREAK_CLIP_STARTED,e.EventType.BREAK_ENDED,e.EventType.BREAK_CLIP_LOADING,e.EventType.BREAK_CLIP_STARTED,e.EventType.BREAK_CLIP_ENDED,e.EventType.BREAK_STARTED]),this.monitorPlayhead(!0,!0),this.references={},this.references[e.EventType.PLAY]=this.playListener.bind(this),this.references[e.EventType.STALLED]=this.playListener.bind(this),this.references[e.EventType.BUFFERING]=this.bufferingListener.bind(this),this.references[e.EventType.PAUSE]=this.pauseListener.bind(this),this.references[e.EventType.BREAK_CLIP_STARTED]=this.pauseListener.bind(this),this.references[e.EventType.BREAK_ENDED]=this.resumeListener.bind(this),this.references[e.EventType.PLAYING]=this.playingListener.bind(this),this.references[e.EventType.SEEKING]=this.seekingListener.bind(this),this.references[e.EventType.MEDIA_FINISHED]=this.endedListener.bind(this),this.references[e.EventType.ERROR]=this.errorListener.bind(this),this.references[e.EventType.BITRATE_CHANGED]=this.bitrateChangedListener.bind(this),this.references[e.EventType.SEGMENT_DOWNLOADED]=this.segmentListener.bind(this),this.references[e.EventType.BREAK_STARTED]=this.playAdListener.bind(this),this.references[e.EventType.TIME_UPDATE]=this.timeUpdateListener.bind(this),this.hostReferences={onAutoPause:this.autoPauseListener.bind(this)},this.references)this.player.addEventListener(i,this.references[i]);if(cast&&cast.player&&cast.player.api&&cast.player.api.Player&&cast.player.api.Player.getHost&&cast.player.api.Player.getHost())for(var s in this.hostReferences)cast.player.api.Player.getHost().addEventListener(s,this.hostReferences[s]);this.getVideo().getAdsAdapter()||(this.getAdapterClass("nativeAdsAdapter")._updatePlayer(this.player),this.plugin.setAdsAdapter(this.getAdapterClass("nativeAdsAdapter"),this.getVideo().getVideoKey())),this.registerModelVersion()}unregisterListeners(){if(this.monitor&&this.monitor.stop(),this.player&&this.references){for(var e in this.references)this.player.removeEventListener(e,this.references[e]);if(this.references={},cast&&cast.player&&cast.player.api&&cast.player.api.Player&&cast.player.api.Player.getHost&&cast.player.api.Player.getHost()&&this.hostReferences){for(var t in this.hostReferences)this.player.getHost().removeEventListener(t,this.hostReferences[t]);this.hostReferences={}}}}registerModelVersion(){if(void 0===this.getVideo().options["device.model"]){try{const{hardwareConcurrency:e,userAgent:t}=window.navigator,i=cast.framework.CastReceiverContext.getInstance();if(i.canDisplayType('video/mp4; codecs="avc1.640033'))return void(this.getVideo().options["device.model"]="Chromecast with Google TV");if(t.includes("Android"))return void(this.getVideo().options["device.model"]="Chromecast Android");if(i.canDisplayType("video/mp4; codecs=hev1.1.6.L93.B0"))return void(this.getVideo().options["device.model"]="Chromecast Ultra");if(i.canDisplayType("video/mp4; codecs=avc1.64002A"))return void(this.getVideo().options["device.model"]="Chromecast 3");if(2===e)return void(this.getVideo().options["device.model"]="Chromecast 2");if(1===e)return void(this.getVideo().options["device.model"]="Chromecast 1")}catch(e){}this.getVideo().options["device.model"]="Chromecast"}}playListener(e){this.flags.isStarted||(this.lastPlayhead=void 0,this.fireStart({},"playListener"))}playAdListener(e){this.playListener(),this.firePause({},"playAdListener")}bufferingListener(e){this.flags.isPaused?this.plugin&&this.getVideo().isBreakStarted||(this.fireResume({},"bufferingListener"),this.fireBufferBegin({},!1,"bufferingListener")):this.fireBufferBegin({},!1,"bufferingListener"),this.flags.isStarted||(this.lastPlayhead=void 0,this.fireStart({},"bufferingListener"))}pauseListener(e){this.flags.isBuffering||this.firePause({},"pauseListener")}resumeListener(e){this.fireResume({},"resumeListener")}playingListener(e){this.plugin&&this.getVideo().isBreakStarted||(this.fireResume({},"playingListener"),this.fireBufferEnd({},"playingListener"),this.fireJoin({},"playingListener"))}errorListener(e){const t=e.error,i=e.detailedErrorCode;if(i){if(this.errorFilter.indexOf(i)>=0)return;const e=cast.framework.events.DetailedErrorCode;let s=Object.keys(e).find(function(t){return e[t]===i})||i;t&&t.shakaErrorCode&&(s="Shaka: "+t.shakaErrorCode+" , "+s),"LOAD_CANCELLED"===t?(this.fireFatalError(i,s),this._reset()):this.fireError(i,s)}}seekingListener(e){this.fireSeekBegin({},!1,"seekingListener")}endedListener(e){this.fireStop({},"endedListener"),this._reset()}bitrateChangedListener(e){this.bitrate=e.totalBitrate}segmentListener(e){this.throughput=e.size/(e.downloadTime/1e3)}timeUpdateListener(e){this.flags.isJoined||(null===this.lastPlayhead||void 0===this.lastPlayhead?this.lastPlayhead=this.getPlayhead():this.lastPlayhead<this.getPlayhead()&&this.plugin&&(!this.plugin.getAdsAdapter()||this.plugin.getAdsAdapter()&&!this.plugin.getAdsAdapter().flags.isStarted)&&this.fireJoin({},"timeUpdateListener"))}autoPauseListener(e){e?(this.fireResume({},"autoPauseListener"),this.fireBufferBegin({},!1,"autoPauseListener")):this.fireBufferEnd({},"autoPauseListener")}_reset(e){this.lastPlayhead=void 0,this.actualCount=0,this.bitrate=void 0}},ViaccessOrca:class{_getTagFromPlayer(){return this.player.videoElement?this.player.videoElement:null}checkExistsPlayer(){try{if(this._getTagFromPlayer())return this.checkExistsObjectOnPage(this._getTagFromPlayer())}catch(e){return!0}}getVersion(){return"7.0.2-viaccessorca-js"}getPlayhead(){return this.player.currentTime}getPlayrate(){return this.flags.isPaused?0:this.player.videoElement.playbackRate||1}getDroppedFrames(){return this.player.videoElement.webkitDroppedFrameCount}getDuration(){return this.player.duration}getBitrate(){if(this.player.quality>=0&&this.player.qualities&&this.player.qualities.length){var e=this.player.qualities[this.player.quality];return e.bitrate||e.bandwidth}return null}getRendition(){if(this.player.quality>=0&&this.player.qualities&&this.player.qualities.length){var e=this.player.qualities[this.player.quality],t=e.width,i=e.he
1ight;return t&&i||(t=this.player.videoElement.videoWidth,i=this.player.videoElement.videoHeight),this.getNpawUtils().buildRenditionString(t,i,e.bitrate||e.bandwidth)}return null}getTitle(){return this.player.videoElement.title||"Unknown"}getIsLive(){return"function"==typeof this.player.isLive?this.player.isLive():this.player.isLive}getResource(){return this.player&&this.player.media?this.player.media.url:void 0}getPlayerVersion(){return this.player.version}getPlayerName(){return"Viaccess Orca"}registerListeners(){for(var e in this.monitorPlayhead(!1,!1),this.references={play:this.playListener.bind(this),pause:this.pauseListener.bind(this),playing:this.playingListener.bind(this),error:this.errorListener.bind(this),seeking:this.seekingListener.bind(this),seeked:this.seekedListener.bind(this),buffering:this.bufferingListener.bind(this),ended:this.endedListener.bind(this),abort:this.endedListener.bind(this),destroyed:this.destroyedListener.bind(this),timeupdate:this.timeupdateListener.bind(this),trackschanged:this.changedListener.bind(this)},this.references)this.player.addEventListener&&this.player.addEventListener(e,this.references[e]),this.player.on&&this.player.on(e,this.references[e])}unregisterListeners(){if(this.monitor&&this.monitor.stop(),this.player&&this.references)for(var e in this.references)this.player.removeEventListener&&(this.player.removeEventListener(e,this.references[e]),delete this.references[e]),this.player.off&&(this.player.off(e,this.references[e]),delete this.references[e])}playListener(e){this.firePlayerLog("playListener",{}),this.fireStart({},"playListener"),this.fireResume({},"playListener")}pauseListener(e){this.firePlayerLog("pauseListener",{}),this.firePause({},"pauseListener")}playingListener(e){this.firePlayerLog("playingListener",{}),this.fireJoin({},"playingListener"),this.fireBufferEnd({},"playingListener")}errorListener(e){this.firePlayerLog("errorListener",{});try{var t=e.data?e.data:e;this.fireError(t.code,t.message,void 0,void 0,"errorListener"),this.fireStop({},!1,"errorListener")}catch(e){this.fireError("unknown","unknown",void 0,void 0,"errorListener"),this.fireStop({},!1,"errorListener")}}seekingListener(e){this.firePlayerLog("seekingListener",{}),this.fireSeekBegin({},!1,"seekingListener")}seekedListener(e){this.firePlayerLog("seekedListener",{}),this.fireSeekEnd({},"seekedListener")}bufferingListener(e){this.firePlayerLog("bufferingListener",{buffering:e.buffering}),!0===e.buffering?this.flags.isPaused||this.flags.isSeeking||this.fireBufferBegin({},!1,"bufferingListener"):!1===e.buffering&&this.fireBufferEnd({},"bufferingListener")}endedListener(e){this.firePlayerLog("endedListener",{}),this.fireStop({},"endedListener")}destroyedListener(e){this.firePlayerLog("destroyedListener",{}),this.fireStop({},"destroyedListener")}changedListener(e){e.emittedBy&&"manifest"===e.emittedBy&&(this.firePlayerLog("changedListener",{}),this.flags.isJoined&&this.fireStop({},"changedListener"))}timeupdateListener(e){}},Hbbtv:class{checkExistsPlayer(){try{return this.checkExistsObjectOnPage(this.player)}catch(e){return!0}}getPlayerName(){return"Hbbtv"}registerListeners(){this.states=["STOPPED","PLAYING","PAUSED","CONNECTING","BUFFERING","FINISHED","ERROR"],this.monitorPlayhead(!1,!0),this.player?(this.player.onPlayStateChange=function(e){this.playStateChangeListener()}.bind(this),this.player._video&&(this.player._video.onerror=function(e){this.onErrorListener(e)}.bind(this))):Log.error("The player reference set to the adapter is invalid.")}getResource(){return this.player.data||this.player.src}playStateChangeListener(){switch(this.firePlayerLog("stateValue"+this.player.playState,{}),this.player.playState){case 0:this.firePlayerLog("stopState",{}),this.fireStop({},"stopState");break;case 1:this.bufferPlayhead&&Math.abs(this.bufferPlayhead-this.player.playPosition)>10&&(this.fireSeekBegin({},!0,"playingState"),this.bufferPlayhead=void 0),this.firePlayerLog("playingState",{}),this.fireResume({},"playingState"),this.fireSeekEnd({},"playingState"),this.fireBufferEnd({},"playingState"),this.fireJoin({},"playingState");break;case 2:this.firePlayerLog("pausedState",{}),this.firePause({},"pausedState");break;case 3:this.firePlayerLog("connectionState",{}),this.fireStart({},"connectionState");break;case 4:this.bufferPlayhead=this.player.playPosition,this.firePlayerLog("bufferingState",{}),this.fireStart({},"bufferingState"),this.fireBufferBegin({},!1,"bufferingState");break;case 5:this.firePlayerLog("finishedState",{}),this.fireStop({},"finishedState")}}onErrorListener(e){this.firePlayerLog("onErrorListener",{}),this.fireError("FAILURE","FAILURE",null,null,"onErrorListener"),this.fireStop({},"onErrorListener")}getPlayhead(){return this.player.playPosition/1e3}getDuration(){return this.player.playTime/1e3}getVersion(){return"7.0.4-hbbtvhtml5-jsclass"}},ReactNativeVideo:class{adsAdapters={genericAdsAdapter:S};getVersion(){return"7.0.1-react-native-video-jsclass"}getPlayhead(){const e=this.getVideo().getAdsAdapter();return e&&e.isShowingAds()?this.lastPlayhead:this.playhead}getIsLive(){return void 0!==this.duration?!this.duration:void 0}getDuration(){return this.duration}getResource(){return this.resource}getRendition(){if(this.width&&this.height)return this.getNpawUtils().buildRenditionString(this.width,this.height)}getPlayerName(){return"React Native Video"}setPlatform(e){this.reactPlatform=e}registerListeners(){this.reactPlatform&&"ios"==this.reactPlatform&&this.monitorPlayhead(!0,!0,400),this.getVideo().getAdsAdapter()||this.plugin.setAdsAdapter(this.getAdapterClass("genericAdsAdapter"),this.getVideo().getVideoKey())}unregisterListeners(){this.monitor&&this.monitor.stop()}onLoad(e){this.reactPlatform&&"ios"==this.reactPlatform&&!this.monitor&&this.monitorPlayhead(!0,!0,400);const t=e.naturalSize;t&&(this.width=Math.round(t.width),this.height=Math.round(t.height)),this.duration=e.duration,this.fireStart({},"onLoad"),this.flags.isJoined||(this.onBuffering=!1,this.fireJoin({},"onLoadStart"),this.reactPlatform&&"ios"==this.reactPlatform&&this.monitor&&this.monitor.skipNextTick()),this.pausePlayhead&&Math.abs(this.getPlayhead()-this.pausePlayhead)>.5?this.fireSeekEnd({},"onLoadStart"):this.pausePlayhead&&(this.chronos.pause.pauseTime=void 0),this.pausePlayhead=void 0,this.fireResume({},"onLoadStart")}onLoadStart(e){this.reactPlatform&&"ios"==this.reactPlatform&&!this.monitor&&this.monitorPlayhead(!0,!0,400),e.src&&(this.resource=e.src.uri),this.fireStart({},"onLoadStart")}onPlaybackRateChange(e){this.playrate=e.playbackRate,this.getVideo().getAdsAdapter()&&this.getVideo().getAdsAdapter().isShowingAds()||(this.playrate&&this.playhead>.1?(this.fireStart({},"onPlaybackRateChange"),this.flags.isJoined||(this.onBuffering=!1,this.reactPlatform&&"ios"==this.reactPlatform&&!this.monitor&&this.monitorPlayhead(!0,!0,400),this.fireJoin({},"onPlaybackRateChange"),this.reactPlatform&&"ios"==this.reactPlatform&&this.monitor&&this.monitor.skipNextTick()),this.pausePlayhead&&Math.abs(this.getPlayhead()-this.pausePlayhead)>.5&&!this.flags.isPaused?(this.fireSeekEnd({},"onPlaybackRateChange"),this.pausePlayhead=void 0):this.pausePlayhead&&Math.abs(this.getPlayhead()-this.pausePlayhead)<.5&&!this.onBuffering&&(this.cancelSeek(),this.pausePlayhead=void 0),this.fireResume({},"onPlaybackRateChange")):this.playhead>.1&&(this.reactPlatform&&"android"==this.reactPlatform&&(this.pausePlayhead=this.getPlayhead(),this.fireSeekBegin({},!0,"onPlaybackRateChange")),this.reactPlatform&&"ios"==this.reactPlatform&&(this.lastPlayhead=this.playhead),this.firePause({},"onPlaybackRateChange"),this.reactPlatform&&"android"==this.reactPlatform&&(this.chronos.pause.startTime=(new Date).getTime())))}onProgress(e){const t=this.getVideo().getAdsAdapter();t&&t.isShowingAds()&&this.reactPlatform&&"android"==this.reactPlatform&&!this.lastPlayhead?this.lastPlayhead=this.playhead:!t||t.isShowingAds()||this.flags.isPaused||(this.lastPlayhead=void 0),!t||t.isShowingAds()||this.duration||(this.duration=e.seekableDuration),this.playhead=e.currentTime,e.playableDuration-e.currentTime>.5&&this.fireStart({},"onProgress"),this.playhead>.5&&!this.flags.isJoined&&(this.onBuffering=!1,this.fireJoin({},"onProgress"),this.reactPlatform&&"ios"==this.reactPlatform&&this.monitor&&this.monitor.skipNextTick()),this.pausePlayhead&&!this.flags.isPaused&&(Math.abs(this.getPlayhead()-this.pausePlayhead)>2?this.fireSeekEnd({},"onProgress"):this.onBuffering?(this.fireBufferBegin({},!0,"onProgress"),this.fireBufferEnd({},"onProgress"),this.onBuffering=!1):this.chronos.pause.pauseTime=void 0,this.pausePlayhead=void 0),this.playrate&&(this.onBuffering=!1)}onBuffer(e){e.isBuffering&&void 0!==this.getPlayhead()&&this.reactPlatform&&"android"==this.reactPlatform&&(this.onBuffering=!0,this.fireBufferBegin({},!1,"onBuffer"))}onError(e){let t,i;this.reactPlatform&&"android"==this.reactPlatform?(t=e.error.errorCode,i=e.error.errorException):this.reactPlatform&&"ios"==this.reactPlatform&&(t=e.error.code,i=e.error.localizedDescription),this.fireError(t,i)}onEnd(e){this.reactPlatform&&"ios"==this.reactPlatform&&this.getVideo().getAdsAdapter()?this.stopTimer=setTimeout(()=>{this.fireStop()},this.getVideo().options["ad.postRollTimeout"]||1e3):this.fireStop()}onAdEvent(e){this.getVideo()&&this.getVideo().getAdsAdapter()&&this.getVideo().getAdsAdapter().onAdEvent(e)}},Visualon:class{getVersion(){return"7.0.2-visualon-analytics-js"}getPlayhead(){return this.player.getPosition()}getFramesPerSecond(){const e=this.player.getAnalyticsInfo();if(e&&e.streamingFps)try{return parseInt(e.streamingFps,10)}catch(e){return 0}return 0}getDroppedFrames(){const e=this.player.getAnalyticsInfo();return e&&e.droppedFrames?e.droppedFrames:0}getDuration(){return this.player.getDuration()}getBitrate(){return this.targetBitrate}getTotalBytes(){var e=this.player.getAnalyticsInfo();if(e&&e.downloadBytes)return e.downloadBytes}getRendition(){return this.getNpawUtils().buildRenditionString(this.width,this.height,this.targetBitrate)}getIsLive(){return this.player.isLive()}getResource(){var e=this.player.getAnalyticsInfo();return e&&e.videoLinkURL?e.videoLinkURL:null}getPlayerVersion(){return this.player.getVersion()}getPlayerName(){return"VisualON"}registerListeners(){if("undefined"!=typeof voPlayer&&this.player)for(var e in this.references={},this.references[voPlayer.events.VO_OSMP_SRC_CB_OPEN_FINISHED]=this.openListener.bind(this),this.references[voPlayer.events.VO_OSMP_CB_PLAY_STARTED]=this.playListener.bind(this),this.references[voPlayer.events.VO_OSMP_CB_PLAY_PLAYING]=this.playingListener.bind(this),this.references[voPlayer.events.VO_OSMP_CB_PLAY_WAITING]=this.bufferListener.bind(this),this.references[voPlayer.events.VO_OSMP_CB_PLAY_PAUSED]=this.pauseListener.bind(this),this.references[voPlayer.events.VO_OSMP_CB_PLAY_COMPLETE]=this.endListener.bind(this),this.references[voPlayer.events.VO_OSMP_CB_SEEK_START]=this.seekListener.bind(this),this.references[voPlayer.events.VO_OSMP_CB_SEEK_COMPLETE]=this.seekEndListener.bind(this),this.references[voPlayer.events.VO_OSMP_CB_PLAY_TIME_UPDATED]=this.timeUpdatedListener.bind(this),this.references[voPlayer.events.VO_OSMP_CB_ERROR_EVENTS]=this.errorListener.bind(this),this.references[voPlayer.events.VO_OSMP_SRC_ADAPTIVE_STREAMING_INFO_EVENT_BITRATE_CHANGE]=this.bitrateChangeListener.bind(this),this.references)this.player.addEventListener(e,this.references[e]);this._reset()}unregisterListeners(){if("undefined"!=typeof voPlayer&&this.player&&this.references){for(let e in this.references)this.player.off(e,this.references[e]);delete this.references}}bitrateChangeListener(e){e.mediaType&&"video"===e.mediaType&&(this.targetBitrate=e.bandwidth,this.width=e.width,this.height=e.height)}openListener(e){this.fireStop({},"openListener"),this._reset()}timeUpdatedListener(e){}playListener(e){this.fireStart({},"playListener")}pauseListener(e){this.firePause({},"pauseListener")}playingListener(e){this.fireStart({},"playingListener"),this.fireJoin({},"playingListener"),this.fireResume({},"playingListener"),this.fireSeekEnd({},"playingListener"),this.fireBufferEnd({},"playingListener")}seekListener(e){this.fireSeekBegin({},!1,"seekListener")}seekEndListener(e){this.fireSeekEnd({},"seekEndListener")}endListener(e){this.fireStop({},"endListener"),this._reset()}bufferListener(e){this.fireBufferBegin({},!1,"bufferListener")}errorListener(e){this.fireError(e.code,e.message,void 0,void 0,"errorListener")}_reset(){this.width=null,this.height=null,this.targetBitrate=null}},BitmovinReactNative:class{onSourceLoaded(e){this.getLog().verbose("BitmovinReactNativeAdapter","onSourceLoaded:",e),this.firePlayerLog("onSourceLoaded",e),e&&e.source&&e.source.duration&&(this.duration=e.source.duration)}onAudioChanged(e){this.getLog().verbose("BitmovinReactNativeAdapter","onAudioChanged:",e),this.firePlayerLog("onAudioChanged",e)}onVideoDownloadQualityChanged(e){this.getLog().verbose("BitmovinReactNativeAdapter","onVideoDownloadQualityChanged:",e),this.firePlayerLog("onVideoDownloadQualityChanged",e)}onVideoPlaybackQualityChanged(e){this.getLog().verbose("BitmovinReactNativeAdapter","onVideoPlaybackQualityChanged:",e),this.firePlayerLog("onVideoPlaybackQualityChanged",e),e&&(e.width&&(this.width=e.width),e.height&&(this.height=e.height),e.bitrate&&(this.bitrate=e.bitrate),e&&e.newVideoQuality&&(this.width=e.newVideoQuality.width,this.height=e.newVideoQuality.height,this.bitrate=e.newVideoQuality.bitrate))}onReady(e){this.getLog().verbose("BitmovinReactNativeAdapter","onReady:",e),this.firePlayerLog("onReady",e)}onPlay(e){this.getLog().verbose("BitmovinReactNativeAdapter","onPlay:",e),this.firePlayerLog("onPlay",e);var t="_onPlay";e&&e.name&&(t=e.name),this.flags.isStarted||this.fireStart({},t),this.flags.isStarted&&this.fireResume({},t)}onPlaying(e){this.getLog().verbose("BitmovinReactNativeAdapter","onPlaying:",e),this.firePlayerLog("onPlaying",e);var t="_onPlay";e&&e.name&&(t=e.name),this.flags.isJoined||this.fireJoin({},t),this.flags.isStarted&&this.fireResume({},t)}onTimeChanged(e){this.getLog().verbose("BitmovinReactNativeAdapter","onTimeChanged:",e),this.firePlayerLog("onTimeChanged",e),e&&((e.currentTime||e.time)&&(this.playhead=e.currentTime),this.playhead=e.currentTime)}onPaused(e){this.getLog().verbose("BitmovinReactNativeAdapter","onPaused:",e),this.firePlayerLog("onPaused",e);var t="_onPaused";e&&e.name&&(t=e.name),this.firePause({},t)}onSeek(e){this.getLog().verbose("BitmovinReactNativeAdapter","onSeek:",e),this.firePlayerLog("onSeek",e);var t="_onSeek";e&&e.name&&(t=e.name),this.isSeeking=!0,this.fireSeekBegin({},!1,t)}onSeeked(e){this.getLog().verbose("BitmovinReactNativeAdapter","onSeeked:",e),this.firePlayerLog("onSeeked",e);var t="_onSeeked";e&&e.name&&(t=e.name),this.seekIntervalId&&clearInterval(this.seekIntervalId),this.isSeeking=!1,this.seekIntervalId=setInterval(()=>{this.isSeeking||(this.fireSeekEnd({},t),clearInterval(this.seekIntervalId),this.seekIntervalId=null)},500)}onPlaybackFinished(e){this.getLog().verbose("BitmovinReactNativeAdapter","onPlaybackFinished:",e),this.firePlayerLog("onPlaybackFinished",e);var t="_onPlaybackFinished";e&&e.name&&(t=e.name),this.fireStop({},t)}onStallStarted(e){this.getLog().verbose("BitmovinReactNativeAdapter","onStallStarted:",e),this.firePlayerLog("onStallStarted",e);var t="_onStallStarted";e&&e.name&&(t=e.name),this.fireBufferBegin({},!1,t)}onStallEnded(e){this.getLog().verbose("BitmovinReactNativeAdapter","onStallEnded:",e),this.firePlayerLog("onStallEnded",e);var t="_onStallEnded";e&&e.name&&(t=e.name),this.chronos.buffer.getDeltaTime(!1)<50?this.cancelBuffer():this.fireBufferEnd({},t)}onPlayerWarning(e){this.getLog().verbose("BitmovinReactNativeAdapter","onPlayerWarning:",e),this.firePlayerLog("onPlayerWarning",e);var t=null,i=null;e&&(e.code&&(t=e.code),e.message&&(i=e.message)),this.fireError(t,i)}onPlayerError(e){this.getLog().verbose("BitmovinReactNativeAdapter","onPlayerError:",e),this.firePlayerLog("onPlayerError",e);var t=null,i=null;e&&(e.code&&(t=e.code),e.message&&(i=e.message)),this.fireError(t,i)}onSourceError(e){this.getLog().verbose("BitmovinReactNativeAdapter","onSourceError:",e),this.firePlayerLog("onSourceError",e);var t=null,i=null;e&&(e.code&&(t=e.code),e.message&&(i=e.message)),this.fireError(t,i)}onSourceWarning(e){this.getLog().verbose("BitmovinReactNativeAdapter","onSourceWarning:",e),t
1his.firePlayerLog("onSourceWarning",e);var t=null,i=null;e&&(e.code&&(t=e.code),e.message&&(i=e.message)),this.fireError(t,i)}getBitrate(){return this.bitrate}onDestroy(e){this.fireStop()}getVersion(){return"7.0.2-bitmovin-react-native-jsclass"}getPlayhead(){return this.playhead}getIsLive(){return!this.duration}getDuration(){return this.duration}getResource(){return this.player&&this.player.source&&this.player.source.config?this.player.source.config.url:null}getTitle(){return this.player&&this.player.source&&this.player.source.config?this.player.source.config.title:null}setPlatform(e){this.reactPlatform=e}getRendition(){if(this.width&&this.height)return this.bitrate?this.getNpawUtils().buildRenditionString(this.width,this.height,this.bitrate):this.getNpawUtils().buildRenditionString(this.width,this.height)}getPlayerName(){return"Bitmovin React Native"}},MediaKindWmc:class{registerListeners(){this.inAdBreak=!1,this.lastSeenBitrate=0,this.lastPlayhead=0,this.lastDuration=0}registerWmcManager(e){if(this.wmcEventListeners=new Map,!e)return;this.wmcManager=e;const t=amc.AmcEvents,i=this._checkAdsAdapter.bind(this),s=this.errorListener.bind(this),r=this.playbackStartedListener.bind(this),a=this.bitrateChangedListener.bind(this),n=this.metricsUpdateListener.bind(this),h=this.programChangedListener.bind(this),l=this.seekCompletedListener.bind(this),d=this.stateChangedListener.bind(this),o=this.positionChangedListener.bind(this);this.wmcEventListeners.set(t.AMC_EVENT_AD_BREAK,i),this.wmcManager.addEventListener(t.AMC_EVENT_AD_BREAK,i),this.wmcEventListeners.set(t.AMC_EVENT_BIT_RATE_CHANGED,a),this.wmcManager.addEventListener(t.AMC_EVENT_BIT_RATE_CHANGED,a),this.wmcEventListeners.set(t.AMC_EVENT_ERROR,s),this.wmcManager.addEventListener(t.AMC_EVENT_ERROR,s),this.wmcEventListeners.set(t.AMC_EVENT_INIT_COMPLETE,r),this.wmcManager.addEventListener(t.AMC_EVENT_INIT_COMPLETE,r),this.wmcEventListeners.set(t.AMC_EVENT_METRICS_UPDATE,n),this.wmcManager.addEventListener(t.AMC_EVENT_METRICS_UPDATE,n),this.wmcEventListeners.set(t.AMC_EVENT_PLAYER_METADATA,n),this.wmcManager.addEventListener(t.AMC_EVENT_PLAYER_METADATA,n),this.wmcEventListeners.set(t.AMC_EVENT_PLAYOUT_METRIC_UPDATE,n),this.wmcManager.addEventListener(t.AMC_EVENT_PLAYOUT_METRIC_UPDATE,n),this.wmcEventListeners.set(t.AMC_EVENT_PLAY_READY,r),this.wmcManager.addEventListener(t.AMC_EVENT_PLAY_READY,r),this.wmcEventListeners.set(t.AMC_EVENT_PROGRAM_CHANGED,h),this.wmcManager.addEventListener(t.AMC_EVENT_PROGRAM_CHANGED,h),this.wmcEventListeners.set(t.AMC_EVENT_SEEK_COMPLETE,l),this.wmcManager.addEventListener(t.AMC_EVENT_SEEK_COMPLETE,l),this.wmcEventListeners.set(t.AMC_EVENT_STATE_CHANGED,d),this.wmcManager.addEventListener(t.AMC_EVENT_STATE_CHANGED,d),this.wmcEventListeners.set(t.AMC_EVENT_VIDEO_POSITION_CHANGED,o),this.wmcManager.addEventListener(t.AMC_EVENT_VIDEO_POSITION_CHANGED,o)}unregisterListeners(){this.wmcEventListeners.forEach((e,t)=>{this.wmcManager.removeEventListener(t,e)}),this.wmcEventListeners.clear()}_checkAdsAdapter(){const e=this.getVideo().getAdsAdapter();return e?e&&!e.player&&e.setPlayer(this.player):(this.plugin.setAdsAdapter(this.getAdapterClass("nativeAdsAdapter"),this.getVideo().getVideoKey()),this.getVideo().getAdsAdapter().registerListeners(this.wmcManager)),null}playbackStartedListener(e){this.flags.isStarted||(this.firePlayerLog("playbackStarted",{}),this.lastPlayhead=0,this.fireStart({},"playbackStarted"),this.failedView=!1)}bitrateChangedListener(e){this.firePlayerLog("bitrateChangedListener",{}),e.value1&&(this.lastSeenBitrate=e.value1)}metricsUpdateListener(e){this.firePlayerLog("metricsUpdateListener",{}),e.value1&&(e.value1.audio&&e.value1.audio.codec&&(this.audioCodec=e.value1.audio.codec),e.value1.video&&(e.value1.video.codec&&(this.videoCodec=e.value1.video.codec),e.value1.video.frameRate&&(this.fps=e.value1.video.frameRate),e.value1.video.resolution&&(this.resolution=e.value1.video.resolution),e.value1.video.droppedFrames&&(this.droppedFrames=e.value1.video.droppedFrames),e.value1.video.latency&&(this.latency=e.value1.video.latency)))}programChangedListener(e){return this.firePlayerLog("programChangedListener",{}),null}seekCompletedListener(e){return this.firePlayerLog("seekCompletedListener",{}),this.flags.isSeeking||this.fireSeekBegin({},!1,"seekCompletedListener"),this.fireSeekEnd({},"seekCompletedListener"),null}stateChangedListener(e){switch(this.firePlayerLog("stateChangedListener",{}),e.value1){case amc.AmcConstants.IMC_STATE_PLAY_NONE:break;case amc.AmcConstants.IMC_STATE_PLAY_STARTED:this.inAdBreak||(this.flags.isStarted||this.fireStart({},"IMC_STATE_PLAY_STARTED"),this.flags.isJoined||this.fireJoin({},"IMC_STATE_PLAY_STARTED"));break;case amc.AmcConstants.IMC_STATE_PLAY_PAUSED:this.firePause({},"IMC_STATE_PLAY_PAUSED");break;case amc.AmcConstants.IMC_STATE_PLAY_RESUMED:this.flags.isSeeking?this.fireSeekEnd({},"IMC_STATE_PLAY_RESUMED"):this.flags.isBuffering&&this.fireBufferEnd({},"IMC_STATE_PLAY_RESUMED"),this.flags.isPaused&&this.fireResume({},"IMC_STATE_PLAY_RESUMED");break;case amc.AmcConstants.IMC_STATE_PLAY_STOPPED:this.inAdBreak||this.fireStop({},"IMC_STATE_PLAY_STOPPED");break;case amc.AmcConstants.IMC_STATE_SEEKING:this.inAdBreak||this.fireSeekBegin({},!1,"IMC_STATE_SEEKING");break;case amc.AmcConstants.IMC_STATE_PLAY_COMPLETED:this.inAdBreak||this.fireStop({},"IMC_STATE_PLAY_COMPLETED");break;case amc.AmcConstants.IMC_STATE_BUFFERING_STARTED:this.flags.isSeeking||this.fireBufferBegin({},!1,"IMC_STATE_BUFFERING_STARTED");break;case amc.AmcConstants.IMC_STATE_BUFFERING_STOPPED:this.flags.isSeeking?this.fireSeekBegin({},!1,"IMC_STATE_BUFFERING_STOPPED"):this.fireBufferEnd({},"IMC_STATE_BUFFERING_STOPPED");break;case amc.AmcConstants.IMC_STATE_DOWNLOAD_STARTED:case amc.AmcConstants.IMC_STATE_DOWNLOAD_STOPPED:case amc.AmcConstants.IMC_STATE_DOWNLOAD_COMPLETED:case amc.AmcConstants.IMC_STATE_DOWNLOAD_PAUSED:case amc.AmcConstants.IMC_STATE_DOWNLOAD_CANCELLED:case amc.AmcConstants.IMC_STATE_DOWNLOAD_PLAY_READY:break;case amc.AmcConstants.IMC_STATE_ADS_STARTED:this.inAdBreak=!0;break;case amc.AmcConstants.IMC_STATE_ADS_COMPLETED:this.inAdBreak=!1;break;case amc.AmcConstants.IMC_STATE_DONE:this.inAdBreak||this.fireStop({},"IMC_STATE_DONE")}return null}translateImcEvent(e){return{[amc.AmcConstants.IMC_STATE_PLAY_NONE]:"Play None",[amc.AmcConstants.IMC_STATE_PLAY_STARTED]:"Play Started",[amc.AmcConstants.IMC_STATE_PLAY_PAUSED]:"Play Paused",[amc.AmcConstants.IMC_STATE_PLAY_RESUMED]:"Play Resumed",[amc.AmcConstants.IMC_STATE_PLAY_STOPPED]:"Play Stopped",[amc.AmcConstants.IMC_STATE_PLAY_COMPLETED]:"Play Completed",[amc.AmcConstants.IMC_STATE_BUFFERING_STARTED]:"Buffering Started",[amc.AmcConstants.IMC_STATE_BUFFERING_STOPPED]:"Buffering Stopped",[amc.AmcConstants.IMC_STATE_SEEKING]:"Seeking",[amc.AmcConstants.IMC_STATE_ADS_STARTED]:"Ads Started",[amc.AmcConstants.IMC_STATE_ADS_COMPLETED]:"Ads Completed",[amc.AmcConstants.IMC_STATE_DOWNLOAD_STARTED]:"Download Started",[amc.AmcConstants.IMC_STATE_DOWNLOAD_STOPPED]:"Download Stopped",[amc.AmcConstants.IMC_STATE_DOWNLOAD_COMPLETED]:"Download Completed",[amc.AmcConstants.IMC_STATE_DOWNLOAD_PAUSED]:"Download Paused",[amc.AmcConstants.IMC_STATE_DOWNLOAD_CANCELLED]:"Download Cancelled",[amc.AmcConstants.IMC_STATE_DOWNLOAD_PLAY_READY]:"Download Play Ready",[amc.AmcConstants.IMC_STATE_DONE]:"Done"}[e]||"Unknown IMC Event"}positionChangedListener(e){return this.firePlayerLog("positionChangedListener",{}),e.value1?this.lastPlayhead=e.value1:e.videoPosition&&(this.lastPlayhead=e.videoPosition),e.videoDuration&&(this.lastDuration=e.videoDuration),this.getPlayhead()>.2&&(this.getIsLive()||this.getPlayhead()+1<this.getDuration())&&(this.flags.isStarted||(this.fireStart({},"positionChangedListener"),this.failedView=!1),this.flags.isJoined||this.fireJoin({}
1,"positionChangedListener")),!this.player.doIsPaused()&&this.flags.isSeeking&&this.fireSeekEnd({},"positionChangedListener"),null}errorListener(e){if(!this.failedView)return this.firePlayerLog("errorListener",{}),this.flags.isStarted||(this.failedView=!0),e.code?this.fireError(e.code,e.message,void 0,void 0,"errorListener"):this.fireError(e,"Error",void 0,void 0,"errorListener"),this.fireStop(this.getStopParams()),null}getVersion(){return"7.0.1-mediakind-wmc-jsclass"}getPlayhead(){return this.player?this.player.getCurrentTime():this.lastPlayhead}_getPlayhead(){return this.getPlayhead()}getPlayrate(){return this.player?this.player.getPlaybackRate():null}getStopParams(){let e={};return this.getVideo().getPlayhead()>0&&(e={playhead:this.getVideo().getPlayhead()}),e}getDroppedFrames(){return this.player&&this.player.doGetPlayer?this.player.doGetPlayer().getDroppedVideoFrames():null}getDuration(){return this.player?this.player.doGetVideoDuration()??this.lastDuration:this.lastDuration}getBitrate(){if(this.lastSeenBitrate)return this.lastSeenBitrate;let e=null;if(this.player){const t=this.player.doGetPlayer().getPlaybackVideoData(),i=this.player.doGetPlayer().getVideoQuality();i&&i.bitrate?e=i.bitrate:t&&t.bitrate&&(e=t.bitrate)}return e}getRendition(){let e=null;const t=this.getBitrate(),i=this.getResolution();if(t&&i){const[s,r]=i.split("x").map(Number);e=this.getNpawUtils().buildRenditionString(s,r,t)}else if(this.player){const t=this.player.doGetPlayer().getPlaybackVideoData(),i=this.player.doGetPlayer().getVideoQuality(),s=this.player.doGetPlayer().getStreamType();i&&i.bitrate?e=this.getNpawUtils().buildRenditionString(i.width,i.height,i.bitrate):t&&t.bitrate?e=this.getNpawUtils().buildRenditionString(t.width,t.height,t.bitrate):"progressive"===s&&(i?e=this.getNpawUtils().buildRenditionString(i.width,t.height):t&&(e=this.getNpawUtils().buildRenditionString(t.width,t.height)))}return e}getIsLive(){return this.player?this.player.isLive():null}getPlayerVersion(){return this.wmcManager?this.wmcManager.getAmcVersion():null}getPlayerName(){return"MediaKind"}getFramesPerSecond(){if(this.fps)return this.fps;let e=null;if(this.player){const t=this.player.doGetPlayer().getPlaybackVideoData(),i=this.player.doGetPlayer().getVideoQuality();i&&i.frameRate?e=i.frameRate:t&&t.frameRate&&(e=t.frameRate)}return e}getThroughput(){return null}getVideoCodec(){if(this.videoCodec)return this.videoCodec;let e=null;if(this.player){const t=this.player.doGetPlayer().getPlaybackVideoData(),i=this.player.doGetPlayer().getVideoQuality();i&&i.codec?e=i.codec:t&&t.codec&&(e=t.codec)}return e}getAudioCodec(){return this.audioCodec?this.audioCodec:null}getTotalBytes(){return null}getResource(){return this.player&&this.player.doGetPlayer?this.player.manifestUrl||this.player.doGetPlayer().getSource():null}getResolution(){return this.resolution?this.resolution:null}getProgram(){let e=null;return wmcMgr.doGetProgramInfo&&(e=wmcMgr.doGetProgramInfo().name),e}},TCPlayer:class{checkExistsPlayer(){try{return this.checkExistsObjectOnPage(this.player)}catch(e){return!0}}pauseListener(e){this.firePlayerLog("pauseListener",{}),this.firePause({},"pauseListener")}bufferingListener(e){this.firePlayerLog("waitingListener",{}),this.fireBufferBegin({},!1,"waitingListener")}getIsLive(){return this.player.duration()===1/0}playListener(e){this.firePlayerLog("playListener",{}),this.player&&this.playhead&&this.checkReadyState(this.player.readyState,"playListener"),(void 0===this.lastResource||this.getResource()&&this.lastResource!==this.getResource())&&(this.lastResource=this.getResource().split("?")[0]),this.fireStart({},"playListener")}registerListeners(){this.references={play:this.playListener.bind(this),pause:this.pauseListener.bind(this),playing:this.playingListener.bind(this),loadstart:this.loadStartListener.bind(this),error:this.errorListener.bind(this),seeking:this.seekingListener.bind(this),seeked:this.seekedListener.bind(this),ended:this.endedListener.bind(this),waiting:this.bufferingListener.bind(this),timeupdate:this.timeupdateListener.bind(this),canplay:this.canPlayListener.bind(this),canplaythrough:this.canPlayThroughListener.bind(this),loadedmetadata:this.loadedMetadataListener.bind(this),loadeddata:this.loadedDataListener.bind(this)};for(const e in this.references)this.references[e]&&this.player.on(e,this.references[e])}endedListener(e){const t=this.getVideo().getAdsAdapter();let i=!1;t&&void 0!==t.isDAI&&(t.isDAI||(i=t.player.getCuePoints().includes(-1))),i||(this.firePlayerLog("endedListener",{}),this.fireStop({},"endedListener"))}getPlayrate(){return this.player.playbackRate()}canPlayListener(e){this.player&&(this.playhead||this.getVideo()&&this.getVideo().getIsLive())&&this.checkReadyState(this.player.readyState,"canPlayListener")}canPlayThroughListener(e){this.player&&(this.playhead||this.getVideo()&&this.getVideo().getIsLive())&&this.checkReadyState(this.player.readyState,"canPlayThroughListener")}timeupdateListener(e){(this.getPlayhead()>0||this.getVideo()&&this.getVideo().getIsLive())&&!this.player.error&&(this.fireStart({},"timeupdateListener"),this.fireJoin({},"timeupdateListener"))}getResource(){return this.player.src()}getPlayhead(){return this.player.currentTime()}getDuration(){return this.player.duration()}getDroppedFrames(){return this.player.getVideoPlaybackQuality().droppedVideoFrames}seekingListener(e){this.firePlayerLog("seekingListener",{}),this.fireSeekBegin({},!1,"seekingListener")}getPlayerName(){return"tcplayer"}playingListener(e){this.firePlayerLog("playingListener",{}),this.fireJoin({},"playingListener"),this.fireResume({},"playingListener"),this.fireSeekEnd({},"playingListener"),this.flags.isBuffering&&this.fireBufferEnd({},"playingListener")}errorListener(e){this.firePlayerLog("errorListener",{});var t=null,i=null;try{e&&e.target&&e.target.error&&(i=e.target.error.code,t=e.target.error.message)}catch(e){}this.fireError(i,t,void 0,void 0,"errorListener")}loadedMetadataListener(e){this.player&&(this.playhead||this.getVideo()&&this.getVideo().getIsLive())&&this.checkReadyState(this.player.readyState,"loadedMetadataListener")}getVersion(){return"7.0.0-tcplayer-jsclass"}seekedListener(e){this.firePlayerLog("seekedListener",{}),this.fireSeekEnd({},"seekedListener")}loadStartListener(e){this.firePlayerLog("loadStartListener",{}),this.flags.isJoined&&this.getResource()&&this.getResource().split("?")[0]!==this.lastResource&&this.fireStop({},"loadStartListener")}unregisterListeners(){if(this.monitor&&this.monitor.stop(),this.player&&this.references)for(var e in this.references)this.player.removeEventListener(e,this.references[e]),delete this.references[e]}loadedDataListener(e){this.player&&(this.playhead||this.getVideo()&&this.getVideo().getIsLive())&&this.checkReadyState(this.player.readyState,"loadedDataListener")}},AVPlay:class{checkExistsPlayer(){return!!this.player}getVersion(){return"7.0.2-samsungavplay-jsclass"}getPlayhead(){return this.player?(parseInt(this.player.getCurrentTime(),10)||0)/1e3:0}getIsLive(){return!(!this.player||!this.player.getStreamingProperty("IS_LIVE"))&&1===parseInt(this.player.getStreamingProperty("IS_LIVE"))}getDuration(){if(this.player){const e=parseInt(this.player.getDuration(),10);if(e&&e>0)return e/1e3}return-1}getPlayrate(){return 1}getPlayerName(){return"Tizen-AVPlay"}getPlayerVersion(){return this.player.getVersion()}registerListeners(){let e={onbufferingstart:this.onBufferingStart.bind(this),onbufferingprogress:this.onBufferingProgress.bind(this),onbufferingc
1omplete:this.onBufferingComplete.bind(this),onstreamcompleted:this.onStreamCompleted.bind(this),oncurrentplaytime:this.onCurrentPlayTime.bind(this),onevent:this.onEvent.bind(this),onerror:this.onError.bind(this)};this.player&&e&&this.player.setListener(e),this._wrapPlayerFunctions()}unregisterListeners(){this.player.setListener({}),this._unwrapPlayerFunctions()}onBufferingStart(){this.flags.isJoined&&this.fireBufferBegin({},!1,"onBufferingStart")}onBufferingComplete(){this.flags.isJoined?this.fireBufferEnd({},"onBufferingComplete"):this.fireJoin({},"onBufferingComplete")}onStreamCompleted(){this.fireStop({},"onStreamCompleted")}onError(e){this.fireError(e,"AVPlay error")}_wrapPlayerFunctions(){this.player&&(this.player.prepare&&"function"==typeof this.player.prepare&&(this.originalPrepare=this.player.prepare.bind(this.player),this.originalPrepare&&(this.player.prepare=(...e)=>{this.flags.initCalled||(this.flags.initCalled=!0,this.fireInit({},"prepare")),this.originalPrepare(...e)})),this.player.prepareAsync&&"function"==typeof this.player.prepareAsync&&(this.originalPrepareAsync=this.player.prepareAsync.bind(this.player),this.originalPrepareAsync&&(this.player.prepareAsync=(e,t)=>{this.flags.initCalled||(this.flags.initCalled=!0,this.fireInit({},"prepareAsyncWrapper")),this.originalPrepareAsync(()=>{"function"==typeof e&&e()},e=>{"function"==typeof t&&t(e)})})),this.player.play&&"function"==typeof this.player.play&&(this.originalPlay=this.player.play.bind(this.player),this.originalPlay&&(this.player.play=()=>{this.flags.isPaused&&this.fireResume({},"playWrapper"),this.originalPlay()})),this.player.pause&&"function"==typeof this.player.pause&&(this.originalPause=this.player.pause.bind(this.player),this.originalPause&&(this.player.pause=()=>{this.firePause({},"pauseWrapper"),this.originalPause()})),this.player.seekTo&&"function"==typeof this.player.seekTo&&(this.originalSeekTo=this.player.seekTo.bind(this.player),this.originalSeekTo&&(this.player.seekTo=e=>{this.fireSeekBegin({},!1,"seekTo"),this.originalSeekTo(e),setTimeout(()=>{this.fireSeekEnd({},"seekToWrapper")},500)})),this.player.stop&&"function"==typeof this.player.stop&&(this.originalStop=this.player.stop.bind(this.player),this.originalStop&&(this.player.stop=()=>{this.fireStop({},"stopWrapper"),this.originalStop()})))}_unwrapPlayerFunctions(){this.player&&(this.originalPrepare&&"function"==typeof this.originalPrepare&&(this.player.prepare=this.originalPrepare,this.originalPrepare=null),this.originalPrepareAsync&&"function"==typeof this.originalPrepareAsync&&(this.player.prepareAsync=this.originalPrepareAsync,this.originalPrepareAsync=null),this.originalPlay&&"function"==typeof this.originalPlay&&(this.player.play=this.originalPlay,this.originalPlay=null),this.originalPause&&"function"==typeof this.originalPause&&(this.player.pause=this.originalPause,this.originalPause=null),this.originalSeekTo&&"function"==typeof this.originalSeekTo&&(this.player.seekTo=this.originalSeekTo,this.originalSeekTo=null),this.originalStop&&"function"==typeof this.originalStop&&(this.player.stop=this.originalStop,this.originalStop=null))}}},ads:{Ima:class{pauseListener(e){this.firePause()}getAdInsertionType(){return this.isDAI?this.getNpawReference().Constants.AdInsertionType.ServerSide:this.getNpawReference().Constants.AdInsertionType.ClientSide}progressDAIListener(e){e.getStreamData&&e.getStreamData()?this.playhead=e.getStreamData().adProgressData.currentTime:"function"==typeof e.getAdData&&e.getAdData()&&(this.playhead=e.getAdData().currentTime),this.fireJoin()}getRendition(){let e=null;if(this.player)if(this.isDAI)this.width&&this.height&&(e=this.width+"x"+this.height);else{const t=this.player.getCurrentAd();e=t.getVastMediaWidth().toString()+"x"+t.getVastMediaHeight().toString()}return e}startDAIListener(e){this.isDAI=!0,this.playhead=0}getPlayerVersion(){return google.ima.VERSION}playListener(e){this.isDAI=!1,this.adPosition=this.getAdPosition();const t="function"==typeof e.getAdData?e.getAdData():null;this.totalAds=t&&t.adPodInfo?t.adPodInfo.totalAds:null,this.plugin.fireInit(void 0,"playListener",this.getVideo().getVideoKey()),this.getVideo().getAdapter()&&this.getVideo().getAdapter().firePause(),this.fireStart({adPlayhead:"0"})}getTitle2(){let e=this.advertiser;return this.player&&!this.isDAI&&(e=this.player.getCurrentAd().getAdvertiserName()),e}errorDAIListener(e){this.fireError(),this.fireStop()}secondQuartileListener(e){this.fireQuartile(2)}endedListener(e){this.lastDuration?this.fireStop({adPlayhead:this.lastDuration}):this.fireStop()}getGivenBreaks(){let e=null;return this.player&&this.player.getCuePoints&&(e=this.player.getCuePoints().length),e}loadedListener(e){const t="function"==typeof e.getAdData?e.getAdData():null;this.totalAds=t&&t.adPodInfo?t.adPodInfo.totalAds:void 0,this.clickUrl=t?t.clickThroughUrl:void 0,this.plugin.isBreakStarted&&this.playListener(e)}getPlayhead(){let e=this.playhead;return this.flags.isJoined?this.player&&!this.isDAI&&(e=this.getDuration()-this.player.getRemainingTime()):e=0,e}getDuration(){let e=this.duration;return this.player&&!this.isDAI&&(this.player.getCurrentAd&&this.player.getCurrentAd()&&(this.lastDuration=this.player.getCurrentAd().getDuration()),e=this.lastDuration),e}getGivenAds(){return this.totalAds}getIsSkippable(){let e=null;return this.player&&this.player.getCurrentAd&&(e=this.player.getCurrentAd().g.skippable),e}getCreativeId(){let e=null;return!this.isDAI&&this.player.getCurrentAd()&&(e=this.player.getCurrentAd().getCreativeId()),e}thirdQuartileListener(e){this.fireQuartile(3)}getAudioEnabled(){let e=null;return this.player&&(e=!this.player.getVolume||0!==this.player.getVolume()),e}getVersion(){return"7.0.9-ima-jsclass"}logListener(e){if("function"==typeof e.getAdData&&e.getAdData().adError){const t=e.getAdData().adError;this.fireError(t.getErrorCode(),t.getMessage()),this.fireStop()}}unregisterListeners(){if(this.monitor&&this.monitor.stop(),this.player&&this.references){for(let e in this.references)this.player.removeEventListener(e,this.references[e]);this.references={}}}clickListener(e){let t=this.clickUrl;const i=this.player.getCurrentAd();i&&i.g&&i.g.clickThroughUrl&&(t=i.g.clickThroughUrl);const s=(new Date).getTime();this.lastUrl===t&&s<(this.lastTime||0)+2e3||(this.lastUrl=t,this.lastTime=s,this.fireClick(t))}getAdPosition(){let e=this.getNpawReference().Constants.AdPosition.Midroll;if(this.isDAI){const t=this.getVideo().getAdapter();t&&(!t.flags.isJoined||t.getPlayhead()<1)?e=this.getNpawReference().Constants.AdPosition.Preroll:t&&t.flags.isJoined&&t.getPlayhead()+this.duration+1>=t.getDuration()&&(e=this.getNpawReference().Constants.AdPosition.Postroll)}else switch(this.player.getCurrentAd().getAdPodInfo().getTimeOffset()){case 0:e=this.getNpawReference().Constants.AdPosition.Preroll;break;case-1:e=this.getNpawReference().Constants.AdPosition.Postroll}return e}firstQuartileListener(e){this.fireQuartile(1)}getIsLive(){let e=null;return this.player.levels&&this.player.levels[this.player.currentLevel]&&(e=this.player.levels[this.player.currentLevel].details.live),e}getTitle(){let e=this.title;return this.player&&!this.isDAI&&(e=this.player.getCurrentAd().getTitle()),e}registerListeners(){if(this.references={},google.ima.AdEvent){this.monitorPlayhead(!0,!1);const e=google.ima.AdEvent.Type;this.references[e.CONTENT_PAUSE_REQUESTED]=this.playListener.bind(this),this.references[e.LOADED]=this.loadedListener.bind(this),this.references[e.PAUSED]=this.pauseListener.bind(this),this.references[e.STARTED]=this.playingListener.bind(this),this.references[e.RESUMED]=this.playingListener.bind(this),this.references[google.ima.AdErrorEvent.Type.AD_ERROR]=this.errorListener.bind(this),this.references[e.COMPLETE]=this.endedListener.bind(this),this.references[e.CONTENT_RESUME_REQUESTED]=this.endedListener.bind(this),this.references[e.SKIPPED]=this.skippedListener.bind(this),this.references[e.CLICK]=this.clickListener.bind(this),this.references[e.ALL_ADS_COMPLETED]=this.endedViewListener.bind(this),this.references[e.LOG]=this.logListener.bind(this),this.references[e.FIRST_QUARTILE]=this.firstQuartileListener.bind(this),this.references[e.MIDPOINT]=this.secondQuartileListener.bind(this),this.references[e.THIRD_QUARTILE]=this.thirdQuartileListener.bind(this),this.references[e.CONTENT_RESUME_REQUESTED]=this.breakEndListener.bind(this)}if(google.ima.dai){const e=google.ima.dai.api.StreamEvent.Type;this.references[e.SKIPPED]=this.skippedL.bind(this),this.references[e.ERROR]=this.errorDAIListener.bind(this),this.references[e.AD_BREAK_STARTED]=this.startDAIListener.bind(this),this.references[e.AD_BREAK_ENDED]=this.stopDAIListener.bind(this),this.references[e.AD_PROGRESS]=this.progressDAIListener.bind(this),this.references[e.CLICK]=this.clickDAIListener.bind(this),this.references[e.STARTED]=this.joinDAIListener.bind(this),this.references[e.LOADED]=this.loadedDAIListener.bind(this),this.references[e.COMPLETE]=this.completeDAIListener.bind(this),this.references[e.FIRST_QUARTILE]=this.firstQuartileListener.bind(this),this.references[e.MIDPOINT]=this.secondQuartileListener.bind(this),this.references[e.THIRD_QUARTILE]=this.thirdQuartileListener.bind(this),this.references[e.PAUSED]=this.pauseDAIListener.bind(this),this.references[e.RESUMED]=this.resumeDAIListener.bind(this)}if(this.player)for(let e in this.references)this.player.addEventListener(e,this.references[e])}loadedDAIListener(e){if(e.getStreamData){const t=e.getStreamData();t&&(this.resource=t.url)}}stopDAIListener(e){this.fireStop({adPlayhead:this.duration}),this.getVideo().getAdapter()&&this.getVideo().getAdapter().fireResume(),this.fireBreakStop()}getResource(){let e=null;return!this.isDAI&&this.player.getCurrentAd()?e=this.player.getCurrentAd().getMediaUrl():this.isDAI&&(e=this.resource),e}getProvider(){let e=null;return!this.isDAI&&this.player.getCurrentAd()&&(e=this.player.getCurrentAd().getAdSystem(
1)),e}skippedL(){this.fireSkip()}skippedListener(e){this.fireSkip({adPlayhead:this.getPlayhead()})}joinDAIListener(e){const t=e.getAd();t&&(this.duration=t.getDuration(),this.title=t.getTitle(),this.width=t.getVastMediaWidth(),this.height=t.getVastMediaHeight(),this.advertiser=t.getAdvertiserName(),this.adPosition=this.getAdPosition()),this.getVideo().getAdapter()&&this.getVideo().getAdapter().firePause(),this.plugin.fireInit(void 0,"joinDAIListener",this.getVideo().getVideoKey()),this.fireStart(),this.fireJoin()}completeDAIListener(e){this.fireStop({},"completeDAIListener")}getPlayerName(){return"IMA"}getIsVisible(){let e=null;if(this.player){if(!this.contentPlayer)for(const e in this.player){const t=this.player[e];if(t&&t.videoHeight&&t.clientHeight){this.contentPlayer=t;break}}e=this.getNpawUtils().calculateAdViewability(this.contentPlayer)}return e}playingListener(e){this.fireStart({adPlayhead:"0"}),this.fireResume(),this.fireSeekEnd(),this.fireBufferEnd(),this.fireJoin({adPlayhead:"0"})}endedViewListener(e){this.getPosition()===this.getNpawReference().Constants.AdPosition.Postroll&&this.getVideo().getAdapter().fireStop({},"endedViewListener")}getPosition(){let e=null;return this.player&&(e=this.getVideo().getAdapter()&&!this.getVideo().getAdapter().flags.isJoined?this.getNpawReference().Constants.AdPosition.Preroll:this.getIsLive()?this.getNpawReference().Constants.AdPosition.Midroll:this.adPosition||this.getNpawReference().Constants.AdPosition.Midroll),e}errorListener(e){this.fireError(),this.fireStop()}breakEndListener(e){this.fireBreakStop()}getBreaksTime(){let e=null;return this.player&&this.player.getCuePoints&&(e=this.player.getCuePoints(),e.forEach(function(t,i){-1!==e[i]&&null!==e[i]&&void 0!==e[i]||(e[i]=this.plugin._adapter.getDuration())}.bind(this))),e}clickDAIListener(e){this.fireClick(this.clickUrl)}pauseDAIListener(e){this.firePause();var t=this.getVideo().getAdapter();t&&(t.flags.isAdPaused=!0)}resumeDAIListener(e){this.fireResume();var t=this.getVideo().getAdapter();t&&(t.flags.isAdPaused=!1)}},BrightcoveFreewheel:class{isUsed(){return!this.player.ima3&&this.player.ads}getVersion(){return"7.0.4-videojs-bcove-freewheel-ads-jsclass"}getPlayhead(){if(this.player.ads.ad)return this.player.ads.ad.currentTime()}getPosition(){switch(this.player.ads.ad.type){case"PREROLL":return this.getNpawReference().Constants.AdPosition.Preroll;case"POSTROLL":return this.videoEnded=!0,this.getNpawReference().Constants.AdPosition.Postroll}return this.getNpawReference().Constants.AdPosition.Midroll}getResource(){if(this.player.ads.contentSrc)return this.player.ads.contentSrc}getTitle(){if(this.player.ads.ad&&this.player.ads.ad.id)return this.player.ads.ad.id}getDuration(){if(this.player.ads.ad&&this.player.ads.ad.duration)return this.lastDuration=this.player.ads.ad.duration,this.lastDuration}getPlayerName(){return"Freewheel"}getPlayerVersion(){return"undefined"!=typeof tv&&tv.freewheel&&tv.freewheel.SDK?tv.freewheel.SDK.version:this.player.ads.VERSION}registerListeners(){for(var e in this.monitorPlayhead(!0,!1),this.references=[],this.references["ads-ad-started"]=this.adStartListener.bind(this),this.references["ads-ad-ended"]=this.adEndedListener.bind(this),this.references["ads-pause"]=this.adPausedListener.bind(this),this.references["ads-play"]=this.adResumedListener.bind(this),this.references["ads-first-quartile"]=this.firstQuartileListener.bind(this),this.references["ads-midpoint"]=this.secondQuartileListener.bind(this),this.references["ads-third-quartile"]=this.thirdQuartileListener.bind(this),this.references["ads-pod-ended"]=this.adPodEndListener.bind(this),this.references.adserror=this.errorListener.bind(this),this.references)this.player.on(e,this.references[e])}firstQuartileListener(e){this.fireQuartile(1)}secondQuartileListener(e){this.fireQuartile(2)}thirdQuartileListener(e){this.fireQuartile(3)}adPodEndListener(e){this.fireBreakStop()}adStartListener(e){this.fireStart(),this.fireJoin()}adPausedListener(e){this.firePause()}adResumedListener(e){this.fireResume()}adEndedListener(e){this.fireStop({adPlayhead:this.lastDuration}),this.fireStop();const t=this.getVideo().getAdapter();t&&(this.videoEnded?(t.fireStop(),this.videoEnded=null):t.fireResume())}errorListener(e){this.fireError("Ad error")}unregisterListeners(){if(this.monitor&&this.monitor.stop(),this.player&&this.references){for(var e in this.references)this.player.off(e,this.references[e]);this.references=[]}}}}};return t.default})(),e.exports=t()}}]); 2//# sourceMappingURL=sourcemaps/npaw-plugin-adapters-7fa26b2a7d4bb2f7.bundle.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.