@bitmovin/player-integration-conviva
Advanced tools
Comparing version 5.2.0 to 5.3.0
@@ -10,2 +10,6 @@ # Changelog | ||
## [5.3.0] - 2024-08-14 | ||
### Changed | ||
- Track initial audio track and subtitles only after the first `Play` event | ||
## [5.2.0] - 2024-07-08 | ||
@@ -136,3 +140,4 @@ ### Added | ||
[Unreleased]: https://github.com/bitmovin/bitmovin-player-analytics-conviva/compare/v5.2.0...HEAD | ||
[Unreleased]: https://github.com/bitmovin/bitmovin-player-analytics-conviva/compare/v5.3.0...HEAD | ||
[5.3.0]: https://github.com/bitmovin/bitmovin-player-analytics-conviva/compare/v5.2.0...v5.3.0 | ||
[5.2.0]: https://github.com/bitmovin/bitmovin-player-analytics-conviva/compare/v5.1.0...v5.2.0 | ||
@@ -139,0 +144,0 @@ [5.1.0]: https://github.com/bitmovin/bitmovin-player-analytics-conviva/compare/v5.0.0...v5.1.0 |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@convivainc/conviva-js-coresdk")):"function"==typeof define&&define.amd?define("bitmovin-player-analytics-conviva",["@convivainc/conviva-js-coresdk"],e):"object"==typeof exports?exports["bitmovin-player-analytics-conviva"]=e(require("@convivainc/conviva-js-coresdk")):(t.bitmovin=t.bitmovin||{},t.bitmovin.player=t.bitmovin.player||{},t.bitmovin.player.analytics=e(t.Conviva))}(window,function(t){return function(t){var e={};function a(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,a),n.l=!0,n.exports}return a.m=t,a.c=e,a.d=function(t,e,i){a.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},a.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.t=function(t,e){if(1&e&&(t=a(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(a.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)a.d(i,n,function(e){return t[e]}.bind(null,n));return i},a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,"a",e),e},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.p="",a(a.s=4)}([function(e,a){e.exports=t},function(t,e,a){"use strict";var i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,a=1,i=arguments.length;a<i;a++)for(var n in e=arguments[a])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.AdHelper=void 0;var n=a(0),s=a(2),o=function(){function t(){}return t.mapCsaiAdPosition=function(t,e){return t.scheduleTime<=0?n.Constants.AdPosition.PREROLL:t.scheduleTime>=e.getDuration()?n.Constants.AdPosition.POSTROLL:n.Constants.AdPosition.MIDROLL},t.formatCsaiAdError=function(t){var e,a,i=(null==t?void 0:t.message)||"Unknown message",n=(null==t?void 0:t.name)||"Unknown name";return["Ad error:","".concat(n,";"),(null===(e=t.data)||void 0===e?void 0:e.code)?"Ad error code: ".concat(null===(a=t.data)||void 0===a?void 0:a.code,";"):void 0,"Message:","".concat(i,";"),"Error code: ".concat(t.code,";"),t.troubleShootLink?"Troubleshoot link: ".concat(t.troubleShootLink):void 0].filter(Boolean).join(" ")},t.extractCsaiConvivaAdInfo=function(e,a,i){var s,o,r,c=i.ad,d=c.data,l="NA",v="NA",u="NA",y=c.id;d&&("adSystem"in d&&(null===(o=d.adSystem)||void 0===o?void 0:o.name)&&(l=d.adSystem.name),"creative"in d&&(null===(r=null==d?void 0:d.creative)||void 0===r?void 0:r.id)&&(v=d.creative.id),"adTitle"in d&&d.adTitle&&(u=d.adTitle),"wrapperAdIds"in d&&d.wrapperAdIds&&d.wrapperAdIds.length&&(y=d.wrapperAdIds[d.wrapperAdIds.length-1]));var A=((s={"c3.ad.id":c.id,"c3.ad.technology":n.Constants.AdType.CLIENT_SIDE,"c3.ad.position":t.mapCsaiAdPosition(a.adBreak,e),"c3.ad.system":l,"c3.ad.creativeId":v,"c3.ad.firstAdId":y})[n.Constants.ASSET_NAME]=u,s[n.Constants.STREAM_URL]=c.mediaFileUrl||"NA",s["c3.ad.mediaFileApiFramework"]="NA",s["c3.ad.firstAdSystem"]="NA",s["c3.ad.firstCreativeId"]="NA",s);return"duration"in c&&c.duration&&(A[n.Constants.DURATION]=c.duration),A},t.convertSsaiAdInfoToConvivaAdInfo=function(t,e){var a,o=[s.INTEGRATION_VERSION_CONTENT_METADATA_CUSTOM_TAG,s.STREAM_TYPE_CONTENT_METADATA_CUSTOM_TAG,n.Constants.ASSET_NAME,n.Constants.IS_LIVE,n.Constants.DEFAULT_RESOURCE,n.Constants.ENCODED_FRAMERATE,n.Constants.VIEWER_ID,n.Constants.PLAYER_NAME],r={};o.forEach(function(t){r[t]=e[t]});var c=i(i(i({},r),t.additionalMetadata),((a={"c3.ad.id":t.id,"c3.ad.technology":n.Constants.AdType.SERVER_SIDE,"c3.ad.position":t.position||"NA","c3.ad.system":t.adSystem||"NA"})[n.Constants.ASSET_NAME]=t.title||r[n.Constants.ASSET_NAME]||"NA",a["c3.ad.adStitcher"]=t.adStitcher||"NA",a["c3.ad.isSlate"]=void 0===t.isSlate?"NA":t.isSlate.toString(),a));return t.duration&&(c[n.Constants.DURATION]=t.duration),c},t}();e.AdHelper=o},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ConvivaAnalyticsTracker=e.VR_CONTENT_TYPE_CONTENT_METADATA_CUSTOM_TAG=e.STREAM_TYPE_CONTENT_METADATA_CUSTOM_TAG=e.PLAYER_TYPE_CONTENT_METADATA_CUSTOM_TAG=e.INTEGRATION_VERSION_CONTENT_METADATA_CUSTOM_TAG=e.PRELOAD_CONTENT_METADATA_CUSTOM_TAG=e.AUTOPLAY_CONTENT_METADATA_CUSTOM_TAG=void 0;var i=a(0),n=a(8),s=a(9),o=a(10),r=a(11),c=a(12),d=a(13),l=a(14),v=a(1),u=a(3),y=a(16),A=a(18);e.AUTOPLAY_CONTENT_METADATA_CUSTOM_TAG="autoplay",e.PRELOAD_CONTENT_METADATA_CUSTOM_TAG="preload",e.INTEGRATION_VERSION_CONTENT_METADATA_CUSTOM_TAG="integrationVersion",e.PLAYER_TYPE_CONTENT_METADATA_CUSTOM_TAG="playerType",e.STREAM_TYPE_CONTENT_METADATA_CUSTOM_TAG="streamType",e.VR_CONTENT_TYPE_CONTENT_METADATA_CUSTOM_TAG="vrContentType";var p=function(){function t(e,a,y){var p;void 0===y&&(y={});var h=this;if(this.stallTrackingTimeout=new d.Timeout(t.STALL_TRACKING_DELAY_MS,function(){h._isAdBreakActive?(h.debugLog("[ ConvivaAnalyticsTracker ] report buffering ad playback state"),h.convivaAdAnalytics.reportAdMetric(i.Constants.Playback.PLAYER_STATE,i.Constants.PlayerState.BUFFERING)):(h.debugLog("[ ConvivaAnalyticsTracker ] report buffering playback state"),h.convivaVideoAnalytics.reportPlaybackMetric(i.Constants.Playback.PLAYER_STATE,i.Constants.PlayerState.BUFFERING))}),this.sessionEndedExternally=!1,this.internalEndSession=function(t){h.isSessionActive()&&(h.debugLog("[ ConvivaAnalyticsTracker ] end session",i.Constants.NO_SESSION_KEY,t),h.convivaVideoAnalytics.release(),h.convivaVideoAnalytics=null,h.convivaAdAnalytics.release(),h.convivaAdAnalytics=null,h._isAdBreakActive=!1)},this.onSourceLoaded=function(t){h.debugLog("[ ConvivaAnalyticsTracker ] [ Player Event ] source loaded",t),h.isSessionActive()&&(h.buildSourceRelatedMetadata(h.player.getSource()),h.updateSession())},this.onPlay=function(t){h.debugLog("[ ConvivaAnalyticsTracker ] [ Player Event ] play"),h.canTrackPlayEvent&&(h.isSessionActive()||h.sessionEndedExternally||h.internalInitializeSession())},this.onPlaying=function(t){h.debugLog("[ ConvivaAnalyticsTracker ] [ Player Event ] playing",t),h.isSessionActive()&&(h.contentMetadataBuilder.setPlaybackStarted(!0),h.updateSession())},this.onPlaybackFinished=function(t){h.debugLog("[ ConvivaAnalyticsTracker ] [ Player Event ] playback finished",t),h.isSessionActive()&&(h.convivaVideoAnalytics.release(),h.convivaVideoAnalytics=null,h.convivaAdAnalytics.release(),h.convivaAdAnalytics=null)},this.trackVideoQualityChanged=function(t){if(h.isSessionActive()){var e=Math.round(t.targetQuality.bitrate/1e3);h.debugLog("[ ConvivaAnalyticsTracker ] report bitrate",{event:t,bitrateKbps:e}),h.convivaVideoAnalytics.reportPlaybackMetric(i.Constants.Playback.BITRATE,e)}},this.trackAdBreakStarted=function(t){h.isSessionActive()&&(h._isAdBreakActive=!0,h.debugLog("[ ConvivaAnalyticsTracker ] report ad break started",{type:t}),h.convivaVideoAnalytics.reportAdBreakStarted(t,t===i.Constants.AdType.CLIENT_SIDE?i.Constants.AdPlayer.SEPARATE:i.Constants.AdPlayer.CONTENT))},this.trackAdStarted=function(t,e,a){if(h.isSessionActive()){if(h.debugLog("[ ConvivaAnalyticsTracker ] report ad started",{adInfo:t,type:e,bitrateKbps:a}),h.convivaAdAnalytics.reportAdStarted(t),h.debugLog("[ ConvivaAnalyticsTracker ] report ".concat(A.PlayerStateHelper.getPlayerState(h.player)," ad playback state")),h.convivaAdAnalytics.reportAdMetric(i.Constants.Playback.PLAYER_STATE,A.PlayerStateHelper.getPlayerState(h.player)),e===i.Constants.AdType.SERVER_SIDE){var n=h.player.getPlaybackVideoData(),s="".concat(n.width,"x").concat(n.height);h.debugLog("[ ConvivaAnalyticsTracker ] report ad resolution",s),h.convivaAdAnalytics.reportAdMetric(i.Constants.Playback.RESOLUTION,s),n.frameRate&&(h.debugLog("[ ConvivaAnalyticsTracker ] report framerate",n.frameRate),h.convivaAdAnalytics.reportAdMetric(i.Constants.Playback.RENDERED_FRAMERATE,n.frameRate))}a&&(h.debugLog("[ ConvivaAnalyticsTracker ] report ad bitrate",a),h.convivaAdAnalytics.reportAdMetric(i.Constants.Playback.BITRATE,a))}},this.trackAdFinished=function(){h.isSessionActive()&&(h.debugLog("[ ConvivaAnalyticsTracker ] report ad ended"),h.convivaAdAnalytics.reportAdEnded())},this.trackAdSkipped=function(){h.isSessionActive()&&(h.debugLog("[ ConvivaAnalyticsTracker ] report ad skipped"),h.convivaAdAnalytics.reportAdSkipped())},this.trackAdBreakFinished=function(){h.isSessionActive()&&(h._isAdBreakActive=!1,h.debugLog("[ ConvivaAnalyticsTracker ] report ad break ended"),h.convivaVideoAnalytics.reportAdBreakEnded(),h.debugLog("[ ConvivaAnalyticsTracker ] report ".concat(A.PlayerStateHelper.getPlayerState(h.player)," playback state")),h.convivaVideoAnalytics.reportPlaybackMetric(i.Constants.Playback.PLAYER_STATE,A.PlayerStateHelper.getPlayerState(h.player)))},this.trackAdError=function(t){if(h.isSessionActive()){var e=v.AdHelper.formatCsaiAdError(t);h.debugLog("[ ConvivaAnalyticsTracker ] report ad error",{event:t,formattedError:e}),h.convivaAdAnalytics.reportAdError(e,i.Constants.ErrorSeverity.WARNING)}},this.trackError=function(t){h.isSessionActive()||h.sessionEndedExternally||h.internalInitializeSession(),h.debugLog("[ ConvivaAnalyticsTracker ] report playback deficiency",t),h.reportPlaybackDeficiency(String(t.code)+" "+t.name,i.Constants.ErrorSeverity.FATAL)},this.onSourceUnloaded=function(t){h.debugLog("[ ConvivaAnalyticsTracker ] [ Player Event ] source unloaded",t),h._isAdBreakActive||(h.internalEndSession(t),h.resetContentMetadata())},this.onDestroy=function(t){h.debugLog("[ ConvivaAnalyticsTracker ] [ Player Event ] destroy",t),h.release(t)},void 0!==i)if(e.getSource())console.error("Bitmovin Conviva integration must be instantiated before calling player.load()");else{this.player=e,this.events=e.exports.PlayerEvent,this.handlers=new u.PlayerEventWrapper(e),this.config=y,this.config.debugLoggingEnabled=this.config.debugLoggingEnabled||!1,this.logger=new s.Html5Logging,this.sessionKey=i.Constants.NO_SESSION_KEY,this._isAdBreakActive=!1;var g=this.config.deviceMetadata||{},f=((p={})[i.Constants.DeviceMetadata.CATEGORY]=g.category||this.config.deviceCategory||i.Constants.DeviceCategory.WEB,p[i.Constants.DeviceMetadata.BRAND]=g.brand,p[i.Constants.DeviceMetadata.MANUFACTURER]=g.manufacturer,p[i.Constants.DeviceMetadata.MODEL]=g.model,p[i.Constants.DeviceMetadata.TYPE]=g.type,p[i.Constants.DeviceMetadata.VERSION]=g.version,p[i.Constants.DeviceMetadata.OS_NAME]=g.osName,p[i.Constants.DeviceMetadata.OS_VERSION]=g.osVersion,p);i.Analytics.setDeviceMetadata(f);var T={};T[i.Constants.CallbackFunctions.CONSOLE_LOG]=this.logger.consoleLog,T[i.Constants.CallbackFunctions.MAKE_REQUEST]=(new n.Html5Http).makeRequest;var S=new o.Html5Storage;T[i.Constants.CallbackFunctions.SAVE_DATA]=S.saveData,T[i.Constants.CallbackFunctions.LOAD_DATA]=S.loadData,T[i.Constants.CallbackFunctions.CREATE_TIMER]=(new c.Html5Timer).createTimer,T[i.Constants.CallbackFunctions.GET_EPOCH_TIME_IN_MS]=(new r.Html5Time).getEpochTimeMs;var k={};k[i.Constants.GATEWAY_URL]=y.gatewayUrl,k[i.Constants.LOG_LEVEL]=this.config.debugLoggingEnabled?i.Constants.LogLevel.DEBUG:i.Constants.LogLevel.NONE,i.Analytics.init(a,T,k),this.contentMetadataBuilder=new l.ContentMetadataBuilder(this.logger),this.registerPlayerEvents()}else console.error("Conviva script missing, cannot init ConvivaAnalytics. Please load the Conviva script (conviva-core-sdk.min.js) before Bitmovin's ConvivaAnalytics integration.")}return Object.defineProperty(t.prototype,"isAdBreakActive",{get:function(){return this._isAdBreakActive},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canTrackPlayEvent",{get:function(){return!this._isAdBreakActive},enumerable:!1,configurable:!0}),t.prototype.getContentMetadata=function(){return this.contentMetadataBuilder.build()},t.prototype.initializeSession=function(){if(this.isSessionActive())this.logger.consoleLog("[ ConvivaAnalyticsTracker ] There is already a session running.",i.SystemSettings.LogLevel.WARNING);else{if(!this.player.getSource()&&!this.contentMetadataBuilder.assetName)throw"AssetName is missing. Load player source first or set assetName via updateContentMetadata";this.internalInitializeSession(),this.sessionEndedExternally=!1}},t.prototype.endSession=function(){this.isSessionActive()&&(this._isAdBreakActive&&(this.debugLog("[ ConvivaAnalyticsTracker ] report ad skipped"),this.convivaAdAnalytics.reportAdSkipped()),this.debugLog("[ ConvivaAnalyticsTracker ] report playback ended state"),this.convivaVideoAnalytics.reportPlaybackEnded(),this.internalEndSession(),this.resetContentMetadata(),this.sessionEndedExternally=!0)},t.prototype.sendCustomApplicationEvent=function(t,e){void 0===e&&(e={}),this.isSessionActive()?(this.debugLog("[ ConvivaAnalyticsTracker ] report custom app event",{eventName:t,eventAttributes:e}),this.convivaVideoAnalytics.reportAppEvent(t,e)):this.logger.consoleLog("[ ConvivaAnalyticsTracker ] cannot send application event, no active monitoring session",i.SystemSettings.LogLevel.WARNING)},t.prototype.sendCustomPlaybackEvent=function(t,e){void 0===e&&(e={}),this.isSessionActive()?(this.debugLog("[ ConvivaAnalyticsTracker ] report custom playback event",{eventName:t,eventAttributes:e}),this.convivaVideoAnalytics.reportPlaybackEvent(t,e)):this.logger.consoleLog("[ ConvivaAnalyticsTracker ] cannot send playback event, no active monitoring session",i.SystemSettings.LogLevel.WARNING)},t.prototype.updateContentMetadata=function(t){this.internalUpdateContentMetadata(t)},t.prototype.reportPlaybackDeficiency=function(t,e,a){void 0===a&&(a=!0),this.isSessionActive()&&(this.debugLog("[ ConvivaAnalyticsTracker ] report playback failed",{message:t}),this.convivaVideoAnalytics.reportPlaybackFailed(t),a&&(this.internalEndSession(),this.resetContentMetadata()))},t.prototype.pauseTracking=function(){this.debugLog("[ ConvivaAnalyticsTracker ] pause tracking via ad break started reporting"),this.convivaVideoAnalytics.reportAdBreakStarted(i.Constants.AdType.CLIENT_SIDE,i.Constants.AdPlayer.SEPARATE)},t.prototype.resumeTracking=function(){this.debugLog("[ ConvivaAnalyticsTracker ] resume tracking via ad break ended reporting"),this.convivaVideoAnalytics.reportAdBreakEnded()},t.prototype.release=function(t){this.debugLog("[ ConvivaAnalyticsTracker ] releasing",t),this.unregisterPlayerEvents(),this.internalEndSession(t),i.Analytics.release()},t.prototype.debugLog=function(t){for(var e=[],a=1;a<arguments.length;a++)e[a-1]=arguments[a];this.config.debugLoggingEnabled&&console.log.apply(console,arguments)},t.prototype.getUrlFromSource=function(t){switch(this.player.getStreamType()){case"dash":return t.dash;case"hls":return t.hls;case"progressive":return Array.isArray(t.progressive)?t.progressive[0].url:t.progressive}},t.prototype.internalUpdateContentMetadata=function(t){this.contentMetadataBuilder.setOverrides(t),this.isSessionActive()?(this.buildContentMetadata(),this.updateSession()):this.logger.consoleLog("[ ConvivaAnalyticsTracker ] no active session. Content metadata will be propagated to Conviva on session initialization.",i.SystemSettings.LogLevel.DEBUG)},t.prototype.internalInitializeSession=function(){var t,e=this;this.debugLog("[ ConvivaAnalyticsTracker ] initializing session"),this.buildContentMetadata(),this.convivaVideoAnalytics=i.Analytics.buildVideoAnalytics(),this.convivaAdAnalytics=i.Analytics.buildAdAnalytics(this.convivaVideoAnalytics);var a=((t={})[i.Constants.FRAMEWORK_NAME]="Bitmovin Player",t[i.Constants.FRAMEWORK_VERSION]=this.player.version,t);this.convivaVideoAnalytics.setPlayerInfo(a),this.convivaAdAnalytics.setAdPlayerInfo(a),this.debugLog("[ ConvivaAnalyticsTracker ] report playback requested"),this.convivaVideoAnalytics.reportPlaybackRequested(this.contentMetadataBuilder.build()),this.sessionKey=this.convivaVideoAnalytics.getSessionId(),this.debugLog("[ ConvivaAnalyticsTracker ] new session key",this.sessionKey),this.convivaVideoAnalytics.setCallback(function(){var t=1e3*e.player.getCurrentTime("relativetime");e._isAdBreakActive?(e.debugLog("[ ConvivaAnalyticsTracker ] report ad player head time",t),e.convivaAdAnalytics.reportAdMetric(i.Constants.Playback.PLAY_HEAD_TIME,t)):(e.debugLog("[ ConvivaAnalyticsTracker ] report player head time",t),e.convivaVideoAnalytics.reportPlaybackMetric(i.Constants.Playback.PLAY_HEAD_TIME,t))}),this.isSessionActive()||this.logger.consoleLog("[ ConvivaAnalyticsTracker ] Something went wrong, could not obtain session key",i.SystemSettings.LogLevel.ERROR),this.trackUpdateAudioTrack(this.player.getAudio()),this.trackSubtitleWhenInternalInitialize()},t.prototype.buildContentMetadata=function(){var a;this.contentMetadataBuilder.duration=this.player.getDuration(),this.contentMetadataBuilder.streamType=this.player.isLive()?i.ContentMetadata.StreamType.LIVE:i.ContentMetadata.StreamType.VOD,this.contentMetadataBuilder.addToCustom(((a={})[e.AUTOPLAY_CONTENT_METADATA_CUSTOM_TAG]=y.PlayerConfigHelper.getAutoplayConfig(this.player)+"",a[e.PRELOAD_CONTENT_METADATA_CUSTOM_TAG]=y.PlayerConfigHelper.getPreloadConfig(this.player)+"",a[e.INTEGRATION_VERSION_CONTENT_METADATA_CUSTOM_TAG]=t.VERSION,a));var n=this.player.getSource();n&&this.buildSourceRelatedMetadata(n)},t.prototype.buildSourceRelatedMetadata=function(t){var a;this.contentMetadataBuilder.assetName=this.getAssetNameFromSource(t),this.contentMetadataBuilder.viewerId=this.contentMetadataBuilder.viewerId,this.contentMetadataBuilder.addToCustom(((a={})[e.PLAYER_TYPE_CONTENT_METADATA_CUSTOM_TAG]=this.player.getPlayerType(),a[e.STREAM_TYPE_CONTENT_METADATA_CUSTOM_TAG]=this.player.getStreamType(),a[e.VR_CONTENT_TYPE_CONTENT_METADATA_CUSTOM_TAG]=t.vr&&t.vr.contentType,a)),this.contentMetadataBuilder.streamUrl=this.getUrlFromSource(t)},t.prototype.updateSession=function(){this.isSessionActive()&&this.convivaVideoAnalytics.setContentInfo(this.contentMetadataBuilder.build())},t.prototype.getAssetNameFromSource=function(t){var e=t.title;return e||"Untitled (no source.title set)"},t.prototype.resetContentMetadata=function(){this.contentMetadataBuilder.reset()},t.prototype.isSessionActive=function(){return!!this.convivaVideoAnalytics},t.prototype.trackPlaybackStateChanged=function(t){if(this.isSessionActive()){var e=A.PlayerStateHelper.getPlayerStateFromEvent(t,this.events,this.player),a=[this.events.Play,this.events.Seek,this.events.TimeShift],n=[this.events.StallStarted,this.events.Playing,this.events.Paused,this.events.Seeked,this.events.TimeShifted,this.events.StallEnded,this.events.PlaybackFinished];-1!==a.indexOf(t.type)?this.stallTrackingTimeout.start():-1!==n.indexOf(t.type)&&this.stallTrackingTimeout.clear(),e&&(this._isAdBreakActive?(this.debugLog("[ ConvivaAnalyticsTracker ] report ad playback state",e),this.convivaAdAnalytics.reportAdMetric(i.Constants.Playback.PLAYER_STATE,e)):(this.debugLog("[ ConvivaAnalyticsTracker ] report playback state",e),this.convivaVideoAnalytics.reportPlaybackMetric(i.Constants.Playback.PLAYER_STATE,e))),t.type===this.events.PlaybackFinished&&(this.debugLog("[ ConvivaAnalyticsTracker ] report playback ended"),this.convivaVideoAnalytics.reportPlaybackEnded())}},t.prototype.trackSeekStart=function(t){this.isSessionActive()&&(this.debugLog("[ ConvivaAnalyticsTracker ] report seek started"),this.convivaVideoAnalytics.reportPlaybackMetric(i.Constants.Playback.SEEK_STARTED,t))},t.prototype.trackSeekEnd=function(){this.isSessionActive()&&(this.debugLog("[ ConvivaAnalyticsTracker ] report seek ended"),this.convivaVideoAnalytics.reportPlaybackMetric(i.Constants.Playback.SEEK_ENDED))},t.prototype.trackUpdateAudioTrack=function(t){if(this.isSessionActive()){var e="unknown"!==t.lang?"["+t.lang+"]:"+t.label:t.label;this.debugLog("[ ConvivaAnalyticsTracker ] report audio language",{formattedAudio:e}),this.convivaVideoAnalytics.reportPlaybackMetric(i.Constants.Playback.AUDIO_LANGUAGE,e)}},t.prototype.trackUpdateSubtitleTrack=function(t){if(this.isSessionActive()){var e="unknown"!==t.lang?"["+t.lang+"]:"+t.label:t.label;"subtitles"===t.kind?(this.debugLog("[ ConvivaAnalyticsTracker ] report subtitles language",{formattedSubtitle:e}),this.convivaVideoAnalytics.reportPlaybackMetric(i.Constants.Playback.SUBTITLES_LANGUAGE,e),this.debugLog("[ ConvivaAnalyticsTracker ] report off closed captions language"),this.convivaVideoAnalytics.reportPlaybackMetric(i.Constants.Playback.CLOSED_CAPTIONS_LANGUAGE,"off")):"captions"===t.kind?(this.debugLog("[ ConvivaAnalyticsTracker ] report closed captions language",{formattedSubtitle:e}),this.convivaVideoAnalytics.reportPlaybackMetric(i.Constants.Playback.CLOSED_CAPTIONS_LANGUAGE,e),this.debugLog("[ ConvivaAnalyticsTracker ] report off subtitles language"),this.convivaVideoAnalytics.reportPlaybackMetric(i.Constants.Playback.SUBTITLES_LANGUAGE,"off")):this.trackTurnOffSubtitles()}},t.prototype.trackSubtitleWhenInternalInitialize=function(){if(this.isSessionActive()){if(void 0!==this.player.subtitles){var t=this.player.subtitles.list().filter(function(t){return t.enabled});if(1===t.length)return void this.trackUpdateSubtitleTrack(t[0])}this.trackTurnOffSubtitles()}},t.prototype.trackTurnOffSubtitles=function(){this.isSessionActive()&&(this.debugLog("[ ConvivaAnalyticsTracker ] report off subtitles language"),this.convivaVideoAnalytics.reportPlaybackMetric(i.Constants.Playback.SUBTITLES_LANGUAGE,"off"),this.debugLog("[ ConvivaAnalyticsTracker ] report off closed captions language"),this.convivaVideoAnalytics.reportPlaybackMetric(i.Constants.Playback.CLOSED_CAPTIONS_LANGUAGE,"off"))},t.prototype.registerPlayerEvents=function(){this.handlers.add(this.events.SourceLoaded,this.onSourceLoaded),this.handlers.add(this.events.Play,this.onPlay),this.handlers.add(this.events.Playing,this.onPlaying),this.handlers.add(this.events.PlaybackFinished,this.onPlaybackFinished),this.handlers.add(this.events.SourceUnloaded,this.onSourceUnloaded),this.handlers.add(this.events.Destroy,this.onDestroy)},t.prototype.unregisterPlayerEvents=function(){this.handlers.clear()},Object.defineProperty(t,"version",{get:function(){return t.VERSION},enumerable:!1,configurable:!0}),t.VERSION="5.2.0",t.STALL_TRACKING_DELAY_MS=100,t}();e.ConvivaAnalyticsTracker=p},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PlayerEventWrapper=void 0;var i=a(15),n=function(){function t(t){this.player=t,this.eventHandlers={}}return t.prototype.add=function(t,e){this.player.on(t,e),this.eventHandlers[t]||(this.eventHandlers[t]=[]),this.eventHandlers[t].push(e)},t.prototype.remove=function(t,e){this.player.off(t,e),this.eventHandlers[t]&&i.ArrayUtils.remove(this.eventHandlers[t],e)},t.prototype.clear=function(){for(var t in this.eventHandlers)for(var e=0,a=this.eventHandlers[t];e<a.length;e++){var i=a[e];this.remove(t,i)}},t}();e.PlayerEventWrapper=n},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ConvivaAnalytics=void 0,a(5);var i=a(6);Object.defineProperty(e,"ConvivaAnalytics",{enumerable:!0,get:function(){return i.ConvivaAnalytics}})},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ConvivaAnalytics=void 0;var i=a(0),n=a(7),s=a(2),o=a(19),r=a(3),c=a(1),d=function(){function t(t,e,a){void 0===a&&(a={});var d=this;this.onPlaybackStateChanged=function(t){d.debugLog("[ ConvivaAnalytics ] [ Player Event ] playback state change related event",t),d.convivaAnalyticsTracker.trackPlaybackStateChanged(t)},this.onPlay=function(t){d.debugLog("[ ConvivaAnalytics ] [ Player Event ] play",t),d.convivaAnalyticsTracker.canTrackPlayEvent&&d.onPlaybackStateChanged(t)},this.onPlaying=function(t){d.debugLog("[ ConvivaAnalytics ] [ Player Event ] playing",t),d.onPlaybackStateChanged(t)},this.onPlaybackFinished=function(t){d.debugLog("[ ConvivaAnalytics ] [ Player Event ] playback finished",t),d.onPlaybackStateChanged(t)},this.onVideoQualityChanged=function(t){d.debugLog("[ ConvivaAnalytics ] [ Player Event ] video quality changed",t),d.convivaAnalyticsTracker.trackVideoQualityChanged(t)},this.onCustomEvent=function(t){d.debugLog("[ ConvivaAnalytics ] [ Player Event ] custom playback related event",t);var e=n.ObjectUtils.flatten(t);d.sendCustomPlaybackEvent(t.type,e)},this.onAdBreakStarted=function(t){d.debugLog("[ ConvivaAnalytics ] [ Player Event ] adbreak started",t),d.lastAdBreakEvent=t,d.convivaAnalyticsTracker.trackAdBreakStarted(i.Constants.AdType.CLIENT_SIDE)},this.onAdStarted=function(t){var e;d.debugLog("[ ConvivaAnalytics ] [ Player Event ] ad started",t);var a=c.AdHelper.extractCsaiConvivaAdInfo(d.player,d.lastAdBreakEvent,t),n=null===(e=t.ad.data)||void 0===e?void 0:e.bitrate;d.convivaAnalyticsTracker.trackAdStarted(a,i.Constants.AdType.CLIENT_SIDE,n)},this.onAdFinished=function(t){d.debugLog("[ ConvivaAnalytics ] [ Player Event ] ad finished",t),d.convivaAnalyticsTracker.trackAdFinished()},this.onAdSkipped=function(t){d.debugLog("[ ConvivaAnalytics ] [ Player Event ] ad skipped",t),d.convivaAnalyticsTracker.trackAdSkipped(),d.onCustomEvent(t)},this.onAdBreakFinished=function(t){d.debugLog("[ ConvivaAnalytics ] [ Player Event ] adbreak finished",t),d.convivaAnalyticsTracker.trackAdBreakFinished()},this.onAdError=function(t){d.debugLog("[ ConvivaAnalytics ] [ Player Event ] ad error",t),d.convivaAnalyticsTracker.trackAdError(t),d.onCustomEvent(t)},this.onSeek=function(t){d.debugLog("[ ConvivaAnalytics ] [ Player Event ] seek",t),d.convivaAnalyticsTracker.trackSeekStart(t.seekTarget),d.onPlaybackStateChanged(t)},this.onSeeked=function(t){d.debugLog("[ ConvivaAnalytics ] [ Player Event ] seeked",t),d.convivaAnalyticsTracker.trackSeekEnd(),d.onPlaybackStateChanged(t)},this.onTimeShift=function(t){d.debugLog("[ ConvivaAnalytics ] [ Player Event ] time shift",t),d.convivaAnalyticsTracker.trackSeekStart(-1),d.onPlaybackStateChanged(t)},this.onTimeShifted=function(t){d.debugLog("[ ConvivaAnalytics ] [ Player Event ] time shifted",t),d.convivaAnalyticsTracker.trackSeekEnd(),d.onPlaybackStateChanged(t)},this.onAudioChanged=function(t){d.debugLog("[ ConvivaAnalytics ] [ Player Event ] audio changed",t),d.convivaAnalyticsTracker.trackUpdateAudioTrack(t.targetAudio)},this.onSubtitleEnabled=function(t){d.debugLog("[ ConvivaAnalytics ] [ Player Event ] subtitled enabled",t),d.convivaAnalyticsTracker.trackUpdateSubtitleTrack(t.subtitle)},this.onSubtitleDisabled=function(t){d.debugLog("[ ConvivaAnalytics ] [ Player Event ] subtitles disabled",t),d.convivaAnalyticsTracker.trackTurnOffSubtitles()},this.onError=function(t){d.debugLog("[ ConvivaAnalytics ] [ Player Event ] error",t),d.convivaAnalyticsTracker.trackError(t)},this.onDestroy=function(t){d.debugLog("[ ConvivaAnalytics ] [ Player Event ] destroy",t),d.destroy(t)},this.convivaAnalyticsTracker=new s.ConvivaAnalyticsTracker(t,e,a),this.debugLoggingEnabled=a.debugLoggingEnabled||!1,this.player=t,this.events=t.exports.PlayerEvent,this.handlers=new r.PlayerEventWrapper(t),this.registerPlayerEvents(),this.convivaSsaiAnalytics=new o.ConvivaAnalyticsSsai(this.convivaAnalyticsTracker),this.ssai={get isAdBreakActive(){return this.convivaSsaiAnalytics.isAdBreakActive},reportAdBreakStarted:this.convivaSsaiAnalytics.reportAdBreakStarted.bind(this.convivaSsaiAnalytics),reportAdStarted:this.convivaSsaiAnalytics.reportAdStarted.bind(this.convivaSsaiAnalytics),reportAdFinished:this.convivaSsaiAnalytics.reportAdFinished.bind(this.convivaSsaiAnalytics),reportAdSkipped:this.convivaSsaiAnalytics.reportAdSkipped.bind(this.convivaSsaiAnalytics),reportAdBreakFinished:this.convivaSsaiAnalytics.reportAdBreakFinished.bind(this.convivaSsaiAnalytics)}}return t.prototype.initializeSession=function(){this.convivaAnalyticsTracker.initializeSession()},t.prototype.endSession=function(){this.reset(),this.convivaAnalyticsTracker.endSession()},t.prototype.reset=function(){this.lastAdBreakEvent=null,this.convivaSsaiAnalytics.reset()},t.prototype.sendCustomApplicationEvent=function(t,e){void 0===e&&(e={}),this.convivaAnalyticsTracker.sendCustomApplicationEvent(t,e)},t.prototype.sendCustomPlaybackEvent=function(t,e){void 0===e&&(e={}),this.convivaAnalyticsTracker.sendCustomPlaybackEvent(t,e)},t.prototype.updateContentMetadata=function(t){this.convivaAnalyticsTracker.updateContentMetadata(t)},t.prototype.reportPlaybackDeficiency=function(t,e,a){void 0===a&&(a=!0),this.convivaAnalyticsTracker.reportPlaybackDeficiency(t,e,a)},t.prototype.pauseTracking=function(){this.convivaAnalyticsTracker.pauseTracking()},t.prototype.resumeTracking=function(){this.convivaAnalyticsTracker.resumeTracking()},t.prototype.release=function(){this.destroy(),this.convivaAnalyticsTracker.release()},t.prototype.destroy=function(t){this.reset(),this.unregisterPlayerEvents(),this.convivaAnalyticsTracker.release(t)},t.prototype.debugLog=function(t){for(var e=[],a=1;a<arguments.length;a++)e[a-1]=arguments[a];this.debugLoggingEnabled&&console.log.apply(console,arguments)},t.prototype.registerPlayerEvents=function(){this.handlers.add(this.events.Play,this.onPlay),this.handlers.add(this.events.Playing,this.onPlaying),this.handlers.add(this.events.Paused,this.onPlaybackStateChanged),this.handlers.add(this.events.StallStarted,this.onPlaybackStateChanged),this.handlers.add(this.events.StallEnded,this.onPlaybackStateChanged),this.handlers.add(this.events.PlaybackFinished,this.onPlaybackFinished),this.handlers.add(this.events.VideoPlaybackQualityChanged,this.onVideoQualityChanged),this.handlers.add(this.events.AudioPlaybackQualityChanged,this.onCustomEvent),this.handlers.add(this.events.Muted,this.onCustomEvent),this.handlers.add(this.events.Unmuted,this.onCustomEvent),this.handlers.add(this.events.ViewModeChanged,this.onCustomEvent),this.handlers.add(this.events.AdStarted,this.onAdStarted),this.handlers.add(this.events.AdFinished,this.onAdFinished),this.handlers.add(this.events.AdBreakStarted,this.onAdBreakStarted),this.handlers.add(this.events.AdBreakFinished,this.onAdBreakFinished),this.handlers.add(this.events.AdSkipped,this.onAdSkipped),this.handlers.add(this.events.AdError,this.onAdError),this.handlers.add(this.events.Error,this.onError),this.handlers.add(this.events.Destroy,this.onDestroy),this.handlers.add(this.events.Seek,this.onSeek),this.handlers.add(this.events.Seeked,this.onSeeked),this.handlers.add(this.events.TimeShift,this.onTimeShift),this.handlers.add(this.events.TimeShifted,this.onTimeShifted),this.handlers.add(this.events.AudioChanged,this.onAudioChanged),this.handlers.add(this.events.SubtitleEnabled,this.onSubtitleEnabled),this.handlers.add(this.events.SubtitleDisabled,this.onSubtitleDisabled),this.handlers.add(this.events.CastStarted,this.onCustomEvent),this.handlers.add(this.events.CastStopped,this.onCustomEvent)},t.prototype.unregisterPlayerEvents=function(){this.handlers.clear()},t}();e.ConvivaAnalytics=d},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ObjectUtils=void 0,function(t){t.flatten=function(t,e){void 0===e&&(e="");var a={},i=function(t,e){for(var n in t)if(t.hasOwnProperty(n)){var s=t[n];"object"==typeof s?i(s,e+n+"."):a[e+n]=String(s)}};return i(t,e),a}}(e.ObjectUtils||(e.ObjectUtils={}))},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Html5Http=void 0;var i=function(){function t(){}return t.prototype.makeRequest=function(t,e,a,i,n,s){return this.makeRequestStandard.apply(this,arguments)},t.prototype.release=function(){},t.prototype.makeRequestStandard=function(t,e,a,i,n,s){var o=new XMLHttpRequest;return o.open(t,e,!0),i&&o.overrideMimeType&&o.overrideMimeType(i),i&&o.setRequestHeader&&o.setRequestHeader("Content-Type",i),n>0&&(o.timeout=n,o.ontimeout=function(){o.ontimeout=o.onreadystatechange=null,s&&s(!1,"timeout after "+n+" ms")}),o.onreadystatechange=function(){4===o.readyState&&(o.ontimeout=o.onreadystatechange=null,200===o.status?s&&s(!0,o.responseText):s&&s(!1,"http status "+o.status))},o.send(a),null},t}();e.Html5Http=i},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Html5Logging=void 0;var i=a(0),n=function(){function t(){}return t.prototype.consoleLog=function(t,e){"undefined"!=typeof console&&(console.log&&e===i.SystemSettings.LogLevel.DEBUG||e===i.SystemSettings.LogLevel.INFO?console.log(t):console.warn&&e===i.SystemSettings.LogLevel.WARNING?console.warn(t):console.error&&e===i.SystemSettings.LogLevel.ERROR&&console.error(t))},t.prototype.release=function(){},t}();e.Html5Logging=n},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Html5Storage=void 0;var i=function(){function t(){}return t.prototype.saveData=function(t,e,a,i){var n=t+"."+e;try{localStorage.setItem(n,a),i(!0,null)}catch(t){i(!1,t.toString())}},t.prototype.loadData=function(t,e,a){var i=t+"."+e;try{a(!0,localStorage.getItem(i))}catch(t){a(!1,t.toString())}},t.prototype.release=function(){},t}();e.Html5Storage=i},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Html5Time=void 0;var i=function(){function t(){}return t.prototype.getEpochTimeMs=function(){return(new Date).getTime()},t.prototype.release=function(){},t}();e.Html5Time=i},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Html5Timer=void 0;var i=function(){function t(){}return t.prototype.createTimer=function(t,e,a){var i=window.setInterval(t,e);return function(){-1!==i&&(clearInterval(i),i=-1)}},t.prototype.release=function(){},t}();e.Html5Timer=i},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e,a){void 0===a&&(a=!1),this.delay=t,this.callback=e,this.repeat=a,this.timeoutOrIntervalId=0}return t.prototype.start=function(){return this.reset(),this},t.prototype.clear=function(){this.clearInternal()},t.prototype.reset=function(){this.clearInternal(),this.repeat?this.timeoutOrIntervalId=setInterval(this.callback,this.delay):this.timeoutOrIntervalId=setTimeout(this.callback,this.delay)},t.prototype.clearInternal=function(){this.repeat?clearInterval(this.timeoutOrIntervalId):clearTimeout(this.timeoutOrIntervalId)},t}();e.Timeout=i},function(t,e,a){"use strict";var i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,a=1,i=arguments.length;a<i;a++)for(var n in e=arguments[a])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.ContentMetadataBuilder=void 0;var n=a(0),s=function(){function t(t){this.metadataOverrides={},this.metadata={},this.latestBuiltMetadata={},this.playbackStarted=!1,this.logger=t}return t.prototype.setOverrides=function(t){this.playbackStarted&&this.logger.consoleLog("[ Conviva Analytics ] Playback has started. Only some metadata attributes will be updated",n.SystemSettings.LogLevel.WARNING),this.metadataOverrides=i(i({},this.metadataOverrides),t)},t.prototype.getOverrides=function(){return this.metadataOverrides},t.prototype.setPlaybackStarted=function(t){this.playbackStarted=t},t.prototype.getStaticMetadata=function(){var t={};return this.playbackStarted?(t.assetName=this.latestBuiltMetadata.assetName,t.viewerId=this.latestBuiltMetadata.viewerId,t.streamType=this.latestBuiltMetadata.streamType,t.applicationName=this.latestBuiltMetadata.applicationName,t.duration=this.latestBuiltMetadata.duration,t.custom=this.latestBuiltMetadata.custom):(t.assetName=this.latestBuiltMetadata.assetName||this.assetName,t.viewerId=this.viewerId,t.streamType=this.metadataOverrides.streamType||this.metadata.streamType,t.applicationName=this.metadataOverrides.applicationName||this.metadata.applicationName,t.duration=this.metadataOverrides.duration||this.metadata.duration,t.custom=i(i(i({},this.metadataOverrides.custom),this.metadataOverrides.additionalStandardTags),this.metadata.custom)),t},t.prototype.getDynamicMetadata=function(){return{encodedFrameRate:this.metadataOverrides.encodedFrameRate||this.metadata.encodedFrameRate,defaultResource:this.metadataOverrides.defaultResource||this.metadata.defaultResource,streamUrl:this.metadataOverrides.streamUrl||this.metadata.streamUrl}},t.prototype.build=function(){var t,e=i(i({},this.getStaticMetadata()),this.getDynamicMetadata());this.latestBuiltMetadata=e;var a=((t={})[n.Constants.ASSET_NAME]=e.assetName,t[n.Constants.ENCODED_FRAMERATE]=e.encodedFrameRate,t[n.Constants.DURATION]=e.duration,t[n.Constants.DEFAULT_RESOURCE]=e.defaultResource,t[n.Constants.STREAM_URL]=e.streamUrl,t[n.Constants.IS_LIVE]=e.streamType,t[n.Constants.VIEWER_ID]=e.viewerId||"GET_VIEWER_ID_FROM_PLAYER",t[n.Constants.PLAYER_NAME]=e.applicationName||"GET_PLAYER_NAME_OR_TYPE",t);return i(i({},a),e.custom)},Object.defineProperty(t.prototype,"assetName",{get:function(){return this.metadataOverrides.assetName||this.metadata.assetName},set:function(t){this.metadata.assetName=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewerId",{get:function(){return this.metadataOverrides.viewerId||this.metadata.viewerId},set:function(t){this.metadata.viewerId=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"streamType",{set:function(t){this.metadata.streamType=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"applicationName",{set:function(t){this.metadata.applicationName=t},enumerable:!1,configurable:!0}),t.prototype.addToCustom=function(t){this.metadata.custom=i(i({},this.metadata.custom),t)},Object.defineProperty(t.prototype,"duration",{set:function(t){this.metadata.duration=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"encodedFrameRate",{set:function(t){this.metadata.encodedFrameRate=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"defaultResource",{set:function(t){this.metadata.defaultResource=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"streamUrl",{set:function(t){this.metadata.streamUrl=t},enumerable:!1,configurable:!0}),t.prototype.reset=function(){this.metadataOverrides={},this.metadata={},this.playbackStarted=!1,this.latestBuiltMetadata={}},t}();e.ContentMetadataBuilder=s},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.remove=function(t,e){var a=t.indexOf(e);return a>-1?t.splice(a,1)[0]:null}}(e.ArrayUtils||(e.ArrayUtils={}))},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PlayerConfigHelper=void 0;var i=a(17),n=function(){function t(){}return t.getAutoplayConfig=function(e){var a=e.getConfig();return a.playback&&void 0!==a.playback.autoplay?a.playback.autoplay:t.AUTOPLAY_DEFAULT_CONFIG},t.getPreloadConfig=function(t){var e=t.getConfig();if(i.BrowserUtils.isMobile()){if(e.adaptation&&e.adaptation.mobile&&void 0!==e.adaptation.mobile.preload)return e.adaptation.mobile.preload}else if(e.adaptation&&e.adaptation.desktop&&void 0!==e.adaptation.desktop.preload)return e.adaptation.desktop.preload;return e.adaptation&&void 0!==e.adaptation.preload?e.adaptation.preload:!t.isLive()},t.AUTOPLAY_DEFAULT_CONFIG=!1,t}();e.PlayerConfigHelper=n},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BrowserUtils=void 0;var i=function(){function t(){}return t.isMobile=function(){var t=/Android/i.test(navigator.userAgent),e=/IEMobile/i.test(navigator.userAgent),a=/Windows Phone 10.0/i.test(navigator.userAgent),i=/Safari/i.test(navigator.userAgent)&&/Mobile/i.test(navigator.userAgent);return t||e||a||i},t}();e.BrowserUtils=i},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PlayerStateHelper=void 0;var i=a(0),n=function(){function t(){}return t.getPlayerStateFromEvent=function(t,e,a){var n;switch(t.type){case e.StallStarted:n=i.Constants.PlayerState.BUFFERING;break;case e.Playing:n=i.Constants.PlayerState.PLAYING;break;case e.Paused:n=i.Constants.PlayerState.PAUSED;break;case e.Seeked:case e.TimeShifted:case e.StallEnded:n=a.isPlaying()?i.Constants.PlayerState.PLAYING:i.Constants.PlayerState.PAUSED}return n},t.getPlayerState=function(t){return t.isStalled()?i.Constants.PlayerState.BUFFERING:t.isPlaying()?i.Constants.PlayerState.PLAYING:i.Constants.PlayerState.PAUSED},t}();e.PlayerStateHelper=n},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ConvivaAnalyticsSsai=void 0;var i=a(0),n=a(1),s=function(){function t(t){this._isAdBreakActive=!1,this.convivaAnalyticsTracker=t}return Object.defineProperty(t.prototype,"isAdBreakActive",{get:function(){return this._isAdBreakActive},enumerable:!1,configurable:!0}),t.prototype.reset=function(){this._isAdBreakActive=!1},t.prototype.reportAdBreakStarted=function(){this.convivaAnalyticsTracker.isAdBreakActive||this._isAdBreakActive||(this._isAdBreakActive=!0,this.convivaAnalyticsTracker.trackAdBreakStarted(i.Constants.AdType.SERVER_SIDE))},t.prototype.reportAdStarted=function(t){this._isAdBreakActive&&this.convivaAnalyticsTracker.trackAdStarted(n.AdHelper.convertSsaiAdInfoToConvivaAdInfo(t,this.convivaAnalyticsTracker.getContentMetadata()),i.Constants.AdType.SERVER_SIDE)},t.prototype.reportAdFinished=function(){this.isAdBreakActive&&this.convivaAnalyticsTracker.trackAdFinished()},t.prototype.reportAdSkipped=function(){this._isAdBreakActive&&this.convivaAnalyticsTracker.trackAdSkipped()},t.prototype.reportAdBreakFinished=function(){this._isAdBreakActive&&(this._isAdBreakActive=!1,this.convivaAnalyticsTracker.trackAdBreakFinished())},t}();e.ConvivaAnalyticsSsai=s}])}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@convivainc/conviva-js-coresdk")):"function"==typeof define&&define.amd?define("bitmovin-player-analytics-conviva",["@convivainc/conviva-js-coresdk"],e):"object"==typeof exports?exports["bitmovin-player-analytics-conviva"]=e(require("@convivainc/conviva-js-coresdk")):(t.bitmovin=t.bitmovin||{},t.bitmovin.player=t.bitmovin.player||{},t.bitmovin.player.analytics=e(t.Conviva))}(window,function(t){return function(t){var e={};function a(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,a),n.l=!0,n.exports}return a.m=t,a.c=e,a.d=function(t,e,i){a.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},a.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.t=function(t,e){if(1&e&&(t=a(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(a.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)a.d(i,n,function(e){return t[e]}.bind(null,n));return i},a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,"a",e),e},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.p="",a(a.s=4)}([function(e,a){e.exports=t},function(t,e,a){"use strict";var i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,a=1,i=arguments.length;a<i;a++)for(var n in e=arguments[a])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.AdHelper=void 0;var n=a(0),s=a(2),o=function(){function t(){}return t.mapCsaiAdPosition=function(t,e){return t.scheduleTime<=0?n.Constants.AdPosition.PREROLL:t.scheduleTime>=e.getDuration()?n.Constants.AdPosition.POSTROLL:n.Constants.AdPosition.MIDROLL},t.formatCsaiAdError=function(t){var e,a,i=(null==t?void 0:t.message)||"Unknown message",n=(null==t?void 0:t.name)||"Unknown name";return["Ad error:","".concat(n,";"),(null===(e=t.data)||void 0===e?void 0:e.code)?"Ad error code: ".concat(null===(a=t.data)||void 0===a?void 0:a.code,";"):void 0,"Message:","".concat(i,";"),"Error code: ".concat(t.code,";"),t.troubleShootLink?"Troubleshoot link: ".concat(t.troubleShootLink):void 0].filter(Boolean).join(" ")},t.extractCsaiConvivaAdInfo=function(e,a,i){var s,o,r,c=i.ad,d=c.data,l="NA",v="NA",u="NA",y=c.id;d&&("adSystem"in d&&(null===(o=d.adSystem)||void 0===o?void 0:o.name)&&(l=d.adSystem.name),"creative"in d&&(null===(r=null==d?void 0:d.creative)||void 0===r?void 0:r.id)&&(v=d.creative.id),"adTitle"in d&&d.adTitle&&(u=d.adTitle),"wrapperAdIds"in d&&d.wrapperAdIds&&d.wrapperAdIds.length&&(y=d.wrapperAdIds[d.wrapperAdIds.length-1]));var A=((s={"c3.ad.id":c.id,"c3.ad.technology":n.Constants.AdType.CLIENT_SIDE,"c3.ad.position":t.mapCsaiAdPosition(a.adBreak,e),"c3.ad.system":l,"c3.ad.creativeId":v,"c3.ad.firstAdId":y})[n.Constants.ASSET_NAME]=u,s[n.Constants.STREAM_URL]=c.mediaFileUrl||"NA",s["c3.ad.mediaFileApiFramework"]="NA",s["c3.ad.firstAdSystem"]="NA",s["c3.ad.firstCreativeId"]="NA",s);return"duration"in c&&c.duration&&(A[n.Constants.DURATION]=c.duration),A},t.convertSsaiAdInfoToConvivaAdInfo=function(t,e){var a,o=[s.INTEGRATION_VERSION_CONTENT_METADATA_CUSTOM_TAG,s.STREAM_TYPE_CONTENT_METADATA_CUSTOM_TAG,n.Constants.ASSET_NAME,n.Constants.IS_LIVE,n.Constants.DEFAULT_RESOURCE,n.Constants.ENCODED_FRAMERATE,n.Constants.VIEWER_ID,n.Constants.PLAYER_NAME],r={};o.forEach(function(t){r[t]=e[t]});var c=i(i(i({},r),t.additionalMetadata),((a={"c3.ad.id":t.id,"c3.ad.technology":n.Constants.AdType.SERVER_SIDE,"c3.ad.position":t.position||"NA","c3.ad.system":t.adSystem||"NA"})[n.Constants.ASSET_NAME]=t.title||r[n.Constants.ASSET_NAME]||"NA",a["c3.ad.adStitcher"]=t.adStitcher||"NA",a["c3.ad.isSlate"]=void 0===t.isSlate?"NA":t.isSlate.toString(),a));return t.duration&&(c[n.Constants.DURATION]=t.duration),c},t}();e.AdHelper=o},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ConvivaAnalyticsTracker=e.VR_CONTENT_TYPE_CONTENT_METADATA_CUSTOM_TAG=e.STREAM_TYPE_CONTENT_METADATA_CUSTOM_TAG=e.PLAYER_TYPE_CONTENT_METADATA_CUSTOM_TAG=e.INTEGRATION_VERSION_CONTENT_METADATA_CUSTOM_TAG=e.PRELOAD_CONTENT_METADATA_CUSTOM_TAG=e.AUTOPLAY_CONTENT_METADATA_CUSTOM_TAG=void 0;var i=a(0),n=a(8),s=a(9),o=a(10),r=a(11),c=a(12),d=a(13),l=a(14),v=a(1),u=a(3),y=a(16),A=a(18);e.AUTOPLAY_CONTENT_METADATA_CUSTOM_TAG="autoplay",e.PRELOAD_CONTENT_METADATA_CUSTOM_TAG="preload",e.INTEGRATION_VERSION_CONTENT_METADATA_CUSTOM_TAG="integrationVersion",e.PLAYER_TYPE_CONTENT_METADATA_CUSTOM_TAG="playerType",e.STREAM_TYPE_CONTENT_METADATA_CUSTOM_TAG="streamType",e.VR_CONTENT_TYPE_CONTENT_METADATA_CUSTOM_TAG="vrContentType";var p=function(){function t(e,a,y){var p;void 0===y&&(y={});var h=this;if(this.hasPlayed=!1,this.stallTrackingTimeout=new d.Timeout(t.STALL_TRACKING_DELAY_MS,function(){h._isAdBreakActive?(h.debugLog("[ ConvivaAnalyticsTracker ] report buffering ad playback state"),h.convivaAdAnalytics.reportAdMetric(i.Constants.Playback.PLAYER_STATE,i.Constants.PlayerState.BUFFERING)):(h.debugLog("[ ConvivaAnalyticsTracker ] report buffering playback state"),h.convivaVideoAnalytics.reportPlaybackMetric(i.Constants.Playback.PLAYER_STATE,i.Constants.PlayerState.BUFFERING))}),this.sessionEndedExternally=!1,this.internalEndSession=function(t){h.isSessionActive()&&(h.debugLog("[ ConvivaAnalyticsTracker ] end session",i.Constants.NO_SESSION_KEY,t),h.convivaVideoAnalytics.release(),h.convivaVideoAnalytics=null,h.convivaAdAnalytics.release(),h.convivaAdAnalytics=null,h.hasPlayed=!1,h._isAdBreakActive=!1)},this.onSourceLoaded=function(t){h.debugLog("[ ConvivaAnalyticsTracker ] [ Player Event ] source loaded",t),h.isSessionActive()&&(h.buildSourceRelatedMetadata(h.player.getSource()),h.updateSession())},this.onPlay=function(t){h.debugLog("[ ConvivaAnalyticsTracker ] [ Player Event ] play"),h.canTrackPlayEvent&&(h.isSessionActive()||h.sessionEndedExternally||h.internalInitializeSession(),h.hasPlayed||(h.hasPlayed=!0,h.trackUpdateAudioTrack(h.player.getAudio()),h.trackInitialSubtitles()))},this.onPlaying=function(t){h.debugLog("[ ConvivaAnalyticsTracker ] [ Player Event ] playing",t),h.isSessionActive()&&(h.contentMetadataBuilder.setPlaybackStarted(!0),h.updateSession())},this.onPlaybackFinished=function(t){h.debugLog("[ ConvivaAnalyticsTracker ] [ Player Event ] playback finished",t),h.isSessionActive()&&(h.convivaVideoAnalytics.release(),h.convivaVideoAnalytics=null,h.convivaAdAnalytics.release(),h.convivaAdAnalytics=null)},this.trackVideoQualityChanged=function(t){if(h.isSessionActive()){var e=Math.round(t.targetQuality.bitrate/1e3);h.debugLog("[ ConvivaAnalyticsTracker ] report bitrate",{event:t,bitrateKbps:e}),h.convivaVideoAnalytics.reportPlaybackMetric(i.Constants.Playback.BITRATE,e)}},this.trackAdBreakStarted=function(t){h.isSessionActive()&&(h._isAdBreakActive=!0,h.debugLog("[ ConvivaAnalyticsTracker ] report ad break started",{type:t}),h.convivaVideoAnalytics.reportAdBreakStarted(t,t===i.Constants.AdType.CLIENT_SIDE?i.Constants.AdPlayer.SEPARATE:i.Constants.AdPlayer.CONTENT))},this.trackAdStarted=function(t,e,a){if(h.isSessionActive()){if(h.debugLog("[ ConvivaAnalyticsTracker ] report ad started",{adInfo:t,type:e,bitrateKbps:a}),h.convivaAdAnalytics.reportAdStarted(t),h.debugLog("[ ConvivaAnalyticsTracker ] report ".concat(A.PlayerStateHelper.getPlayerState(h.player)," ad playback state")),h.convivaAdAnalytics.reportAdMetric(i.Constants.Playback.PLAYER_STATE,A.PlayerStateHelper.getPlayerState(h.player)),e===i.Constants.AdType.SERVER_SIDE){var n=h.player.getPlaybackVideoData(),s="".concat(n.width,"x").concat(n.height);h.debugLog("[ ConvivaAnalyticsTracker ] report ad resolution",s),h.convivaAdAnalytics.reportAdMetric(i.Constants.Playback.RESOLUTION,s),n.frameRate&&(h.debugLog("[ ConvivaAnalyticsTracker ] report framerate",n.frameRate),h.convivaAdAnalytics.reportAdMetric(i.Constants.Playback.RENDERED_FRAMERATE,n.frameRate))}a&&(h.debugLog("[ ConvivaAnalyticsTracker ] report ad bitrate",a),h.convivaAdAnalytics.reportAdMetric(i.Constants.Playback.BITRATE,a))}},this.trackAdFinished=function(){h.isSessionActive()&&(h.debugLog("[ ConvivaAnalyticsTracker ] report ad ended"),h.convivaAdAnalytics.reportAdEnded())},this.trackAdSkipped=function(){h.isSessionActive()&&(h.debugLog("[ ConvivaAnalyticsTracker ] report ad skipped"),h.convivaAdAnalytics.reportAdSkipped())},this.trackAdBreakFinished=function(){h.isSessionActive()&&(h._isAdBreakActive=!1,h.debugLog("[ ConvivaAnalyticsTracker ] report ad break ended"),h.convivaVideoAnalytics.reportAdBreakEnded(),h.debugLog("[ ConvivaAnalyticsTracker ] report ".concat(A.PlayerStateHelper.getPlayerState(h.player)," playback state")),h.convivaVideoAnalytics.reportPlaybackMetric(i.Constants.Playback.PLAYER_STATE,A.PlayerStateHelper.getPlayerState(h.player)))},this.trackAdError=function(t){if(h.isSessionActive()){var e=v.AdHelper.formatCsaiAdError(t);h.debugLog("[ ConvivaAnalyticsTracker ] report ad error",{event:t,formattedError:e}),h.convivaAdAnalytics.reportAdError(e,i.Constants.ErrorSeverity.WARNING)}},this.trackError=function(t){h.isSessionActive()||h.sessionEndedExternally||h.internalInitializeSession(),h.debugLog("[ ConvivaAnalyticsTracker ] report playback deficiency",t),h.reportPlaybackDeficiency(String(t.code)+" "+t.name,i.Constants.ErrorSeverity.FATAL)},this.onSourceUnloaded=function(t){h.debugLog("[ ConvivaAnalyticsTracker ] [ Player Event ] source unloaded",t),h._isAdBreakActive||(h.internalEndSession(t),h.resetContentMetadata())},this.onDestroy=function(t){h.debugLog("[ ConvivaAnalyticsTracker ] [ Player Event ] destroy",t),h.release(t)},void 0!==i)if(e.getSource())console.error("Bitmovin Conviva integration must be instantiated before calling player.load()");else{this.player=e,this.events=e.exports.PlayerEvent,this.handlers=new u.PlayerEventWrapper(e),this.config=y,this.config.debugLoggingEnabled=this.config.debugLoggingEnabled||!1,this.logger=new s.Html5Logging,this.sessionKey=i.Constants.NO_SESSION_KEY,this._isAdBreakActive=!1;var g=this.config.deviceMetadata||{},f=((p={})[i.Constants.DeviceMetadata.CATEGORY]=g.category||this.config.deviceCategory||i.Constants.DeviceCategory.WEB,p[i.Constants.DeviceMetadata.BRAND]=g.brand,p[i.Constants.DeviceMetadata.MANUFACTURER]=g.manufacturer,p[i.Constants.DeviceMetadata.MODEL]=g.model,p[i.Constants.DeviceMetadata.TYPE]=g.type,p[i.Constants.DeviceMetadata.VERSION]=g.version,p[i.Constants.DeviceMetadata.OS_NAME]=g.osName,p[i.Constants.DeviceMetadata.OS_VERSION]=g.osVersion,p);i.Analytics.setDeviceMetadata(f);var T={};T[i.Constants.CallbackFunctions.CONSOLE_LOG]=this.logger.consoleLog,T[i.Constants.CallbackFunctions.MAKE_REQUEST]=(new n.Html5Http).makeRequest;var S=new o.Html5Storage;T[i.Constants.CallbackFunctions.SAVE_DATA]=S.saveData,T[i.Constants.CallbackFunctions.LOAD_DATA]=S.loadData,T[i.Constants.CallbackFunctions.CREATE_TIMER]=(new c.Html5Timer).createTimer,T[i.Constants.CallbackFunctions.GET_EPOCH_TIME_IN_MS]=(new r.Html5Time).getEpochTimeMs;var k={};k[i.Constants.GATEWAY_URL]=y.gatewayUrl,k[i.Constants.LOG_LEVEL]=this.config.debugLoggingEnabled?i.Constants.LogLevel.DEBUG:i.Constants.LogLevel.NONE,i.Analytics.init(a,T,k),this.contentMetadataBuilder=new l.ContentMetadataBuilder(this.logger),this.registerPlayerEvents()}else console.error("Conviva script missing, cannot init ConvivaAnalytics. Please load the Conviva script (conviva-core-sdk.min.js) before Bitmovin's ConvivaAnalytics integration.")}return Object.defineProperty(t.prototype,"isAdBreakActive",{get:function(){return this._isAdBreakActive},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canTrackPlayEvent",{get:function(){return!this._isAdBreakActive},enumerable:!1,configurable:!0}),t.prototype.getContentMetadata=function(){return this.contentMetadataBuilder.build()},t.prototype.initializeSession=function(){if(this.isSessionActive())this.logger.consoleLog("[ ConvivaAnalyticsTracker ] There is already a session running.",i.SystemSettings.LogLevel.WARNING);else{if(!this.player.getSource()&&!this.contentMetadataBuilder.assetName)throw"AssetName is missing. Load player source first or set assetName via updateContentMetadata";this.internalInitializeSession(),this.sessionEndedExternally=!1}},t.prototype.endSession=function(){this.isSessionActive()&&(this._isAdBreakActive&&(this.debugLog("[ ConvivaAnalyticsTracker ] report ad skipped"),this.convivaAdAnalytics.reportAdSkipped()),this.debugLog("[ ConvivaAnalyticsTracker ] report playback ended state"),this.convivaVideoAnalytics.reportPlaybackEnded(),this.internalEndSession(),this.resetContentMetadata(),this.sessionEndedExternally=!0)},t.prototype.sendCustomApplicationEvent=function(t,e){void 0===e&&(e={}),this.isSessionActive()?(this.debugLog("[ ConvivaAnalyticsTracker ] report custom app event",{eventName:t,eventAttributes:e}),this.convivaVideoAnalytics.reportAppEvent(t,e)):this.logger.consoleLog("[ ConvivaAnalyticsTracker ] cannot send application event, no active monitoring session",i.SystemSettings.LogLevel.WARNING)},t.prototype.sendCustomPlaybackEvent=function(t,e){void 0===e&&(e={}),this.isSessionActive()?(this.debugLog("[ ConvivaAnalyticsTracker ] report custom playback event",{eventName:t,eventAttributes:e}),this.convivaVideoAnalytics.reportPlaybackEvent(t,e)):this.logger.consoleLog("[ ConvivaAnalyticsTracker ] cannot send playback event, no active monitoring session",i.SystemSettings.LogLevel.WARNING)},t.prototype.updateContentMetadata=function(t){this.internalUpdateContentMetadata(t)},t.prototype.reportPlaybackDeficiency=function(t,e,a){void 0===a&&(a=!0),this.isSessionActive()&&(this.debugLog("[ ConvivaAnalyticsTracker ] report playback failed",{message:t}),this.convivaVideoAnalytics.reportPlaybackFailed(t),a&&(this.internalEndSession(),this.resetContentMetadata()))},t.prototype.pauseTracking=function(){this.debugLog("[ ConvivaAnalyticsTracker ] pause tracking via ad break started reporting"),this.convivaVideoAnalytics.reportAdBreakStarted(i.Constants.AdType.CLIENT_SIDE,i.Constants.AdPlayer.SEPARATE)},t.prototype.resumeTracking=function(){this.debugLog("[ ConvivaAnalyticsTracker ] resume tracking via ad break ended reporting"),this.convivaVideoAnalytics.reportAdBreakEnded()},t.prototype.release=function(t){this.debugLog("[ ConvivaAnalyticsTracker ] releasing",t),this.unregisterPlayerEvents(),this.internalEndSession(t),i.Analytics.release()},t.prototype.debugLog=function(t){for(var e=[],a=1;a<arguments.length;a++)e[a-1]=arguments[a];this.config.debugLoggingEnabled&&console.log.apply(console,arguments)},t.prototype.getUrlFromSource=function(t){switch(this.player.getStreamType()){case"dash":return t.dash;case"hls":return t.hls;case"progressive":return Array.isArray(t.progressive)?t.progressive[0].url:t.progressive}},t.prototype.internalUpdateContentMetadata=function(t){this.contentMetadataBuilder.setOverrides(t),this.isSessionActive()?(this.buildContentMetadata(),this.updateSession()):this.logger.consoleLog("[ ConvivaAnalyticsTracker ] no active session. Content metadata will be propagated to Conviva on session initialization.",i.SystemSettings.LogLevel.DEBUG)},t.prototype.internalInitializeSession=function(){var t,e=this;this.debugLog("[ ConvivaAnalyticsTracker ] initializing session"),this.buildContentMetadata(),this.convivaVideoAnalytics=i.Analytics.buildVideoAnalytics(),this.convivaAdAnalytics=i.Analytics.buildAdAnalytics(this.convivaVideoAnalytics);var a=((t={})[i.Constants.FRAMEWORK_NAME]="Bitmovin Player",t[i.Constants.FRAMEWORK_VERSION]=this.player.version,t);this.convivaVideoAnalytics.setPlayerInfo(a),this.convivaAdAnalytics.setAdPlayerInfo(a),this.debugLog("[ ConvivaAnalyticsTracker ] report playback requested"),this.convivaVideoAnalytics.reportPlaybackRequested(this.contentMetadataBuilder.build()),this.sessionKey=this.convivaVideoAnalytics.getSessionId(),this.debugLog("[ ConvivaAnalyticsTracker ] new session key",this.sessionKey),this.convivaVideoAnalytics.setCallback(function(){var t=1e3*e.player.getCurrentTime("relativetime");e._isAdBreakActive?(e.debugLog("[ ConvivaAnalyticsTracker ] report ad player head time",t),e.convivaAdAnalytics.reportAdMetric(i.Constants.Playback.PLAY_HEAD_TIME,t)):(e.debugLog("[ ConvivaAnalyticsTracker ] report player head time",t),e.convivaVideoAnalytics.reportPlaybackMetric(i.Constants.Playback.PLAY_HEAD_TIME,t))}),this.isSessionActive()||this.logger.consoleLog("[ ConvivaAnalyticsTracker ] Something went wrong, could not obtain session key",i.SystemSettings.LogLevel.ERROR)},t.prototype.buildContentMetadata=function(){var a;this.contentMetadataBuilder.duration=this.player.getDuration(),this.contentMetadataBuilder.streamType=this.player.isLive()?i.ContentMetadata.StreamType.LIVE:i.ContentMetadata.StreamType.VOD,this.contentMetadataBuilder.addToCustom(((a={})[e.AUTOPLAY_CONTENT_METADATA_CUSTOM_TAG]=y.PlayerConfigHelper.getAutoplayConfig(this.player)+"",a[e.PRELOAD_CONTENT_METADATA_CUSTOM_TAG]=y.PlayerConfigHelper.getPreloadConfig(this.player)+"",a[e.INTEGRATION_VERSION_CONTENT_METADATA_CUSTOM_TAG]=t.VERSION,a));var n=this.player.getSource();n&&this.buildSourceRelatedMetadata(n)},t.prototype.buildSourceRelatedMetadata=function(t){var a;this.contentMetadataBuilder.assetName=this.getAssetNameFromSource(t),this.contentMetadataBuilder.viewerId=this.contentMetadataBuilder.viewerId,this.contentMetadataBuilder.addToCustom(((a={})[e.PLAYER_TYPE_CONTENT_METADATA_CUSTOM_TAG]=this.player.getPlayerType(),a[e.STREAM_TYPE_CONTENT_METADATA_CUSTOM_TAG]=this.player.getStreamType(),a[e.VR_CONTENT_TYPE_CONTENT_METADATA_CUSTOM_TAG]=t.vr&&t.vr.contentType,a)),this.contentMetadataBuilder.streamUrl=this.getUrlFromSource(t)},t.prototype.updateSession=function(){this.isSessionActive()&&this.convivaVideoAnalytics.setContentInfo(this.contentMetadataBuilder.build())},t.prototype.getAssetNameFromSource=function(t){var e=t.title;return e||"Untitled (no source.title set)"},t.prototype.resetContentMetadata=function(){this.contentMetadataBuilder.reset()},t.prototype.isSessionActive=function(){return!!this.convivaVideoAnalytics},t.prototype.trackPlaybackStateChanged=function(t){if(this.isSessionActive()){var e=A.PlayerStateHelper.getPlayerStateFromEvent(t,this.events,this.player),a=[this.events.Play,this.events.Seek,this.events.TimeShift],n=[this.events.StallStarted,this.events.Playing,this.events.Paused,this.events.Seeked,this.events.TimeShifted,this.events.StallEnded,this.events.PlaybackFinished];-1!==a.indexOf(t.type)?this.stallTrackingTimeout.start():-1!==n.indexOf(t.type)&&this.stallTrackingTimeout.clear(),e&&(this._isAdBreakActive?(this.debugLog("[ ConvivaAnalyticsTracker ] report ad playback state",e),this.convivaAdAnalytics.reportAdMetric(i.Constants.Playback.PLAYER_STATE,e)):(this.debugLog("[ ConvivaAnalyticsTracker ] report playback state",e),this.convivaVideoAnalytics.reportPlaybackMetric(i.Constants.Playback.PLAYER_STATE,e))),t.type===this.events.PlaybackFinished&&(this.debugLog("[ ConvivaAnalyticsTracker ] report playback ended"),this.convivaVideoAnalytics.reportPlaybackEnded())}},t.prototype.trackSeekStart=function(t){this.isSessionActive()&&(this.debugLog("[ ConvivaAnalyticsTracker ] report seek started"),this.convivaVideoAnalytics.reportPlaybackMetric(i.Constants.Playback.SEEK_STARTED,t))},t.prototype.trackSeekEnd=function(){this.isSessionActive()&&(this.debugLog("[ ConvivaAnalyticsTracker ] report seek ended"),this.convivaVideoAnalytics.reportPlaybackMetric(i.Constants.Playback.SEEK_ENDED))},t.prototype.trackUpdateAudioTrack=function(t){if(this.isSessionActive()){var e="unknown"!==t.lang?"["+t.lang+"]:"+t.label:t.label;this.debugLog("[ ConvivaAnalyticsTracker ] report audio language",{formattedAudio:e}),this.convivaVideoAnalytics.reportPlaybackMetric(i.Constants.Playback.AUDIO_LANGUAGE,e)}},t.prototype.trackUpdateSubtitleTrack=function(t){if(this.isSessionActive()){var e="unknown"!==t.lang?"["+t.lang+"]:"+t.label:t.label;"subtitles"===t.kind?(this.debugLog("[ ConvivaAnalyticsTracker ] report subtitles language",{formattedSubtitle:e}),this.convivaVideoAnalytics.reportPlaybackMetric(i.Constants.Playback.SUBTITLES_LANGUAGE,e),this.debugLog("[ ConvivaAnalyticsTracker ] report off closed captions language"),this.convivaVideoAnalytics.reportPlaybackMetric(i.Constants.Playback.CLOSED_CAPTIONS_LANGUAGE,"off")):"captions"===t.kind?(this.debugLog("[ ConvivaAnalyticsTracker ] report closed captions language",{formattedSubtitle:e}),this.convivaVideoAnalytics.reportPlaybackMetric(i.Constants.Playback.CLOSED_CAPTIONS_LANGUAGE,e),this.debugLog("[ ConvivaAnalyticsTracker ] report off subtitles language"),this.convivaVideoAnalytics.reportPlaybackMetric(i.Constants.Playback.SUBTITLES_LANGUAGE,"off")):this.trackTurnOffSubtitles()}},t.prototype.trackInitialSubtitles=function(){if(this.isSessionActive()){if(void 0!==this.player.subtitles){var t=this.player.subtitles.list().filter(function(t){return t.enabled});if(1===t.length)return void this.trackUpdateSubtitleTrack(t[0])}this.trackTurnOffSubtitles()}},t.prototype.trackTurnOffSubtitles=function(){this.isSessionActive()&&(this.debugLog("[ ConvivaAnalyticsTracker ] report off subtitles language"),this.convivaVideoAnalytics.reportPlaybackMetric(i.Constants.Playback.SUBTITLES_LANGUAGE,"off"),this.debugLog("[ ConvivaAnalyticsTracker ] report off closed captions language"),this.convivaVideoAnalytics.reportPlaybackMetric(i.Constants.Playback.CLOSED_CAPTIONS_LANGUAGE,"off"))},t.prototype.registerPlayerEvents=function(){this.handlers.add(this.events.SourceLoaded,this.onSourceLoaded),this.handlers.add(this.events.Play,this.onPlay),this.handlers.add(this.events.Playing,this.onPlaying),this.handlers.add(this.events.PlaybackFinished,this.onPlaybackFinished),this.handlers.add(this.events.SourceUnloaded,this.onSourceUnloaded),this.handlers.add(this.events.Destroy,this.onDestroy)},t.prototype.unregisterPlayerEvents=function(){this.handlers.clear()},Object.defineProperty(t,"version",{get:function(){return t.VERSION},enumerable:!1,configurable:!0}),t.VERSION="5.3.0",t.STALL_TRACKING_DELAY_MS=100,t}();e.ConvivaAnalyticsTracker=p},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PlayerEventWrapper=void 0;var i=a(15),n=function(){function t(t){this.player=t,this.eventHandlers={}}return t.prototype.add=function(t,e){this.player.on(t,e),this.eventHandlers[t]||(this.eventHandlers[t]=[]),this.eventHandlers[t].push(e)},t.prototype.remove=function(t,e){this.player.off(t,e),this.eventHandlers[t]&&i.ArrayUtils.remove(this.eventHandlers[t],e)},t.prototype.clear=function(){for(var t in this.eventHandlers)for(var e=0,a=this.eventHandlers[t];e<a.length;e++){var i=a[e];this.remove(t,i)}},t}();e.PlayerEventWrapper=n},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ConvivaAnalytics=void 0,a(5);var i=a(6);Object.defineProperty(e,"ConvivaAnalytics",{enumerable:!0,get:function(){return i.ConvivaAnalytics}})},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ConvivaAnalytics=void 0;var i=a(0),n=a(7),s=a(2),o=a(19),r=a(3),c=a(1),d=function(){function t(t,e,a){void 0===a&&(a={});var d=this;this.onPlaybackStateChanged=function(t){d.debugLog("[ ConvivaAnalytics ] [ Player Event ] playback state change related event",t),d.convivaAnalyticsTracker.trackPlaybackStateChanged(t)},this.onPlay=function(t){d.debugLog("[ ConvivaAnalytics ] [ Player Event ] play",t),d.convivaAnalyticsTracker.canTrackPlayEvent&&d.onPlaybackStateChanged(t)},this.onPlaying=function(t){d.debugLog("[ ConvivaAnalytics ] [ Player Event ] playing",t),d.onPlaybackStateChanged(t)},this.onPlaybackFinished=function(t){d.debugLog("[ ConvivaAnalytics ] [ Player Event ] playback finished",t),d.onPlaybackStateChanged(t)},this.onVideoQualityChanged=function(t){d.debugLog("[ ConvivaAnalytics ] [ Player Event ] video quality changed",t),d.convivaAnalyticsTracker.trackVideoQualityChanged(t)},this.onCustomEvent=function(t){d.debugLog("[ ConvivaAnalytics ] [ Player Event ] custom playback related event",t);var e=n.ObjectUtils.flatten(t);d.sendCustomPlaybackEvent(t.type,e)},this.onAdBreakStarted=function(t){d.debugLog("[ ConvivaAnalytics ] [ Player Event ] adbreak started",t),d.lastAdBreakEvent=t,d.convivaAnalyticsTracker.trackAdBreakStarted(i.Constants.AdType.CLIENT_SIDE)},this.onAdStarted=function(t){var e;d.debugLog("[ ConvivaAnalytics ] [ Player Event ] ad started",t);var a=c.AdHelper.extractCsaiConvivaAdInfo(d.player,d.lastAdBreakEvent,t),n=null===(e=t.ad.data)||void 0===e?void 0:e.bitrate;d.convivaAnalyticsTracker.trackAdStarted(a,i.Constants.AdType.CLIENT_SIDE,n)},this.onAdFinished=function(t){d.debugLog("[ ConvivaAnalytics ] [ Player Event ] ad finished",t),d.convivaAnalyticsTracker.trackAdFinished()},this.onAdSkipped=function(t){d.debugLog("[ ConvivaAnalytics ] [ Player Event ] ad skipped",t),d.convivaAnalyticsTracker.trackAdSkipped(),d.onCustomEvent(t)},this.onAdBreakFinished=function(t){d.debugLog("[ ConvivaAnalytics ] [ Player Event ] adbreak finished",t),d.convivaAnalyticsTracker.trackAdBreakFinished()},this.onAdError=function(t){d.debugLog("[ ConvivaAnalytics ] [ Player Event ] ad error",t),d.convivaAnalyticsTracker.trackAdError(t),d.onCustomEvent(t)},this.onSeek=function(t){d.debugLog("[ ConvivaAnalytics ] [ Player Event ] seek",t),d.convivaAnalyticsTracker.trackSeekStart(t.seekTarget),d.onPlaybackStateChanged(t)},this.onSeeked=function(t){d.debugLog("[ ConvivaAnalytics ] [ Player Event ] seeked",t),d.convivaAnalyticsTracker.trackSeekEnd(),d.onPlaybackStateChanged(t)},this.onTimeShift=function(t){d.debugLog("[ ConvivaAnalytics ] [ Player Event ] time shift",t),d.convivaAnalyticsTracker.trackSeekStart(-1),d.onPlaybackStateChanged(t)},this.onTimeShifted=function(t){d.debugLog("[ ConvivaAnalytics ] [ Player Event ] time shifted",t),d.convivaAnalyticsTracker.trackSeekEnd(),d.onPlaybackStateChanged(t)},this.onAudioChanged=function(t){d.debugLog("[ ConvivaAnalytics ] [ Player Event ] audio changed",t),d.convivaAnalyticsTracker.trackUpdateAudioTrack(t.targetAudio)},this.onSubtitleEnabled=function(t){d.debugLog("[ ConvivaAnalytics ] [ Player Event ] subtitled enabled",t),d.convivaAnalyticsTracker.trackUpdateSubtitleTrack(t.subtitle)},this.onSubtitleDisabled=function(t){d.debugLog("[ ConvivaAnalytics ] [ Player Event ] subtitles disabled",t),d.convivaAnalyticsTracker.trackTurnOffSubtitles()},this.onError=function(t){d.debugLog("[ ConvivaAnalytics ] [ Player Event ] error",t),d.convivaAnalyticsTracker.trackError(t)},this.onDestroy=function(t){d.debugLog("[ ConvivaAnalytics ] [ Player Event ] destroy",t),d.destroy(t)},this.convivaAnalyticsTracker=new s.ConvivaAnalyticsTracker(t,e,a),this.debugLoggingEnabled=a.debugLoggingEnabled||!1,this.player=t,this.events=t.exports.PlayerEvent,this.handlers=new r.PlayerEventWrapper(t),this.registerPlayerEvents(),this.convivaSsaiAnalytics=new o.ConvivaAnalyticsSsai(this.convivaAnalyticsTracker),this.ssai={get isAdBreakActive(){return this.convivaSsaiAnalytics.isAdBreakActive},reportAdBreakStarted:this.convivaSsaiAnalytics.reportAdBreakStarted.bind(this.convivaSsaiAnalytics),reportAdStarted:this.convivaSsaiAnalytics.reportAdStarted.bind(this.convivaSsaiAnalytics),reportAdFinished:this.convivaSsaiAnalytics.reportAdFinished.bind(this.convivaSsaiAnalytics),reportAdSkipped:this.convivaSsaiAnalytics.reportAdSkipped.bind(this.convivaSsaiAnalytics),reportAdBreakFinished:this.convivaSsaiAnalytics.reportAdBreakFinished.bind(this.convivaSsaiAnalytics)}}return t.prototype.initializeSession=function(){this.convivaAnalyticsTracker.initializeSession()},t.prototype.endSession=function(){this.reset(),this.convivaAnalyticsTracker.endSession()},t.prototype.reset=function(){this.lastAdBreakEvent=null,this.convivaSsaiAnalytics.reset()},t.prototype.sendCustomApplicationEvent=function(t,e){void 0===e&&(e={}),this.convivaAnalyticsTracker.sendCustomApplicationEvent(t,e)},t.prototype.sendCustomPlaybackEvent=function(t,e){void 0===e&&(e={}),this.convivaAnalyticsTracker.sendCustomPlaybackEvent(t,e)},t.prototype.updateContentMetadata=function(t){this.convivaAnalyticsTracker.updateContentMetadata(t)},t.prototype.reportPlaybackDeficiency=function(t,e,a){void 0===a&&(a=!0),this.convivaAnalyticsTracker.reportPlaybackDeficiency(t,e,a)},t.prototype.pauseTracking=function(){this.convivaAnalyticsTracker.pauseTracking()},t.prototype.resumeTracking=function(){this.convivaAnalyticsTracker.resumeTracking()},t.prototype.release=function(){this.destroy(),this.convivaAnalyticsTracker.release()},t.prototype.destroy=function(t){this.reset(),this.unregisterPlayerEvents(),this.convivaAnalyticsTracker.release(t)},t.prototype.debugLog=function(t){for(var e=[],a=1;a<arguments.length;a++)e[a-1]=arguments[a];this.debugLoggingEnabled&&console.log.apply(console,arguments)},t.prototype.registerPlayerEvents=function(){this.handlers.add(this.events.Play,this.onPlay),this.handlers.add(this.events.Playing,this.onPlaying),this.handlers.add(this.events.Paused,this.onPlaybackStateChanged),this.handlers.add(this.events.StallStarted,this.onPlaybackStateChanged),this.handlers.add(this.events.StallEnded,this.onPlaybackStateChanged),this.handlers.add(this.events.PlaybackFinished,this.onPlaybackFinished),this.handlers.add(this.events.VideoPlaybackQualityChanged,this.onVideoQualityChanged),this.handlers.add(this.events.AudioPlaybackQualityChanged,this.onCustomEvent),this.handlers.add(this.events.Muted,this.onCustomEvent),this.handlers.add(this.events.Unmuted,this.onCustomEvent),this.handlers.add(this.events.ViewModeChanged,this.onCustomEvent),this.handlers.add(this.events.AdStarted,this.onAdStarted),this.handlers.add(this.events.AdFinished,this.onAdFinished),this.handlers.add(this.events.AdBreakStarted,this.onAdBreakStarted),this.handlers.add(this.events.AdBreakFinished,this.onAdBreakFinished),this.handlers.add(this.events.AdSkipped,this.onAdSkipped),this.handlers.add(this.events.AdError,this.onAdError),this.handlers.add(this.events.Error,this.onError),this.handlers.add(this.events.Destroy,this.onDestroy),this.handlers.add(this.events.Seek,this.onSeek),this.handlers.add(this.events.Seeked,this.onSeeked),this.handlers.add(this.events.TimeShift,this.onTimeShift),this.handlers.add(this.events.TimeShifted,this.onTimeShifted),this.handlers.add(this.events.AudioChanged,this.onAudioChanged),this.handlers.add(this.events.SubtitleEnabled,this.onSubtitleEnabled),this.handlers.add(this.events.SubtitleDisabled,this.onSubtitleDisabled),this.handlers.add(this.events.CastStarted,this.onCustomEvent),this.handlers.add(this.events.CastStopped,this.onCustomEvent)},t.prototype.unregisterPlayerEvents=function(){this.handlers.clear()},t}();e.ConvivaAnalytics=d},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ObjectUtils=void 0,function(t){t.flatten=function(t,e){void 0===e&&(e="");var a={},i=function(t,e){for(var n in t)if(t.hasOwnProperty(n)){var s=t[n];"object"==typeof s?i(s,e+n+"."):a[e+n]=String(s)}};return i(t,e),a}}(e.ObjectUtils||(e.ObjectUtils={}))},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Html5Http=void 0;var i=function(){function t(){}return t.prototype.makeRequest=function(t,e,a,i,n,s){return this.makeRequestStandard.apply(this,arguments)},t.prototype.release=function(){},t.prototype.makeRequestStandard=function(t,e,a,i,n,s){var o=new XMLHttpRequest;return o.open(t,e,!0),i&&o.overrideMimeType&&o.overrideMimeType(i),i&&o.setRequestHeader&&o.setRequestHeader("Content-Type",i),n>0&&(o.timeout=n,o.ontimeout=function(){o.ontimeout=o.onreadystatechange=null,s&&s(!1,"timeout after "+n+" ms")}),o.onreadystatechange=function(){4===o.readyState&&(o.ontimeout=o.onreadystatechange=null,200===o.status?s&&s(!0,o.responseText):s&&s(!1,"http status "+o.status))},o.send(a),null},t}();e.Html5Http=i},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Html5Logging=void 0;var i=a(0),n=function(){function t(){}return t.prototype.consoleLog=function(t,e){"undefined"!=typeof console&&(console.log&&e===i.SystemSettings.LogLevel.DEBUG||e===i.SystemSettings.LogLevel.INFO?console.log(t):console.warn&&e===i.SystemSettings.LogLevel.WARNING?console.warn(t):console.error&&e===i.SystemSettings.LogLevel.ERROR&&console.error(t))},t.prototype.release=function(){},t}();e.Html5Logging=n},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Html5Storage=void 0;var i=function(){function t(){}return t.prototype.saveData=function(t,e,a,i){var n=t+"."+e;try{localStorage.setItem(n,a),i(!0,null)}catch(t){i(!1,t.toString())}},t.prototype.loadData=function(t,e,a){var i=t+"."+e;try{a(!0,localStorage.getItem(i))}catch(t){a(!1,t.toString())}},t.prototype.release=function(){},t}();e.Html5Storage=i},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Html5Time=void 0;var i=function(){function t(){}return t.prototype.getEpochTimeMs=function(){return(new Date).getTime()},t.prototype.release=function(){},t}();e.Html5Time=i},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Html5Timer=void 0;var i=function(){function t(){}return t.prototype.createTimer=function(t,e,a){var i=window.setInterval(t,e);return function(){-1!==i&&(clearInterval(i),i=-1)}},t.prototype.release=function(){},t}();e.Html5Timer=i},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e,a){void 0===a&&(a=!1),this.delay=t,this.callback=e,this.repeat=a,this.timeoutOrIntervalId=0}return t.prototype.start=function(){return this.reset(),this},t.prototype.clear=function(){this.clearInternal()},t.prototype.reset=function(){this.clearInternal(),this.repeat?this.timeoutOrIntervalId=setInterval(this.callback,this.delay):this.timeoutOrIntervalId=setTimeout(this.callback,this.delay)},t.prototype.clearInternal=function(){this.repeat?clearInterval(this.timeoutOrIntervalId):clearTimeout(this.timeoutOrIntervalId)},t}();e.Timeout=i},function(t,e,a){"use strict";var i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,a=1,i=arguments.length;a<i;a++)for(var n in e=arguments[a])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.ContentMetadataBuilder=void 0;var n=a(0),s=function(){function t(t){this.metadataOverrides={},this.metadata={},this.latestBuiltMetadata={},this.playbackStarted=!1,this.logger=t}return t.prototype.setOverrides=function(t){this.playbackStarted&&this.logger.consoleLog("[ Conviva Analytics ] Playback has started. Only some metadata attributes will be updated",n.SystemSettings.LogLevel.WARNING),this.metadataOverrides=i(i({},this.metadataOverrides),t)},t.prototype.getOverrides=function(){return this.metadataOverrides},t.prototype.setPlaybackStarted=function(t){this.playbackStarted=t},t.prototype.getStaticMetadata=function(){var t={};return this.playbackStarted?(t.assetName=this.latestBuiltMetadata.assetName,t.viewerId=this.latestBuiltMetadata.viewerId,t.streamType=this.latestBuiltMetadata.streamType,t.applicationName=this.latestBuiltMetadata.applicationName,t.duration=this.latestBuiltMetadata.duration,t.custom=this.latestBuiltMetadata.custom):(t.assetName=this.latestBuiltMetadata.assetName||this.assetName,t.viewerId=this.viewerId,t.streamType=this.metadataOverrides.streamType||this.metadata.streamType,t.applicationName=this.metadataOverrides.applicationName||this.metadata.applicationName,t.duration=this.metadataOverrides.duration||this.metadata.duration,t.custom=i(i(i({},this.metadataOverrides.custom),this.metadataOverrides.additionalStandardTags),this.metadata.custom)),t},t.prototype.getDynamicMetadata=function(){return{encodedFrameRate:this.metadataOverrides.encodedFrameRate||this.metadata.encodedFrameRate,defaultResource:this.metadataOverrides.defaultResource||this.metadata.defaultResource,streamUrl:this.metadataOverrides.streamUrl||this.metadata.streamUrl}},t.prototype.build=function(){var t,e=i(i({},this.getStaticMetadata()),this.getDynamicMetadata());this.latestBuiltMetadata=e;var a=((t={})[n.Constants.ASSET_NAME]=e.assetName,t[n.Constants.ENCODED_FRAMERATE]=e.encodedFrameRate,t[n.Constants.DURATION]=e.duration,t[n.Constants.DEFAULT_RESOURCE]=e.defaultResource,t[n.Constants.STREAM_URL]=e.streamUrl,t[n.Constants.IS_LIVE]=e.streamType,t[n.Constants.VIEWER_ID]=e.viewerId||"GET_VIEWER_ID_FROM_PLAYER",t[n.Constants.PLAYER_NAME]=e.applicationName||"GET_PLAYER_NAME_OR_TYPE",t);return i(i({},a),e.custom)},Object.defineProperty(t.prototype,"assetName",{get:function(){return this.metadataOverrides.assetName||this.metadata.assetName},set:function(t){this.metadata.assetName=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewerId",{get:function(){return this.metadataOverrides.viewerId||this.metadata.viewerId},set:function(t){this.metadata.viewerId=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"streamType",{set:function(t){this.metadata.streamType=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"applicationName",{set:function(t){this.metadata.applicationName=t},enumerable:!1,configurable:!0}),t.prototype.addToCustom=function(t){this.metadata.custom=i(i({},this.metadata.custom),t)},Object.defineProperty(t.prototype,"duration",{set:function(t){this.metadata.duration=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"encodedFrameRate",{set:function(t){this.metadata.encodedFrameRate=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"defaultResource",{set:function(t){this.metadata.defaultResource=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"streamUrl",{set:function(t){this.metadata.streamUrl=t},enumerable:!1,configurable:!0}),t.prototype.reset=function(){this.metadataOverrides={},this.metadata={},this.playbackStarted=!1,this.latestBuiltMetadata={}},t}();e.ContentMetadataBuilder=s},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.remove=function(t,e){var a=t.indexOf(e);return a>-1?t.splice(a,1)[0]:null}}(e.ArrayUtils||(e.ArrayUtils={}))},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PlayerConfigHelper=void 0;var i=a(17),n=function(){function t(){}return t.getAutoplayConfig=function(e){var a=e.getConfig();return a.playback&&void 0!==a.playback.autoplay?a.playback.autoplay:t.AUTOPLAY_DEFAULT_CONFIG},t.getPreloadConfig=function(t){var e=t.getConfig();if(i.BrowserUtils.isMobile()){if(e.adaptation&&e.adaptation.mobile&&void 0!==e.adaptation.mobile.preload)return e.adaptation.mobile.preload}else if(e.adaptation&&e.adaptation.desktop&&void 0!==e.adaptation.desktop.preload)return e.adaptation.desktop.preload;return e.adaptation&&void 0!==e.adaptation.preload?e.adaptation.preload:!t.isLive()},t.AUTOPLAY_DEFAULT_CONFIG=!1,t}();e.PlayerConfigHelper=n},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BrowserUtils=void 0;var i=function(){function t(){}return t.isMobile=function(){var t=/Android/i.test(navigator.userAgent),e=/IEMobile/i.test(navigator.userAgent),a=/Windows Phone 10.0/i.test(navigator.userAgent),i=/Safari/i.test(navigator.userAgent)&&/Mobile/i.test(navigator.userAgent);return t||e||a||i},t}();e.BrowserUtils=i},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PlayerStateHelper=void 0;var i=a(0),n=function(){function t(){}return t.getPlayerStateFromEvent=function(t,e,a){var n;switch(t.type){case e.StallStarted:n=i.Constants.PlayerState.BUFFERING;break;case e.Playing:n=i.Constants.PlayerState.PLAYING;break;case e.Paused:n=i.Constants.PlayerState.PAUSED;break;case e.Seeked:case e.TimeShifted:case e.StallEnded:n=a.isPlaying()?i.Constants.PlayerState.PLAYING:i.Constants.PlayerState.PAUSED}return n},t.getPlayerState=function(t){return t.isStalled()?i.Constants.PlayerState.BUFFERING:t.isPlaying()?i.Constants.PlayerState.PLAYING:i.Constants.PlayerState.PAUSED},t}();e.PlayerStateHelper=n},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ConvivaAnalyticsSsai=void 0;var i=a(0),n=a(1),s=function(){function t(t){this._isAdBreakActive=!1,this.convivaAnalyticsTracker=t}return Object.defineProperty(t.prototype,"isAdBreakActive",{get:function(){return this._isAdBreakActive},enumerable:!1,configurable:!0}),t.prototype.reset=function(){this._isAdBreakActive=!1},t.prototype.reportAdBreakStarted=function(){this.convivaAnalyticsTracker.isAdBreakActive||this._isAdBreakActive||(this._isAdBreakActive=!0,this.convivaAnalyticsTracker.trackAdBreakStarted(i.Constants.AdType.SERVER_SIDE))},t.prototype.reportAdStarted=function(t){this._isAdBreakActive&&this.convivaAnalyticsTracker.trackAdStarted(n.AdHelper.convertSsaiAdInfoToConvivaAdInfo(t,this.convivaAnalyticsTracker.getContentMetadata()),i.Constants.AdType.SERVER_SIDE)},t.prototype.reportAdFinished=function(){this.isAdBreakActive&&this.convivaAnalyticsTracker.trackAdFinished()},t.prototype.reportAdSkipped=function(){this._isAdBreakActive&&this.convivaAnalyticsTracker.trackAdSkipped()},t.prototype.reportAdBreakFinished=function(){this._isAdBreakActive&&(this._isAdBreakActive=!1,this.convivaAnalyticsTracker.trackAdBreakFinished())},t}();e.ConvivaAnalyticsSsai=s}])}); | ||
//# sourceMappingURL=bitmovin-player-analytics-conviva.js.map |
@@ -95,2 +95,3 @@ import * as Conviva from '@convivainc/conviva-js-coresdk'; | ||
get isAdBreakActive(): boolean; | ||
private hasPlayed; | ||
/** | ||
@@ -168,3 +169,3 @@ * Do not track play event during ad (e.g. triggered from IMA) | ||
trackUpdateSubtitleTrack(subtitleTrack: SubtitleTrack): void; | ||
private trackSubtitleWhenInternalInitialize; | ||
private trackInitialSubtitles; | ||
trackTurnOffSubtitles(): void; | ||
@@ -171,0 +172,0 @@ trackError: (event: ErrorEvent) => void; |
@@ -27,2 +27,3 @@ "use strict"; | ||
var _this = this; | ||
this.hasPlayed = false; | ||
// Since there are no stall events during play / playing; seek / seeked; timeShift / timeShifted we need | ||
@@ -54,2 +55,3 @@ // to track stalling state between those events. To prevent tracking eg. when seeking in buffer we delay it. | ||
_this.convivaAdAnalytics = null; | ||
_this.hasPlayed = false; | ||
_this._isAdBreakActive = false; | ||
@@ -74,2 +76,9 @@ }; | ||
} | ||
if (!_this.hasPlayed) { | ||
_this.hasPlayed = true; | ||
// Send the session init audio language values. | ||
_this.trackUpdateAudioTrack(_this.player.getAudio()); | ||
// Check if at session init has a subtitle enabled. | ||
_this.trackInitialSubtitles(); | ||
} | ||
}; | ||
@@ -444,6 +453,2 @@ this.onPlaying = function (event) { | ||
} | ||
// Send the session init audio language values. | ||
this.trackUpdateAudioTrack(this.player.getAudio()); | ||
// Check if at session init has a subtitle enabled. | ||
this.trackSubtitleWhenInternalInitialize(); | ||
}; | ||
@@ -594,3 +599,3 @@ /** | ||
}; | ||
ConvivaAnalyticsTracker.prototype.trackSubtitleWhenInternalInitialize = function () { | ||
ConvivaAnalyticsTracker.prototype.trackInitialSubtitles = function () { | ||
if (!this.isSessionActive()) { | ||
@@ -597,0 +602,0 @@ return; |
{ | ||
"name": "@bitmovin/player-integration-conviva", | ||
"version": "5.2.0", | ||
"version": "5.3.0", | ||
"description": "Conviva analytics integration for the Bitmovin Player", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -137,2 +137,4 @@ import * as Conviva from '@convivainc/conviva-js-coresdk'; | ||
private hasPlayed = false; | ||
/** | ||
@@ -456,8 +458,2 @@ * Do not track play event during ad (e.g. triggered from IMA) | ||
} | ||
// Send the session init audio language values. | ||
this.trackUpdateAudioTrack(this.player.getAudio()); | ||
// Check if at session init has a subtitle enabled. | ||
this.trackSubtitleWhenInternalInitialize(); | ||
} | ||
@@ -535,2 +531,3 @@ | ||
this.hasPlayed = false; | ||
this._isAdBreakActive = false; | ||
@@ -613,2 +610,10 @@ }; | ||
} | ||
if (!this.hasPlayed) { | ||
this.hasPlayed = true; | ||
// Send the session init audio language values. | ||
this.trackUpdateAudioTrack(this.player.getAudio()); | ||
// Check if at session init has a subtitle enabled. | ||
this.trackInitialSubtitles(); | ||
} | ||
}; | ||
@@ -818,3 +823,3 @@ | ||
private trackSubtitleWhenInternalInitialize() { | ||
private trackInitialSubtitles() { | ||
if (!this.isSessionActive()) { | ||
@@ -821,0 +826,0 @@ return; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
416136
4211
0