bitmovin-player
Version:
The Bitmovin HTML5 Adaptive Streaming Player for MPEG-DASH and HLS
12 lines • 149 kB
JavaScript
/****************************************************************************
* Copyright (C) 2019, Bitmovin, Inc., All Rights Reserved
*
* This source code and its use and distribution, is subject to the terms
* and conditions of the applicable license agreement.
*
* Bitmovin Player Version 8.16.2
*
****************************************************************************/
(function() {
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.analytics=t():(e.bitmovin=e.bitmovin||{},e.bitmovin.player=e.bitmovin.player||{},e.bitmovin.player.analytics=t())}(this,function(){return webpackJsonpbitmovin_player__name_([32],{137:function(e,t,n){!function(t,n){e.exports=n()}(window,function(){return function(e){function t(a){if(n[a])return n[a].exports;var i=n[a]={i:a,l:!1,exports:{}};return e[a].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,a){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:a})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(t.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var i in e)t.d(a,i,function(t){return e[t]}.bind(null,i));return a},t.n=function(e){var n=e&&e.__esModule?function(){return e["default"]}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/Users/tigraine/projects/analytics/collector/build/release",t(t.s=17)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(20);t.validString=function(e){return null!=e&&"string"==typeof e},t.isNullOrEmptyString=function(e){return null==e||"string"!=typeof e||0===e.length},t.validBoolean=function(e){return null!=e&&"boolean"==typeof e},t.validNumber=function(e){return null!=e&&"number"==typeof e},t.sanitizePath=function(e){return e.replace(/\/$/g,"")},t.calculateTimeWithUndefined=function(e){return void 0===e?e:(e*=1e3,Math.round(e))},t.calculateTime=function(e){return e*=1e3,Math.round(e)},t.getCurrentTimestamp=function(){return Date.now()},t.getDurationFromTimestampToNow=function(e){return t.getCurrentTimestamp()-e},t.generateUUID=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},t.getCookie=function(e){for(var t=e+"=",n=0,a=document.cookie.split(";");n<a.length;n++){for(var i=a[n];" "===i.charAt(0);)i=i.substring(1);if(0===i.indexOf(t))return i.substring(t.length,i.length)}return""},t.noOp=function(){},t.getCustomDataString=function(e){return"object"==typeof e?JSON.stringify(e):"function"==typeof e?t.getCustomDataString(e()):void 0===e?e:"string"!=typeof e?String(e):e},t.getDocumentPropWithPrefix=function(e){if(e in document)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=0,a=["webkit","moz","ms","o"];n<a.length;n++){var i=a[n];if(i+t in document)return i+t}},t.isVideoInFullscreen=function(){var e=t.getDocumentPropWithPrefix("fullscreenElement");return void 0!==e&&document[e]&&"VIDEO"===document[e].nodeName},t.getHiddenProp=function(){return t.getDocumentPropWithPrefix("hidden")},t.getPageLoadType=function(){return!0===document[t.getHiddenProp()]?a.PAGE_LOAD_TYPE.BACKGROUND:a.PAGE_LOAD_TYPE.FOREGROUND},t.getHostnameAndPathFromUrl=function(e){var t=document.createElement("a");return t.href=e,{hostname:t.hostname,path:t.pathname}},t.calculatePercentage=function(e,t){if(void 0!==t&&0!==t)return Math.round((e||0)/t*100)},t.getBrowserInfo=function(){var e,t=navigator.userAgent,n=t.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/trident/i.test(n[1])?{name:"IE",version:(e=/\brv[ :]+(\d+)/g.exec(t)||[])[1]||""}:"Chrome"===n[1]&&null!=(e=t.match(/\b(OPR|Edge)\/(\d+)/))?{name:e[1].replace("OPR","Opera"),version:e[2]}:(n=n[2]?[n[1],n[2]]:[navigator.appName,navigator.appVersion,"-?"],null!=(e=t.match(/version\/(\d+)/i))&&n.splice(1,1,e[1]),{name:n[0],version:n[1]})},t.getURLResourceName=function(e){return 0===e.length?"":e.split("/").pop()||""},t.joinUrls=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return e.reduce(function(e,n){return(t.endsWith(e,"/")&&void 0!==n?e.substr(0,e.length-1):e)+"/"+(t.startsWith(n,"/")?n.substr(1):n)})},t.endsWith=function(e,t){return String.prototype.endsWith?e.endsWith(t):e.substring(e.length-t.length)===t},t.startsWith=function(e,t){return String.prototype.startsWith?e.startsWith(t):e.substring(0,t.length)===t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e){void 0===e&&(e=!1),this.showLogs=e}return e.prototype.setLogging=function(e){this.showLogs=e},e.prototype.isLogging=function(){return this.showLogs},e.prototype.log=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.showLogs&&console.log.apply(console,[e].concat(t))},e.prototype.logTable=function(e){console.table(e)},e.prototype.errorMessageToUser=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];console.error.apply(console,[e].concat(t))},e.prototype.error=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.showLogs&&console.error.apply(console,[e].concat(t))},e.prototype.warning=function(e){this.showLogs&&console.warn(e)},e.prototype.warningMessageToUser=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];console.warn.apply(console,[e].concat(t))},e}();t.padRight=function(e,t){return(e+new Array(t).join(" ")).slice(0,t)},t.logger=new a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BITMOVIN="bitmovin",e.JW="jw",e.RADIANT="radiant",e.VIDEOJS="videojs",e.HLSJS="hlsjs",e.SHAKA="shaka",e.DASHJS="dashjs",e.HTML5="html5"}(t.Player||(t.Player={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.READY="ready",e.SOURCE_LOADED="sourceLoaded",e.PLAY="play",e.PLAYING="playing",e.PAUSE="pause",e.TIMECHANGED="timechanged",e.SEEK="seek",e.SEEKED="seeked",e.START_CAST="startCasting",e.END_CAST="endCasting",e.START_BUFFERING="startBuffering",e.END_BUFFERING="endBuffering",e.AUDIOTRACK_CHANGED="audioTrackChanged",e.AUDIO_CHANGE="audioChange",e.VIDEO_CHANGE="videoChange",e.START_FULLSCREEN="startFullscreen",e.END_FULLSCREEN="endFullscreen",e.START_AD="adStart",e.SUBTITLE_CHANGE="subtitleChange",e.END_AD="adEnd",e.MUTE="mute",e.UN_MUTE="unMute",e.ERROR="playerError",e.PLAYBACK_FINISHED="end",e.SCREEN_RESIZE="resize",e.UNLOAD="unload",e.END="end",e.METADATA_LOADED="metadataLoaded",e.SOURCE_UNLOADED="sourceUnloaded",e.MANUAL_SOURCE_CHANGE="manualSourceChangeInitiated"}(t.Event||(t.Event={}))},function(e,t,n){"use strict";var a=this&&this.__assign||function(){return(a=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(1),s=n(7),o=n(21),E=n(11),l=n(32),c=n(37),u=n(38),d=function(){function e(e,t,n){var s=this;this.pageLoadTime=0,this.playerStartupTime=0,this.autoplay=void 0,this.droppedSampleFrames=0,this.backendFactory=new o.BackendFactory,this.setCustomDataOnce=function(e){var t=s.config;s.setCustomData(e),s.setCustomData(t)},this.guardAgainstMissingVideoTitle=function(e,t){e&&t&&e.title&&!t.title&&r.logger.error("The new analytics configuration does not contain the field title")},this.sourceChange=function(e){r.logger.log("Processing Source Change for Analytics",e),s.guardAgainstMissingVideoTitle(s.config,e);var t=(s.config||{}).config;null!=e&&(t=a({},t,{enabled:!0},e.config));var n=a({},s.config,e,{config:t});s.adapter.sourceChange(n,i.getCurrentTimestamp())},this.setCustomData=function(e){var t,n,i,r,o,E,l,c;s.sendAnalyticsRequestAndClearValues(),s.config=a({},s.config,(n=(t=e).customData1,i=t.customData2,r=t.customData3,o=t.customData4,E=t.customData5,l=t.experimentName,c={customData1:n,customData2:i,customData3:r,customData4:o,customData5:E,experimentName:l},n&&(c.customData1=n),i&&(c.customData2=i),r&&(c.customData3=r),o&&(c.customData4=o),E&&(c.customData5=E),l&&(c.experimentName=l),c)),s.setConfigParameters()},this.getCurrentImpressionId=function(){return s.sample.impressionId},this.config=e,this.adapter=n,this.sessionHandler=new u.SessionPersistenceHandler(e);var E=this.adapter.onLicenseKeyReceived.subscribe(function(e){s.config.key||(s.config.key=e.licenseKey),E()});this.adapter.adModule&&new l.AdAnalytics(this,this.adapter.adModule),this.startupTime=0,this.sample=this.setupSample(),this.init(),this.setupStateMachineCallbacks(),this.adapter.initialize&&this.adapter.initialize()}return Object.defineProperty(e.prototype,"version",{get:function(){return E.VERSION},enumerable:!0,configurable:!0}),e.prototype.getPlayerInformationFromAdapter=function(){var e=this.config.player||this.adapter.getPlayerName();return{player:e,version:e+"-"+this.adapter.getPlayerVersion(),playerTech:this.adapter.getPlayerTech()}},e.prototype.updateSamplesToCastClientConfig=function(e,t){for(var n=0,a=e;n<a.length;n++){var i=a[n];this.updateSampleToCastClientConfig(i,t)}},e.prototype.updateSampleToCastClientConfig=function(e,t){var n=t.config,a=t.userId,i=t.impressionId,r=t.domain,s=t.path,o=t.language,E=t.userAgent;e.impressionId=i,e.userId=a,e.userAgent=E,e.domain=r,e.path=s,e.language=o,this.setConfigParameters(e,n)},e.prototype.init=function(){!0===this.adapter.supportsDeferredLicenseLoading||""!==this.config.key&&i.validString(this.config.key)?(r.logger.setLogging(this.config.debug||!1),this.backend=this.createBackend(this.config),this.setConfigParameters(),this.generateNewImpressionId(),this.setUserId()):r.logger.error("Invalid analytics license key provided")},e.prototype.setConfigParameters=function(e,t){void 0===e&&(e=this.sample),void 0===t&&(t=this.config),e.key=t.key,e.playerKey=t.playerKey,t.player&&(e.player=t.player),e.domain=this.getDomainFromConfig(t)||i.sanitizePath(window.location.hostname),e.cdnProvider=t.cdnProvider,e.videoId=t.videoId,e.videoTitle=t.title,e.customUserId=t.userId,e.customData1=i.getCustomDataString(t.customData1),e.customData2=i.getCustomDataString(t.customData2),e.customData3=i.getCustomDataString(t.customData3),e.customData4=i.getCustomDataString(t.customData4),e.customData5=i.getCustomDataString(t.customData5),e.experimentName=t.experimentName},e.prototype.generateNewImpressionId=function(){this.sample.impressionId=i.generateUUID()},e.prototype.setUserId=function(){this.sample.userId=this.sessionHandler.userId},e.prototype.setupStateMachineCallbacks=function(){var e=this;this.adapter.stateMachineCallbacks.setup=function(t,n,a){if(r.logger.log("Setup bitmovin analytics "+e.sample.analyticsVersion+" with impressionId: "+e.sample.impressionId),e.setDuration(t),e.setState(n),e.playerStartupTime=e.sample.playerStartupTime=t,window.performance&&window.performance.timing){var s=i.getCurrentTimestamp()-window.performance.timing.navigationStart;e.pageLoadTime=e.sample.pageLoadTime=s}e.startupTime=t,e.sendAnalyticsRequestAndClearValues(),e.sample.pageLoadTime=0},this.adapter.stateMachineCallbacks.startup=function(t,n){e.setDuration(t),e.sample.videoStartupTime=t,e.sample.supportedVideoCodecs=c.CodecHelper.supportedVideoFormats,e.setState(n),e.startupTime>0&&(e.startupTime+=t),e.sample.startupTime=e.startupTime,e.autoplay=e.sample.autoplay=e.adapter.getAutoPlay();var a=e.adapter.drmPerformanceInfo;a.drmUsed&&(e.sample.drmType=a.drmInfo,e.sample.drmLoadTime=a.drmTime),e.sendAnalyticsRequestAndClearValues(),e.sample.autoplay=void 0},this.adapter.stateMachineCallbacks.playing=function(t,n,a){e.setDuration(t),e.setState(n),e.sample.played=t,e.sendAnalyticsRequestAndClearValues()},this.adapter.stateMachineCallbacks.playingAndBye=function(t,n,a){e.setDuration(t),e.setState(n),e.sample.played=t,e.sendUnloadRequest()},this.adapter.stateMachineCallbacks.heartbeat=function(t,n,a){e.setState(n),e.setDuration(t),e.sample.played=e.sample.duration,e.sendAnalyticsRequestAndClearValues()},this.adapter.stateMachineCallbacks.qualitychange=function(t,n){e.setDuration(t),e.setState(n),e.sendAnalyticsRequestAndClearValues()},this.adapter.stateMachineCallbacks.qualitychange_pause=function(t,n){e.setDuration(t),e.setState(n),e.sendAnalyticsRequestAndClearValues()},this.adapter.stateMachineCallbacks.qualitychange_rebuffering=function(t,n){e.setDuration(t),e.setState(n),e.sendAnalyticsRequestAndClearValues()},this.adapter.stateMachineCallbacks.videoChange=function(t){e.adapter.stateMachineCallbacks.setVideoTimeEndFromEvent(t),e.adapter.stateMachineCallbacks.setVideoTimeStartFromEvent(t),e.setPlaybackVideoPropertiesFromEvent(t)},this.adapter.stateMachineCallbacks.audioChange=function(t){e.adapter.stateMachineCallbacks.setVideoTimeEndFromEvent(t),e.adapter.stateMachineCallbacks.setVideoTimeStartFromEvent(t),e.setPlaybackAudioPropertiesFromEvent(t)},this.adapter.stateMachineCallbacks.audiotrack_changing=function(){e.sendAnalyticsRequestAndClearValues()},this.adapter.stateMachineCallbacks.pause=function(t,n,a){e.setDuration(t),e.setState(n),e.sample.paused=t,e.sendAnalyticsRequestAndClearValues()},this.adapter.stateMachineCallbacks.paused_seeking=function(t,n,a){e.setDuration(t),e.setState(n),e.sample.seeked=t,e.sendAnalyticsRequestAndClearValues()},this.adapter.stateMachineCallbacks.end_play_seeking=function(t,n,a){e.setState(n),e.setDuration(t),e.sample.seeked=t,e.sendAnalyticsRequestAndClearValues()},this.adapter.stateMachineCallbacks.rebuffering=function(t,n,a){e.setDuration(t),e.setState(n),e.sample.buffered=t,e.sendAnalyticsRequestAndClearValues()},this.adapter.stateMachineCallbacks.error=function(t){e.adapter.stateMachineCallbacks.setVideoTimeEndFromEvent(t),e.adapter.stateMachineCallbacks.setVideoTimeStartFromEvent(t),e.setState("error"),e.sample.errorCode=t.code,e.sample.errorMessage=t.message,e.sample.errorData=JSON.stringify(t.data);var n=e.adapter.segments.map(function(e){return e.name});e.sample.errorSegments=n,e.adapter.onError&&e.adapter.onError(),e.sendAnalyticsRequestAndClearValues(),delete e.sample.errorCode,delete e.sample.errorMessage,delete e.sample.errorData},this.adapter.stateMachineCallbacks.ad=function(t,n,a){e.setDuration(t),e.setState(n),e.sample.ad=t,e.sendAnalyticsRequestAndClearValues()},this.adapter.stateMachineCallbacks.mute=function(){e.sample.isMuted=!0},this.adapter.stateMachineCallbacks.unMute=function(){e.sample.isMuted=!1},this.adapter.stateMachineCallbacks.subtitle_changing=function(){e.sendAnalyticsRequestAndClearValues()},this.adapter.stateMachineCallbacks.setVideoTimeEndFromEvent=function(t){i.validNumber(t.currentTime)&&(e.sample.videoTimeEnd=i.calculateTime(t.currentTime))},this.adapter.stateMachineCallbacks.setVideoTimeStartFromEvent=function(t){i.validNumber(t.currentTime)&&(e.sample.videoTimeStart=i.calculateTime(t.currentTime))},this.adapter.stateMachineCallbacks.manualSourceChange=function(t){e.sample=e.setupSample(),e.startupTime=0,e.config=t.config,e.init()},this.adapter.stateMachineCallbacks.initialSourceChange=function(t){e.config=t.config,e.setConfigParameters()},this.adapter.stateMachineCallbacks.end=function(t,n,a){e.sample=e.setupSample(),e.startupTime=0,e.init()}},e.prototype.setDuration=function(e){this.sample.duration=e},e.prototype.setState=function(e){this.sample.state=e},e.prototype.setPlaybackVideoPropertiesFromEvent=function(e){i.validNumber(e.width)&&(this.sample.videoPlaybackWidth=e.width),i.validNumber(e.height)&&(this.sample.videoPlaybackHeight=e.height),i.validNumber(e.bitrate)&&(this.sample.videoBitrate=e.bitrate),i.validString(e.codec)&&(this.sample.videoCodec=e.codec)},e.prototype.setPlaybackAudioPropertiesFromEvent=function(e){i.validNumber(e.bitrate)&&(this.sample.audioBitrate=e.bitrate),i.validString(e.codec)&&(this.sample.audioCodec=e.codec)},e.prototype.setPlaybackInfoFromAdapter=function(){var e=this.adapter.getCurrentPlaybackInfo();e&&(i.validBoolean(e.isLive)&&(this.sample.isLive=e.isLive),i.validString(e.size)&&(this.sample.size=e.size),i.validString(e.playerTech)&&(this.sample.playerTech=e.playerTech),i.validNumber(e.videoDuration)&&(this.sample.videoDuration=i.calculateTime(e.videoDuration||0)),i.validString(e.streamFormat)&&(this.sample.streamFormat=e.streamFormat),i.validString(e.mpdUrl)&&(this.sample.mpdUrl=e.mpdUrl),i.validString(e.m3u8Url)&&(this.sample.m3u8Url=e.m3u8Url),i.validString(e.progUrl)&&(this.sample.progUrl=e.progUrl),i.validNumber(e.videoWindowWidth)&&(this.sample.videoWindowWidth=e.videoWindowWidth),i.validNumber(e.videoWindowHeight)&&(this.sample.videoWindowHeight=e.videoWindowHeight),i.validNumber(e.screenHeight)&&(this.sample.screenHeight=e.screenHeight),i.validNumber(e.screenWidth)&&(this.sample.screenWidth=e.screenWidth),i.validNumber(e.videoPlaybackHeight)&&(this.sample.videoPlaybackHeight=e.videoPlaybackHeight),i.validNumber(e.videoPlaybackWidth)&&(this.sample.videoPlaybackWidth=e.videoPlaybackWidth),i.validNumber(e.videoBitrate)&&(this.sample.videoBitrate=e.videoBitrate),i.validNumber(e.audioBitrate)&&(this.sample.audioBitrate=e.audioBitrate),i.validBoolean(e.isMuted)&&(this.sample.isMuted=e.isMuted),i.validBoolean(e.isCasting)&&(this.sample.isCasting=e.isCasting),i.validString(e.videoTitle)&&!this.config.title&&(this.sample.videoTitle=e.videoTitle),i.validString(e.audioCodec)&&(this.sample.audioCodec=e.audioCodec),i.validString(e.videoCodec)&&(this.sample.videoCodec=e.videoCodec),i.validString(e.audioLanguage)&&(this.sample.audioLanguage=e.audioLanguage),i.validBoolean(e.subtitleEnabled)&&(this.sample.subtitleEnabled=e.subtitleEnabled),i.validString(e.subtitleLanguage)?this.sample.subtitleLanguage=e.subtitleLanguage:this.sample.subtitleLanguage=void 0,i.validNumber(e.droppedFrames)&&(this.droppedSampleFrames=this.sample.droppedFrames=e.droppedFrames<this.droppedSampleFrames?e.droppedFrames:e.droppedFrames-this.droppedSampleFrames))},e.prototype.setupSample=function(){return a({platform:"web",playerStartupTime:0,pageLoadType:i.getPageLoadType(),path:i.sanitizePath(window.location.pathname),language:navigator.language||navigator.userLanguage,userAgent:navigator.userAgent,screenWidth:screen.width,screenHeight:screen.height,isLive:!1,videoDuration:0,size:s.PlayerSize.Window,time:0,videoWindowWidth:0,videoWindowHeight:0,droppedFrames:0,played:0,buffered:0,paused:0,ad:0,seeked:0,videoPlaybackWidth:0,videoPlaybackHeight:0,videoBitrate:0,audioBitrate:0,videoTimeStart:0,videoTimeEnd:0,videoStartupTime:0,duration:0,startupTime:0,analyticsVersion:E.VERSION,pageLoadTime:0},this.getPlayerInformationFromAdapter())},e.prototype.sendAnalyticsRequest=function(){this.setPlaybackInfoFromAdapter(),this.sample.time=i.getCurrentTimestamp(),this.sample.downloadSpeedInfo=this.adapter.downloadSpeedInfo;var e=a({},this.sample);this.backend.sendRequest(e)},e.prototype.sendAnalyticsRequestAndClearValues=function(){this.sendAnalyticsRequest(),this.clearValues()},e.prototype.sendUnloadRequest=function(){this.backend.sendUnloadRequest(this.sample)},e.prototype.sendAnalyticsRequestSynchronous=function(){this.backend.sendRequestSynchronous(this.sample)},e.prototype.clearValues=function(){this.sample.ad=0,this.sample.paused=0,this.sample.played=0,this.sample.seeked=0,this.sample.buffered=0,this.sample.playerStartupTime=0,this.sample.videoStartupTime=0,this.sample.startupTime=0,this.sample.duration=0,this.sample.droppedFrames=0,this.sample.drmType=void 0,this.sample.drmLoadTime=void 0,this.adapter.clearValues()},e.prototype.getDomainFromConfig=function(e){var t=e.config;return null!=t&&null!=t.origin?t.origin:void 0},e.prototype.createBackend=function(e){var t=this.getDomainFromConfig(e)||i.sanitizePath(window.location.hostname);return this.backendFactory.createBackend(e,{key:e.key,domain:t,version:E.VERSION},this.adapter)},e.version=E.VERSION,e.LICENSE_CALL_PENDING_TIMEOUT=200,e.PAGE_LOAD_TYPE_TIMEOUT=200,e.CAST_RECEIVER_CONFIG_MESSAGE="CAST_RECEIVER_CONFIG_MESSAGE",e}();t.Analytics=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(1),i=function(){function e(){}return e.prototype.getCurrentImpressionId=function(){if(this.guardAgainstNotInitializedAnalytics())return this.analytics.getCurrentImpressionId()},e.prototype.setCustomData=function(e){this.guardAgainstNotInitializedAnalytics()&&this.analytics.setCustomData(e)},e.prototype.setCustomDataOnce=function(e){this.guardAgainstNotInitializedAnalytics()&&this.analytics.setCustomDataOnce(e)},e.prototype.sourceChange=function(e){this.guardAgainstNotInitializedAnalytics()&&this.analytics.sourceChange(e)},e.prototype.guardAgainstNotInitializedAnalytics=function(){return!!this.analytics||(a.logger.log("Bitmovin Analytics: Adapter hasn't been initialized yet"),!1)},e}();t.Adapter=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),i="video/mp4",r="video/webm",s="application/x-mpegURL",o="application/dash+xml";t.MIMETypes={MP4:i,WEBM:r,HLS:s,DASH:o},t.getMIMETypeFromFileExtension=function(e){return e=e.toLowerCase(),a.endsWith(e,".m3u8")?s:a.endsWith(e,".mp4")||a.endsWith(e,".m4v")||a.endsWith(e,".m4a")?i:a.endsWith(e,".webm")?r:a.endsWith(e,".mpd")?o:void 0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Window="WINDOW",e.Fullscreen="FULLSCREEN"}(t.PlayerSize||(t.PlayerSize={}))},function(e,t,n){"use strict";var a,i=this&&this.__extends||(a=function(e,t){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var s=n(9),o=n(41),E=n(2),l=n(3),c=n(14),u=n(6),d=n(7),m=n(0),A=function(e){function t(t,n){var a=e.call(this,n)||this;return a.mediaElement=t,a._drmPerformanceInfo={drmUsed:!1},a.getPlayerName=function(){return E.Player.HTML5},a.getPlayerTech=function(){return"html5"},a.getAutoPlay=function(){return!!a.mediaElement&&a.mediaElement.autoplay},a.isLive=function(){return!!a.mediaElement&&a.mediaElement.duration===1/0},a.stateMachine=new o.HTML5AnalyticsStateMachine(a.stateMachineCallbacks,a.opts),a.mediaElEventHandlers=[],a.analyticsBitrate=-1,a.bufferingTimeout=void 0,a.isBuffering=!1,a.lastIsLiveStatus=!1,a.isPaused=!1,a.previousMediaTime=0,a.needsReadyEvent=!0,a.needsFirstPlayIntent=!0,a.mediaElementSet=!1,a}return i(t,e),Object.defineProperty(t.prototype,"drmPerformanceInfo",{get:function(){return this._drmPerformanceInfo},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"segments",{get:function(){return[]},enumerable:!0,configurable:!0}),t.prototype.initialize=function(){this.mediaElement&&this.setMediaElement()},t.prototype.getStreamSources=function(e){if(!e)return{};switch(this.getStreamType()){case"hls":return{m3u8Url:e};case"dash":return{mpdUrl:e};default:return{progUrl:e}}},t.prototype.getCurrentPlaybackInfo=function(){var e=r({},this.getCommonPlaybackInfo(),this.getStreamSources(this.getStreamURL()),{streamFormat:this.getStreamType(),isLive:this.isLive(),size:m.isVideoInFullscreen()?d.PlayerSize.Fullscreen:d.PlayerSize.Window,playerTech:this.getPlayerTech(),droppedFrames:0});this.mediaElement&&(e=r({},e,{videoDuration:this.mediaElement.duration,isMuted:this.mediaElement.muted,videoWindowHeight:this.mediaElement.height,videoWindowWidth:this.mediaElement.width}));var t=this.getCurrentQualityLevelInfo();return t&&(e=r({},e,{videoPlaybackHeight:t.height,videoPlaybackWidth:t.width,videoBitrate:t.bitrate})),e},t.prototype.setMediaElement=function(e){if(void 0===e&&(e=null),e&&this.mediaElement&&(this.unregisterMediaElement(),this.mediaElementSet=!1),e&&(this.mediaElement=e),!this.mediaElement)throw new Error("No media element owned");if(this.mediaElementSet)throw new Error("Media element already set (only call this once)");this.mediaElementSet=!0,this.registerMediaElement(),this.onMaybeReady()},t.prototype.getMIMEType=function(){var e=this.getStreamURL();if(e&&void 0!==e)return u.getMIMETypeFromFileExtension(e)},t.prototype.getStreamType=function(){var e=this.getMIMEType();if(e)return c.getStreamTypeFromMIMEType(e)},t.prototype.getStreamURL=function(){var e=this.mediaElement;if(e)return e.src},t.prototype.resetMedia=function(){this.mediaElement=null,this.mediaElEventHandlers=[],window.clearTimeout(this.bufferingTimeout)},t.prototype.registerMediaElement=function(){var e=this,t=this.mediaElement;t&&(this.listenToMediaElementEvent("loadedmetadata",function(){1===t.readyState&&(e.checkQualityLevelAttributes(!0),e.eventCallback(l.Event.METADATA_LOADED,null))}),this.listenToMediaElementEvent("play",function(){var n=t.currentTime;e.needsFirstPlayIntent=!1,e.eventCallback(l.Event.PLAY,{currentTime:n})}),this.listenToMediaElementEvent("pause",function(){e.onPaused()}),this.listenToMediaElementEvent("playing",function(){var n=t.currentTime;e.isPaused=!1,e.needsFirstPlayIntent||e.eventCallback(l.Event.TIMECHANGED,{currentTime:n})}),this.listenToMediaElementEvent("error",function(){var n=t.currentTime,a=t.error;e.eventCallback(l.Event.ERROR,{currentTime:n,code:a?a.code:null,message:a?a.message:null})}),this.listenToMediaElementEvent("volumechange",function(){var n=t.muted,a=t.currentTime;n?e.eventCallback(l.Event.MUTE,{currentTime:a}):e.eventCallback(l.Event.UN_MUTE,{currentTime:a})}),this.listenToMediaElementEvent("seeking",function(){var n=t.currentTime;e.eventCallback(l.Event.SEEK,{currentTime:n})}),this.listenToMediaElementEvent("seeked",function(){var n=t.currentTime;clearTimeout(e.bufferingTimeout),e.eventCallback(l.Event.SEEKED,{currentTime:n})}),this.listenToMediaElementEvent("timeupdate",function(){var n=t.currentTime;e.isBuffering=!1,e.needsFirstPlayIntent||(e.isPaused||e.eventCallback(l.Event.TIMECHANGED,{currentTime:n}),e.checkQualityLevelAttributes(),e.checkPlayheadProgress(),e.previousMediaTime=n)}),this.listenToMediaElementEvent("stalled",function(){}),this.listenToMediaElementEvent("waiting",function(){e.onBuffering()}))},t.prototype.listenToMediaElementEvent=function(e,t){if(!this.mediaElement)throw new Error("No media attached");var n=t.bind(this);this.mediaElEventHandlers.push({event:e,handler:n}),this.mediaElement.addEventListener(e,n,!1)},t.prototype.onMaybeReady=function(){if(this.needsReadyEvent&&this.mediaElement){this.needsReadyEvent=!1;var e=this.getCurrentPlaybackInfo();this.stateMachine.updateMetadata(),this.eventCallback(l.Event.READY,e)}},t.prototype.unregisterMediaElement=function(){if(!this.mediaElement)throw new Error("No media attached");var e=this.mediaElement;this.mediaElEventHandlers.forEach(function(t){e.removeEventListener(t.event,t.handler)}),this.resetMedia()},t.prototype.onBuffering=function(){if(!this.mediaElement)throw new Error("No media attached");var e=this.mediaElement.currentTime;this.isBuffering||this.isPaused||(this.eventCallback(l.Event.START_BUFFERING,{currentTime:e}),this.isBuffering=!0)},t.prototype.onPaused=function(){if(!this.isPaused){if(!this.mediaElement)throw new Error("No media attached");var e=this.mediaElement.currentTime;this.eventCallback(l.Event.PAUSE,{currentTime:e}),this.isPaused=!0}},t.prototype.checkPlayheadProgress=function(){var e=this;if(!this.mediaElement)throw new Error("No media attached");var n=this.mediaElement;n.paused&&this.onPaused(),clearTimeout(this.bufferingTimeout),this.bufferingTimeout=window.setTimeout(function(){n.paused||n.ended&&!e.isBuffering||n.currentTime-e.previousMediaTime<t.BUFFERING_TIMECHANGED_TIMEOUT&&e.onBuffering()},t.BUFFERING_TIMECHANGED_TIMEOUT)},t.prototype.checkQualityLevelAttributes=function(e){if(void 0===e&&(e=!1),!this.mediaElement)throw new Error("No media attached");var t=this.mediaElement,n=this.getCurrentQualityLevelInfo();if(n){var a=n.bitrate,i=n.width,r=n.height,s=this.isLive();if(s!==this.lastIsLiveStatus&&(this.lastIsLiveStatus=s,e||this.stateMachine.updateMetadata()),this.analyticsBitrate!==a){var o={width:i,height:r,bitrate:a,currentTime:t.currentTime};e||this.eventCallback(l.Event.VIDEO_CHANGE,o),this.analyticsBitrate=a}}},t.prototype.sourceChange=function(e,t){this.stateMachine.sourceChange(e,t,this.mediaElement?this.mediaElement.currentTime:void 0)},t.BUFFERING_TIMECHANGED_TIMEOUT=1e3,t}(s.InternalAdapter);t.HTML5InternalAdapter=A},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),i=n(1),r=n(40),s=function(){function e(e){var t=this;this.stateMachineCallbacks={setup:function(e,t,n){},startup:function(e,t){},updateSample:function(){},playing:function(e,t,n){},playingAndBye:function(e,t,n){},heartbeat:function(e,t,n){},qualitychange:function(e,t){},qualitychange_pause:function(e,t){},qualitychange_rebuffering:function(e,t){},videoChange:function(e){},audioChange:function(e){},audiotrack_changing:function(){},pause:function(e,t,n){},paused_seeking:function(e,t,n){},end_play_seeking:function(e,t,n){},rebuffering:function(e,t,n){},error:function(e){},end:function(e,t,n){},ad:function(e,t,n){},mute:function(){},unMute:function(){},subtitle_changing:function(){},setVideoTimeEndFromEvent:function(e){},setVideoTimeStartFromEvent:function(e){},source_changing:function(e,t,n){},ready:function(e,t,n){},startCasting:function(e,t){},manualSourceChange:function(e){},initialSourceChange:function(e){},muting_ready:function(e,t,n){}},this._onLicenseKeyReceived=new r.EventDispatcher,this._onLicenseCallFailed=new r.EventDispatcher,this.eventCallback=function(e,n){n=n||{},t.stateMachine?t.stateMachine.callEvent(e,n,a.getCurrentTimestamp()):i.logger.log("Bitmovin Analytics: StateMachine isn't ready yet")},e||(e={starttime:void 0}),e.starttime||(e.starttime=a.getCurrentTimestamp()),this.opts=e}return Object.defineProperty(e.prototype,"onLicenseKeyReceived",{get:function(){return this._onLicenseKeyReceived},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onLicenseCallFailed",{get:function(){return this._onLicenseCallFailed},enumerable:!0,configurable:!0}),e.prototype.getCommonPlaybackInfo=function(){return{screenHeight:screen.height,screenWidth:screen.width}},e.prototype.clearValues=function(){},e.prototype.clearSegments=function(){},Object.defineProperty(e.prototype,"downloadSpeedInfo",{get:function(){return{segmentsDownloadCount:0,segmentsDownloadSize:0,segmentsDownloadTime:0,avgDownloadSpeed:0,minDownloadSpeed:0,maxDownloadSpeed:0,avgTimeToFirstByte:0}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"segments",{get:function(){return[]},enumerable:!0,configurable:!0}),e}();t.InternalAdapter=s},function(e,t,n){var a;a={VERSION:"2.4.0",Result:{SUCCEEDED:1,NOTRANSITION:2,CANCELLED:3,PENDING:4},Error:{INVALID_TRANSITION:100,PENDING_TRANSITION:200,INVALID_CALLBACK:300},WILDCARD:"*",ASYNC:"async",create:function(e,t){var n="string"==typeof e.initial?{state:e.initial}:e.initial,i=e.terminal||e["final"],r=t||e.target||{},s=e.events||[],o=e.callbacks||{},E={},l={},c=function(e){var t=Array.isArray(e.from)?e.from:e.from?[e.from]:[a.WILDCARD];E[e.name]=E[e.name]||{};for(var n=0;n<t.length;n++)l[t[n]]=l[t[n]]||[],l[t[n]].push(e.name),E[e.name][t[n]]=e.to||t[n];e.to&&(l[e.to]=l[e.to]||[])};n&&(n.event=n.event||"startup",c({name:n.event,from:"none",to:n.state}));for(var u=0;u<s.length;u++)c(s[u]);for(var d in E)E.hasOwnProperty(d)&&(r[d]=a.buildEvent(d,E[d]));for(var d in o)o.hasOwnProperty(d)&&(r[d]=o[d]);return r.current="none",r.is=function(e){return Array.isArray(e)?e.indexOf(this.current)>=0:this.current===e},r.can=function(e){return!this.transition&&void 0!==E[e]&&(E[e].hasOwnProperty(this.current)||E[e].hasOwnProperty(a.WILDCARD))},r.cannot=function(e){return!this.can(e)},r.transitions=function(){return(l[this.current]||[]).concat(l[a.WILDCARD]||[])},r.isFinished=function(){return this.is(i);
},r.error=e.error||function(e,t,n,a,i,r,s){throw s||r},r.states=function(){return Object.keys(l).sort()},n&&!n.defer&&r[n.event](),r},doCallback:function(e,t,n,i,r,s){if(t)try{return t.apply(e,[n,i,r].concat(s))}catch(t){return e.error(n,i,r,s,a.Error.INVALID_CALLBACK,"an exception occurred in a caller-provided callback function",t)}},beforeAnyEvent:function(e,t,n,i,r){return a.doCallback(e,e.onbeforeevent,t,n,i,r)},afterAnyEvent:function(e,t,n,i,r){return a.doCallback(e,e.onafterevent||e.onevent,t,n,i,r)},leaveAnyState:function(e,t,n,i,r){return a.doCallback(e,e.onleavestate,t,n,i,r)},enterAnyState:function(e,t,n,i,r){return a.doCallback(e,e.onenterstate||e.onstate,t,n,i,r)},changeState:function(e,t,n,i,r){return a.doCallback(e,e.onchangestate,t,n,i,r)},beforeThisEvent:function(e,t,n,i,r){return a.doCallback(e,e["onbefore"+t],t,n,i,r)},afterThisEvent:function(e,t,n,i,r){return a.doCallback(e,e["onafter"+t]||e["on"+t],t,n,i,r)},leaveThisState:function(e,t,n,i,r){return a.doCallback(e,e["onleave"+n],t,n,i,r)},enterThisState:function(e,t,n,i,r){return a.doCallback(e,e["onenter"+i]||e["on"+i],t,n,i,r)},beforeEvent:function(e,t,n,i,r){if(!1===a.beforeThisEvent(e,t,n,i,r)||!1===a.beforeAnyEvent(e,t,n,i,r))return!1},afterEvent:function(e,t,n,i,r){a.afterThisEvent(e,t,n,i,r),a.afterAnyEvent(e,t,n,i,r)},leaveState:function(e,t,n,i,r){var s=a.leaveThisState(e,t,n,i,r),o=a.leaveAnyState(e,t,n,i,r);return!1!==s&&!1!==o&&(a.ASYNC===s||a.ASYNC===o?a.ASYNC:void 0)},enterState:function(e,t,n,i,r){a.enterThisState(e,t,n,i,r),a.enterAnyState(e,t,n,i,r)},buildEvent:function(e,t){return function(){var n=this.current,i=t[n]||(t[a.WILDCARD]!=a.WILDCARD?t[a.WILDCARD]:n)||n,r=Array.prototype.slice.call(arguments);if(this.transition)return this.error(e,n,i,r,a.Error.PENDING_TRANSITION,"event "+e+" inappropriate because previous transition did not complete");if(this.cannot(e))return this.error(e,n,i,r,a.Error.INVALID_TRANSITION,"event "+e+" inappropriate in current state "+this.current);if(!1===a.beforeEvent(this,e,n,i,r))return a.Result.CANCELLED;if(n===i)return a.afterEvent(this,e,n,i,r),a.Result.NOTRANSITION;var s=this;this.transition=function(){return s.transition=null,s.current=i,a.enterState(s,e,n,i,r),a.changeState(s,e,n,i,r),a.afterEvent(s,e,n,i,r),a.Result.SUCCEEDED},this.transition.cancel=function(){s.transition=null,a.afterEvent(s,e,n,i,r)};var o=a.leaveState(this,e,n,i,r);return!1===o?(this.transition=null,a.Result.CANCELLED):a.ASYNC===o?a.Result.PENDING:this.transition?this.transition():void 0}}},e.exports&&(t=e.exports=a),t.StateMachine=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION="v2.5.2"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(1);t.post=function(e,t,n,i){var r;void 0===i&&(i=!0);var s=!1;window.XDomainRequest&&(s=!0),r=s?new window.XDomainRequest:new XMLHttpRequest;var o=function(){if(r.readyState==XMLHttpRequest.DONE){if(r.responseText<=0)return;var e=JSON.parse(r.responseText);n(e)}};s?r.onload=o:r.onreadystatechange=o;try{r.open("POST",e,i),s||r.setRequestHeader("Content-Type","text/plain"),r.send(JSON.stringify(t))}catch(e){a.logger.error("Failed to send POST request.",e)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MESSAGE_NAMESPACE="urn:x-cast:com.bitmovin.analytics.cast",t.ANALYTICS_BACKEND_BASE_URL="https://analytics-ingress-global.bitmovin.com",t.ANALYTICS_LICENSECALL_TIMEOUT=6e4},function(e,t,n){"use strict";var a;Object.defineProperty(t,"__esModule",{value:!0});var i=n(6),r=i.MIMETypes.MP4,s=i.MIMETypes.WEBM,o=i.MIMETypes.HLS,E=i.MIMETypes.DASH,l=((a={})[r]="progressive",a[s]="progressive",a[o]="hls",a[E]="dash",a);t.getStreamTypeFromMIMEType=function(e){return l[e]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){return function(e,t,n,a,i){this.event=e,this.from=t,this.to=n,this.timestamp=a,this.eventObject=i}}();t.EventDebugging=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSourceInfoFromBitmovinSourceConfig=function(e,t){if(!e)return{progBitrate:void 0,progUrl:void 0};if("string"==typeof e)return{progBitrate:0,progUrl:e};if(Array.isArray(e)){var n=+t.getPlaybackVideoData().id;return isNaN(n)&&(n=0),{progBitrate:e[n].bitrate||0,progUrl:e[n].url}}return"object"==typeof e?{progBitrate:e.bitrate||0,progUrl:e.url}:{progBitrate:void 0,progUrl:void 0}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(2);t.Players=a.Player;var i=n(18);t.CdnProviders=i.CdnProvider;var r=n(11);t.version=r.VERSION;var s=n(19);t.HlsAdapter=s.HlsAdapter;var o=n(42);t.Bitmovin8Adapter=o.Bitmovin8Adapter;var E=n(54);t.Bitmovin7Adapter=E.Bitmovin7Adapter;var l=n(57);t.VideojsAdapter=l.VideojsAdapter;var c=n(60);t.ShakaAdapter=c.ShakaAdapter;var u=n(62);t.DashjsAdapter=u.DashjsAdapter;var d=n(64);t.HTMLVideoElementAdapter=d.HTMLVideoElementAdapter;var m={name:"analytics",module:{Analytics:o.Bitmovin8Adapter},hooks:{setup:function(e,t){var n=t.getConfig();if(!n||!1===n.analytics)return Promise.resolve();var a=new(0,e.Analytics)(t);return Promise.resolve(a)}}};t.PlayerModule=m;var A={HlsAdapter:s.HlsAdapter,Bitmovin8Adapter:o.Bitmovin8Adapter,Bitmovin7Adapter:E.Bitmovin7Adapter,VideojsAdapter:l.VideojsAdapter,ShakaAdapter:c.ShakaAdapter,DashjsAdapter:u.DashjsAdapter,HTMLVideoElementAdapter:d.HTMLVideoElementAdapter};t.adapters=A,t["default"]={PlayerModule:m}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.CLOUDFLARE="cloudflare",e.AKAMAI="akamai",e.FASTLY="fastly",e.MAXCDN="maxcdn",e.CLOUDFRONT="cloudfront",e.CHINACACHE="chinacache",e.BITGRAVITY="bitgravity"}(t.CdnProvider||(t.CdnProvider={}))},function(e,t,n){"use strict";var a,i=this&&this.__extends||(a=function(e,t){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),s=n(5),o=n(39),E=function(e){function t(t,n,a){var i=e.call(this)||this;return i.internalAdapter=new o.HlsInternalAdapter(n,a),i.analytics=new r.Analytics(t,n,i.internalAdapter),i}return i(t,e),t}(s.Adapter);t.HlsAdapter=E},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.FOREGROUND=1]="FOREGROUND",e[e.BACKGROUND=2]="BACKGROUND"}(t.PAGE_LOAD_TYPE||(t.PAGE_LOAD_TYPE={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(22),i=n(28),r=n(29),s=n(13),o=n(30),E=n(31),l=function(){function e(){}return e.prototype.createBackend=function(e,t,n){var a=this.createInnerBackend(e,t,n);return e.debug?new i.DebuggingBackend(e,a):a},e.prototype.createInnerBackend=function(e,t,n){if(void 0===this.backend){var i=e.config&&e.config.backendUrl||s.ANALYTICS_BACKEND_BASE_URL,l=new a.LicenseCheckingBackend(t,o.LicenseCall,i,n);this.backend=new E.DisableBackend(l)}return this.backend.enabled=void 0===e.config||!1!==e.config.enabled,new r.SequenceNumberBackend(this.backend)},e}();t.BackendFactory=l},function(e,t,n){"use strict";var a=this&&this.__assign||function(){return(a=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var i=n(23),r=n(24),s=n(25),o=n(1),E=n(27),l=n(13),c=function(){function e(e,t,n,i){var s=this;this.licenseCall=t,this.backendBaseUrl=n,this.adapter=i,this.licenseKeyReceived=function(e){clearTimeout(s.licenseLazyLoadingTimeoutHandle),s.unsubscribeFromAdapter(),s.info.key=e.licenseKey,s.promise=s.performLicenseCheck()},this.licenseCallFailed=function(){clearTimeout(s.licenseLazyLoadingTimeoutHandle),s.unsubscribeFromAdapter(),s.backend=new E.NoOpBackend},this.licenseLazyLoadingTimeout=function(){s.unsubscribeFromAdapter(),s.backend=new E.NoOpBackend},this.info=a({},e),this.backend=new r.QueueBackend,this.licenseCall=t,void 0!==e.key&&""!==e.key?this.promise=this.performLicenseCheck():!0===i.supportsDeferredLicenseLoading?(i.onLicenseKeyReceived.subscribe(this.licenseKeyReceived),i.onLicenseCallFailed.subscribe(this.licenseCallFailed),this.licenseLazyLoadingTimeoutHandle=window.setTimeout(this.licenseLazyLoadingTimeout,l.ANALYTICS_LICENSECALL_TIMEOUT)):this.backend=new E.NoOpBackend}return e.prototype.performLicenseCheck=function(){var e=this,t=this.info,n=t.key,a=t.domain,r=t.version;if(!n||""===n){var l={status:i.LicensingResult.Denied,message:"No license key provided"};return this.backend=new E.NoOpBackend,Promise.resolve(l)}return this.licenseCall(n,a,r,this.backendBaseUrl).then(function(t){if(t.status!==i.LicensingResult.Granted)throw new Error(t.message);var a=new s.RemoteBackend((!0),e.backendBaseUrl,n);return e.backend.flushTo(a),e.backend=a,t})["catch"](function(t){return o.logger.errorMessageToUser("License Check for Bitmovin Analytics failed because of ",t),e.backend=new E.NoOpBackend,{status:i.LicensingResult.Denied,message:t.message}})},e.prototype.sendRequest=function(e){this.backend.sendRequest(e)},e.prototype.sendUnloadRequest=function(e){this.backend.sendUnloadRequest(e)},e.prototype.sendRequestSynchronous=function(e){this.backend.sendRequestSynchronous(e)},e.prototype.sendAdRequest=function(e){this.backend.sendAdRequest(e)},e.prototype.unsubscribeFromAdapter=function(){this.adapter.onLicenseKeyReceived.unsubscribe(this.licenseKeyReceived),this.adapter.onLicenseCallFailed.unsubscribe(this.licenseCallFailed)},e}();t.LicenseCheckingBackend=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Granted="granted",e.Denied="denied",e.Skip="skip"}(t.LicensingResult||(t.LicensingResult={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(){this.queue=[],this.unloadQueue=[],this.syncQueue=[],this.adQueue=[]}return e.prototype.sendRequest=function(e){this.queue.push(e)},e.prototype.sendUnloadRequest=function(e){this.unloadQueue.push(e)},e.prototype.sendRequestSynchronous=function(e){this.syncQueue.push(e)},e.prototype.sendAdRequest=function(e){this.adQueue.push(e)},e.prototype.flushTo=function(e){this.queue.forEach(function(t){e.sendRequest(t)}),this.unloadQueue.forEach(function(t){e.sendUnloadRequest(t)}),this.syncQueue.forEach(function(t){e.sendRequestSynchronous(t)}),this.adQueue.forEach(function(t){e.sendAdRequest(t)})},e}();t.QueueBackend=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(26),i=n(0),r=function(){function e(e,t,n){this.licenseKey=n,this.hasAdModule=e,this.analyticsCall=new a.AnalyticsCall(t)}return e.prototype.sendRequest=function(e){e.key=this.licenseKey,this.analyticsCall.sendRequest(e,i.noOp)},e.prototype.sendUnloadRequest=function(e){e.key=this.licenseKey,this.analyticsCall.sendUnloadRequest(e)},e.prototype.sendRequestSynchronous=function(e){e.key=this.licenseKey,this.analyticsCall.sendRequestSynchronous(e,i.noOp)},e.prototype.sendAdRequest=function(e){e.key=this.licenseKey,this.hasAdModule&&this.analyticsCall.sendAdRequest(e)},e}();t.RemoteBackend=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(12),i=n(0),r=n(0),s=function(){function e(e){this.analyticsServerUrl=i.joinUrls(e,"analytics"),this.adAnalyticsServerUrl=i.joinUrls(e,"analytics/a")}return e.prototype.sendRequest=function(e,t){a.post(this.analyticsServerUrl,e,t)},e.prototype.sendUnloadRequest=function(e){var t=this;this.trySendBeacon(function(e){return t.sendRequestSynchronous(e,r.noOp)},this.getAnalyticsServerUrl(),e)},e.prototype.trySendBeacon=function(e,t,n){void 0===navigator.sendBeacon?e(n):navigator.sendBeacon(t,JSON.stringify(n))||e(n)},e.prototype.sendRequestSynchronous=function(e,t){a.post(this.analyticsServerUrl,e,t,!1)},e.prototype.sendAdRequest=function(e){var t=this;this.trySendBeacon(function(e){return a.post(t.getAdAnalyticsServerUrl(),e,r.noOp)},this.getAdAnalyticsServerUrl(),e)},e.prototype.getAnalyticsServerUrl=function(){return this.analyticsServerUrl},e.prototype.getAdAnalyticsServerUrl=function(){return this.adAnalyticsServerUrl},e}();t.AnalyticsCall=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(){}return e.prototype.sendRequest=function(e){},e.prototype.sendUnloadRequest=function(e){},e.prototype.sendRequestSynchronous=function(e){},e.prototype.sendAdRequest=function(e){},e}();t.NoOpBackend=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(1),i=function(){function e(e,t){this.underlying=t,e.debug&&e.debug.fields&&(this.debugFields=e.debug.fields)}return e.prototype.sendRequest=function(e){this.printFields(e),this.underlying.sendRequest(e)},e.prototype.sendUnloadRequest=function(e){this.printFields(e),this.underlying.sendUnloadRequest(e)},e.prototype.sendRequestSynchronous=function(e){this.printFields(e),this.underlying.sendRequestSynchronous(e)},e.prototype.sendAdRequest=function(e){this.underlying.sendAdRequest(e)},e.prototype.printFields=function(e){if(this.debugFields&&this.debugFields.length){var t={};this.debugFields.forEach(function(n){return t[n]=e[n]}),a.logger.logTable([t])}},e}();t.DebuggingBackend=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e){this.sequenceNumber=0,this.underlying=e}return e.prototype.sendRequest=function(e){this.updateSampleBeforeSending(e),this.underlying.sendRequest(e)},e.prototype.sendUnloadRequest=function(e){this.updateSampleBeforeSending(e),this.underlying.sendUnloadRequest(e)},e.prototype.sendRequestSynchronous=function(e){this.updateSampleBeforeSending(e),this.underlying.sendRequestSynchronous(e)},e.prototype.sendAdRequest=function(e){this.underlying.sendAdRequest(e)},e.prototype.updateSampleBeforeSending=function(e){e.sequenceNumber=this.sequenceNumber++},e}();t.SequenceNumberBackend=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(12),i=n(0);t.LicenseCall=function(e,t,n,r){var s=i.joinUrls(r,"/licensing"),o={analyticsVersion:n,domain:t,key:e};return new Promise(function(e){a.post(s,o,function(t){e(t)})})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e){this.innerBackend=e,this._enabled=!0,this.startupInformationSent=!1}return Object.defineProperty(e.prototype,"enabled",{get:function(){return this._enabled},set:function(e){this._enabled=e},enumerable:!0,configurable:!0}),e.prototype.sendRequest=function(e){this.decorateSampleIfEnabled(e)&&this.innerBackend.sendRequest(e)},e.prototype.sendUnloadRequest=function(e){this._enabled&&this.innerBackend.sendUnloadRequest(e)},e.prototype.sendRequestSynchronous=function(e){this.decorateSampleIfEnabled(e)&&this.innerBackend.sendRequestSynchronous(e)},e.prototype.sendAdRequest=function(e){this._enabled&&this.innerBackend.sendAdRequest(e)},e.prototype.decorateSampleIfEnabled=function(e){return!this.startupInformationSent&&e.playerStartupTime&&e.playerStartupTime>0&&(this.startupInformation={playerStartupTime:e.playerStartupTime,pageLoadTime:e.pageLoadTime},!0===this._enabled)?(this.startupInformationSent=!0,!0):!!this._enabled&&(!this.startupInformationSent&&this.startupInformation&&e.videoStartupTime&&e.videoStartupTime>0&&(this.copyPropertiesToSample(e,this.startupInformation),e.startupTime=(e.playerStartupTime||0)+e.videoStartupTime,this.startupInformationSent=!0),!0)},e.prototype.copyPropertiesToSample=function(e,t){Object.getOwnPropertyNames(t).forEach(function(n){return e[n]=t[n]})},e}();t.DisableBackend=a},function(e,t,n){"use strict";var a=this&&this.__assign||function(){return(a=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var i,r=n(1),s=n(33),o=n(0),E=n(34),l=n(35),c=n(36);!function(e){e.FIRST_QUARTILE="firstQuartile",e.MIDPOINT="midpoint",e.THIRD_QUARTILE="thirdQuartile"}(i||(i={}));var u=function(){function e(e,t){var n=this;this.onBeforeUnLoadEvent=!1,this.adManifestLoadedEvents=[],this.isPlaying=!1,this.adPodPosition=0,this.analytics=e,this.adapter=t,this.adapter.adCallbacks.onAdStarted=function(e){return n.onAdStarted(e)},this.adapter.adCallbacks.onAdFinished=function(e){return n.onAdFinished(e)},this.adapter.adCallbacks.onAdBreakStarted=function(e){return n.onAdBreakStarted(e)},this.adapter.adCallbacks.onAdBreakFinished=function(e){return n.onAdBreakFinished(e)},this.adapter.adCallbacks.onAdClicked=function(e){return n.onAdClicked(e)},this.adapter.adCallbacks.onAdError=function(e){return n.onAdError(e)},this.adapter.adCallbacks.onAdManifestLoaded=function(e){return n.onAdManifestLoaded(e)},this.adapter.adCallbacks.onPlay=function(){return n.onPlay()},this.adapter.adCallbacks.onPause=function(){return n.onPause()},this.adapter.adCallbacks.onBeforeUnload=function(){return n.onBeforeUnload()},this.adapter.adCallbacks.onAdSkipped=function(e){return n.onAdSkipped(e)},this.adapter.adCallbacks.onAdQuartile=function(e){return n.onAdQuartile(e)},this.viewportTracker=new E.ViewportTracker(this.adapter.getContainer(),function(){return n.onIntersectionChanged()},.5)}return e.prototype.onInters