PageSourceSearch

https://www.pasch-net.de/resources/relaunch/js/bitmovin/modules/bitmovinplayer-engine-native.js

js pasch-net.de collected 2026-10-02 03:43:31 UTC 68,577 bytes, 14 lines download raw bytes

1/****************************************************************************
2 * Copyright (C) 2021, Bitmovin, Inc., All Rights Reserved 
3 * 
4 * This source code and its use and distribution, is subject to the terms 
5 * and conditions of the applicable license agreement. 
6 * 
7 * Bitmovin Player Version 8.72.0 
8 * 
9 ****************************************************************************/
10(function() {
11!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["engine-native"]=t():(e.bitmovin=e.bitmovin||{},e.bitmovin.player=e.bitmovin.player||{},e.bitmovin.player["engine-native"]=t())}(this,function(){return webpackJsonpbitmovin_player__name_([12],{223:function(e,t,i){"use strict";function n(e,t){switch(e){case o.CueTag:return[{metadataType:l.MetadataType.CUETAG,metadata:t[o.CueTag],start:t.playbackTime}];case o.Scte35:return[{metadataType:l.MetadataType.SCTE,metadata:t[o.Scte35],start:t.playbackTime}];case o.DateRange:return t[o.DateRange].map(function(e){return{metadataType:l.MetadataType.DATERANGE,metadata:e,start:h.toSeconds(Date.parse(e.startDate)),end:h.toSeconds(Date.parse(e.endDate))}});case o.CustomTags:return[{metadataType:l.MetadataType.CUSTOM,metadata:t[o.CustomTags],start:t.playbackTime,end:t.playbackTime+t.duration}];default:return[]}}function r(e,t){var i=function(t){var i;return null===(i=e.media)||void 0===i?void 0:i.some(function(e){return t.includes(e.attributes.URI)})},n=e.playlists.find(function(e){return t.uri.includes(e.uri)&&!i(t.uri)});return Boolean(n)}function a(e,t,i){for(var n,r=e.segments,a=r.some(function(e){return"undefined"!=typeof e.dateTime}),o=0;o<r.length;o++){var s=r[o];if(s.variantPlaylistId=t,s.mediaSequenceNumber=e.mediaSequence+o,!a&&(null===(n=i.tweaks)||void 0===n?void 0:n.akamai_datetime_parsing)){var l=f.getProgramDateTimeFromSegmentUrl(s.uri,s.duration);l&&(s.dateTime=l)}}return r}Object.defineProperty(t,"__esModule",{value:!0});var o,s=i(3),l=i(1),d=i(188),u=i(126),h=i(5),c=i(10),p=i(12),g=i(2),m=i(0);!function(e){e.CueTag="cueTag",e.Scte35="scte35",e.DateRange="dateRange",e.CustomTags="customTags"}(o||(o={}));var f,v="#EXTM3U\n#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=100000\n$VARIANT$\n",y=function(){function e(e){var t,i=this;this.context=e,this.onManifestMetadata=function(e){if(e.hasOwnProperty("metadata")){var t={metadataType:e.metadataType.toUpperCase(),metadata:e.metadata};(e.start||0===e.start)&&(t.start=e.start),e.end&&(t.end=e.end),i.context.eventHandler.dispatchEvent(l.PlayerEvent.Metadata,t)}},this.onTimeChangedHandler=function(e){var t=i.segmentTimelineController.getPlayingSegment(e.time);t&&!t.consumed&&(t.consumed=!0,i.triggerMetadata(t),i.triggerSegmentPlayback(t))},this.onTimeShiftedHandler=function(){i.segmentTimelineController.reset()},this.onSeeked=function(){i.segmentTimelineController.reset()},this.registerVariantPlaylist=function(e){var t=i.parsePlaylist(e.body);if(i.isValidVariantPlaylist(t)){var n=i.parsedManifest.playlists.find(function(t){return e.url.includes(t.uri)});if(n&&r(i.parsedManifest,n)){i.segmentTimelineController.switchTimeline(n.id),f.extrapolateProgramDateTime(t.segments);var o=a(t,n.id,i.config);i.metadataParsedService.expirationTimeInSeconds=i.segmentTimelineController.updateTimeline(n.id,o);var s=i.segmentTimelineController.getCurrentTimeline(),l=Boolean(o[0].dateTime);if(l){var d=p.Util.timeInSeconds(o[0].dateTime);i.metadataService.removeUntil(d)}return i.triggerMetadataParsedEvents(s),t}}},f=g.ModuleManager.get(m.ModuleName.HLS).PlaylistUtils,this.settings=e.settings,this.config=e.config,this.eventHandler=e.eventHandler,this.originalManifest=null,this.metadataParsedService=e.serviceManager.get(s.ServiceName.MetadataParsedService),this.eventHandler.on(l.PlayerEvent.TimeChanged,this.onTimeChangedHandler),this.eventHandler.on(l.PlayerEvent.TimeShifted,this.onTimeShiftedHandler),this.eventHandler.on(l.PlayerEvent.Seeked,this.onSeeked),this.metadataService=new d.MetadataService(this.context,(t={},t[u.TimedMetadataType.Manifest]=this.onManifestMetadata,t[u.TimedMetadataType.DateRange]=this.onManifestMetadata,t))}return e.prototype.triggerSegmentPlayback=function(e){var t={url:e.uri,uid:null,mimeType:"video/mp4",playbackTime:e.playbackTime,duration:e.duration,mediaInfo:{},dateTime:null};e.dateTime&&(t.dateTime=e.dateTime.toISOString()),e.customTags&&e.customTags.length>0&&(t.EXPERIMENTAL=t.EXPERIMENTAL||{},t.EXPERIMENTAL.hlsAttributes=e.customTags.map(function(e){return e.attributes})),this.context.eventHandler.dispatchEvent(l.PlayerEvent.SegmentPlayback,t)},e.prototype.triggerMetadata=function(e){var t=this;e.metadata&&e.metadata.forEach(function(e){t.context.eventHandler.dispatchEvent(l.PlayerEvent.Metadata,{metadataType:e.type,metadata:e})})},e.prototype.resolveMasterManifest=function(e){return this.parsedManifest?Promise.resolve(this.manifestUrl):(this.manifestUrl=e,this.downloadMasterManifest(e))},e.prototype.registerMasterManifest=function(e,t){if(this.parsedManifest=this.parsePlaylist(e.body),this.originalManifest=e.body,!this.isValidMasterPlaylist(this.parsedManifest))if(this.isValidVariantPlaylist(this.parsedManifest)){var i=v.replace("$VARIANT$",t);this.originalManifest=i,this.parsedManifest=this.parsePlaylist(i)}else this.parsedManifest=null;return this.originalManifest},e.prototype.concatManifestUrl=function(e){return c.URLHelper.concatBaseUrlWithPartial(this.manifestUrl,e)},e.prototype.isValidMasterPlaylist=function(e){return e.hasOwnProperty("playlists")&&e.playlists.length>0},e.prototype.isValidVariantPlaylist=function(e){return e.hasOwnProperty("segments")&&e.segments.length>0},e.prototype.parsePlaylist=function(e){var t=g.ModuleManager.get(m.ModuleName.HLS).HlsUtils;return t.parsePlaylist(e,this.context.logger)},e.prototype.metadataToMetadataParsedEvent=function(e){return{metadataType:e.metadataType,metadata:e.metadata,data:e.metadata,start:e.start,end:e.end}},e.prototype.addMetadata=function(e){var t="DATERANGE"===e.metadataType?u.TimedMetadataType.DateRange:u.TimedMetadataType.Manifest,i=this.metadataService.addToMetadataParsedService(t,e.start,this.metadataToMetadataParsedEvent(e),"1");i&&this.metadataService.addToTimeline(t,e.start,e)},e.prototype.triggerMetadataParsedEvents=function(e){var t=this;
11e.forEach(function(e){Object.values(o).forEach(function(i){e.hasOwnProperty(i)&&n(i,e).forEach(function(e){return t.addMetadata(e)})})})},e.prototype.parseTimelineEntries=function(e){var t=this.parsePlaylist(e);return t.segments.map(function(e){return{uri:e.uri,duration:e.duration,discontinuity:e.discontinuity||!1,dateTime:null,metadata:[],consumed:!1,playbackTime:-1,keys:[]}})},e.prototype.getPlaybackTimeOfFirstSegmentInTimeline=function(e){for(var t=0;t<e.length;t++)for(var i=e[t],n=0,r=0;r<i.timeline.length;r++){for(var a=i.timeline[r],o=this.segmentTimelineController.getCurrentTimeline(),s=0;s<o.length;s++){var l=o[s];if(l.uri===a.uri)return l.playbackTime-n}n+=a.duration}return-1},e.prototype.getParsedManifest=function(){return this.parsedManifest},e.prototype.getManifest=function(){return this.originalManifest},e.prototype.detachEventHandlers=function(){this.eventHandler&&(this.eventHandler.off(l.PlayerEvent.TimeChanged,this.onTimeChangedHandler),this.eventHandler.off(l.PlayerEvent.TimeShifted,this.onTimeShiftedHandler),this.eventHandler.off(l.PlayerEvent.Seeked,this.onSeeked))},e.prototype.dispose=function(){this.detachEventHandlers(),this.segmentTimelineController&&(this.segmentTimelineController.dispose(),this.segmentTimelineController=null),this.metadataService&&(this.metadataService.dispose(),this.metadataService=null),this.parsedManifest=null,this.originalManifest=null,this.manifestUrl=null,this.settings=null,this.config=null,this.eventHandler=null},e}();t.AbstractHlsManifestController=y},280:function(e,t,i){"use strict";function n(e){var t,i;return null!=(null===(t=e)||void 0===t?void 0:t.startTime)||null!=(null===(i=e)||void 0===i?void 0:i.startOffset)}function r(e){var t=e.findIndex(function(e){return e.preferred===!0});return t>-1?String(t):"0"}var a=this&&this.__assign||function(){return a=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++){t=arguments[i];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},a.apply(this,arguments)},o=this&&this.__decorate||function(e,t,i,n){var r,a=arguments.length,o=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(o=(a<3?r(o):a>3?r(t,i,o):r(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};Object.defineProperty(t,"__esModule",{value:!0});var s=i(6),l=i(7),d=i(21),u=i(17),h=i(3),c=i(16),p=i(1),g=i(94),m=i(39),f=i(72),v=i(8),y=i(48),T=i(33),S=i(20),E=i(22),b=i(9),k=i(11),P=i(5),M=i(10),C=i(12),A=i(93),I=i(14),D=i(2),L=i(0),w=i(535),O=i(537),H=i(538),N=i(541),_=2,R=.1,V=.25,U="not available",x=.75,F=2,j=0,W=function(){function e(e){var t=this;this.numTimeChanged=0,this.loaded=!1,this.audio=null,this.ended=!1,this.ignoreNextVideoError=!1,this.controlPermitted=!0,this.seekingTimeoutId=-1,this.nativeSeekCalled=!1,this.isIllicitlySeeking=!1,this.ignoreNextDelta=!1,this.numSeekingCalled=0,this.currentDuration=-1,this.timeShiftJumpStartPosition=-1,this.seekTargetTime=-1,this.textTrackController=null,this.lastPlayIssuer="api",this.lastPauseIssuer="api",this.lastSeekIssuer="api",this.lastVerifiedPlaybackPosition=-1,this.lastLegalPlaybackPosition=0,this.restrictedInlinePlayback=!1,this.lastDuration=void 0,this.lastTime=0,this.availableVideoStreams=[],this.allowedToThrowEvents=!0,this.airplayAvailable=!1,this.hasSourceBeenLoaded=!1,this.hasDataBeenLoaded=!1,this.sourceElementEventListeners=[],this.restoringPlaybackPosAfterQualitySwitch=!1,this.isInitialSeek=!1,this.lastDelayedSeekHandlers={},this.isProgressiveQualityChange=!1,this.onAddTrack=function(e){if(t.isReady()){var i=e.track;t.eventCallback(p.PlayerEvent.AudioAdded,{track:t.convertAudioTrackNativeToApi(i)}),i.enabled&&t.hasSourceBeenLoaded&&t.dispatchAudioChangedEvent(null,i)}},this.loadedDataHandler=function(){clearTimeout(t.loadedDataFallbackTimeoutID),t.hasSourceBeenLoaded||clearTimeout(t.loadTimeoutID),t.hasSourceBeenLoaded=!0,t.isProgressiveQualityChange=!1,t.allowedToThrowEvents=!0,t.hasDataBeenLoaded=!0,setTimeout(function(){return t.loadingDeferred.resolve()},0)},this.eventCallback=function(e,i,n,r){void 0===i&&(i={}),void 0===n&&(n=!1),void 0===r&&(r=!1),t.eventHandler&&(t.allowedToThrowEvents||n)&&t.eventHandler.dispatchEvent(e,i,r)},this.onTimeUpdate=function(e){var i=t.getElement(),n=i.currentTime,r=t.lastVerifiedPlaybackPosition!==-1||n!==t.lastVerifiedPlaybackPosition,a=r&&!t.isIllicitlySeeking;a&&(t.isIllegalSeek(n)?(Promise.resolve(t.video.play())["catch"](function(e){t.logger.insane("Play promise rejected:",e)}),t.ignoreNextDelta=!0,i.currentTime=t.lastLegalPlaybackPosition):t.handleTimeUpdateEvent(i,n),t.nativeSeekCalled=!1,t.currentVideoStream&&(t.currentVideoStream.width=t.video.videoWidth,t.currentVideoStream.height=t.video.videoHeight))},this.onPlaybackStarted=function(){t.isPlaying()||(t.ended=!1,t.startManifestTimeoutTimer(),t.stateManager.transitionToPlayingState(t.lastPlayIssuer))},this.onContentPlaybackFinished=function(){t.ended=!0},this.getCurrentTime=function(e){return void 0===e&&(e=v.TimeMode.AbsoluteTime),t.getElement().currentTime},this.getAudioQuality=this.getPlaybackAudioData,this.getVideoQuality=this.getPlaybackVideoData,this.videoOnEnded=function(){var e=t.getElement(),i=Math.abs(e.currentTime-t.lastLegalPlaybackPosition),n=t.settings.GLOBAL_DISABLE_SEEKING;n&&(i>x||e.currentTime<t.currentDuration-x)?(Promise.resolve(t.video.play())["catch"](function(e){t.logger.insane("Play promise rejected:"+e)}),t.ignoreNextDelta=!0,t.video.currentTime=t.lastLegalPlaybackPosition):(t.lastLegalPlaybackPosition=0,t.stateManager.isPlaying()&&t.stateManager.transitionToPausedState(!0,t.lastPauseIssuer),t.stateManager.transitionToStoppedState())},this.videoOnSeeked=function(){t.resetTimeShift(),t.numSeekingCalled=0;var e=t.settings.GLOBAL_DISABLE_SEEKING;!e||t.restoringPlaybackPosAfterQualitySwitch||t.isInitialSeekToStartTime?(t.lastVerifiedPlaybackPosition=t.getElement().currentTime,t.isInitialSeekToStartTime=!1,t.stateManager.isSeeking()&&(t.textTrackController&&t.textTrackController.seek(),t.maybeHandleSeekTargetChangeDuringStartup())):t.
11isIllicitlySeeking=!1,t.finishedSeekedTransitionState()},this.videoOnSeeking=function(){if(t.settings.GLOBAL_DISABLE_SEEKING&&!t.isInitialSeekToStartTime)t.isIllicitlySeeking=!t.restoringPlaybackPosAfterQualitySwitch,t.numSeekingCalled++,t.numSeekingCalled>1&&(t.ignoreNextDelta=!1);else if(!t.stateManager.isSeeking()&&!t.stateManager.isTimeShifting()){var e=t.getElement().currentTime;t.stateManager.transitionToSeekingIOSState(e,m.INTERNAL_ISSUER_NAME),t.lastVerifiedPlaybackPosition=e}},this.onTimeChanged=function(){void 0===t.maxTimeShift&&(t.maxTimeShift=t.getElement().currentTime)},this.delayedSeek=function(){t.numTimeChanged++,t.numTimeChanged<t.settings.IOS_MIN_TIMEUPDATES_AFTER_AD||(t.eventHandler.off(p.PlayerEvent.TimeChanged,t.delayedSeek),t.restoringPlaybackPosAfterQualitySwitch=!0,t.triggerSeek({time:t.currentTimeWas,issuer:"api",force:!0}))},this.onWebkitPlaybackTargetAvailabilityChanged=function(e){"available"===e.availability?(t.airplayAvailable=!0,t.eventCallback(p.PlayerEvent.AirplayAvailable)):t.airplayAvailable=!1},this.onWebkitPlaybackTargetIsWirelessChanged=function(e){t.eventCallback(p.PlayerEvent.AirplayChanged,{airplayEnabled:t.isAirplayActive(),time:t.video.currentTime})},this.context=e,this.isAtLiveEdge=!1,this.logger=e.logger,this.video=e.videoElement,this.config=e.config,this.eventHandler=e.eventHandler,this.settings=e.settings,this.hlsSeekingGlitchEventHandlers=[],this.downloadErrorHandler=null,this.currentVol=this.video.volume,this.originalCrossOriginAttributeValue=this.video.getAttribute("crossOrigin"),this.currentTimeShift=-(1/0),this.hlsLiveTimeTracker=new O.HlsLiveNativeTimeTracker(this,e),this.elementEvents=[{event:I.MediaElementEvent.pause,handler:function(){t.resetTimeShift(),t.ended||t.stateManager.transitionToPausedState(!0,t.lastPauseIssuer,!0)}},{event:I.MediaElementEvent.ended,handler:function(){t.videoOnEnded()}},{event:I.MediaElementEvent.play,handler:function(){t.stateManager.stallExit(),t.restrictedInlinePlayback&&t.audio&&t.setVideoTime(),t.ended=!1,t.stateManager.transitionToPlayState(!0,t.lastPlayIssuer)}},{event:I.MediaElementEvent.canplay,handler:function(){t.stateManager.stallExit()}},{event:I.MediaElementEvent.seeking,handler:function(){t.nativeSeekCalled=!0,t.videoOnSeeking(),t.getCurrentTime()>=t.getDuration()&&(t.videoOnSeeked(),t.videoOnEnded())}},{event:I.MediaElementEvent.seeked,handler:function(){t.videoOnSeeked(),t.restrictedInlinePlayback&&t.audio&&t.setVideoTime()}},{event:I.MediaElementEvent.durationchange,handler:function(){g.maybeFireDurationChangedEvent(t.lastDuration,t.getDuration(),t.eventHandler),t.lastDuration=t.getDuration()}},{event:I.MediaElementEvent.loadeddata,handler:this.loadedDataHandler},{event:I.MediaElementEvent.loadedmetadata,handler:function(){t.loadedDataFallbackTimeoutID=window.setTimeout(t.loadedDataHandler,200)}},{event:I.MediaElementEvent.playing,handler:function(){t.stateManager.isStalled?(t.stateManager.stallExit(),t.stateManager.transitionToPlayingState(t.lastPlayIssuer)):t.stateManager.isStopped()?t.onPlaybackStarted():t.stateManager.isPlaying()||(t.stateManager.transitionToPlayState(!0,t.lastPlayIssuer),t.stateManager.transitionToPlayingState(t.lastPlayIssuer))}},{event:I.MediaElementEvent.waiting,handler:function(){t.resetTimeShift(),t.stateManager.stallEnter()}},{event:I.MediaElementEvent.timeupdate,handler:this.onTimeUpdate},{event:I.MediaElementEvent.error,handler:function(e){t.loadingDeferred.reject(),t.ignoreNextVideoError?t.ignoreNextVideoError=!1:(t.logger.debug("video element has thrown an error",e.errorObject),clearTimeout(t.loadTimeoutID),t.eventHandler.fireError(g.createPlayerErrorFromMediaError(e,!0)))}},{event:I.MediaElementEvent.webkitpresentationmodechanged,handler:function(){var e=t.video.getViewModeFromPresentationMode();e===v.ViewMode.PictureInPicture||e===v.ViewMode.Fullscreen&&S.getCapabilities().isIOS?t.textTrackController&&t.textTrackController.enableNative():t.textTrackController&&t.textTrackController.disableNative(),t.context.store.dispatch(y.setPlayerViewMode(e))}},{elementSelector:function(e){return e.audioTracks},event:"addtrack",handler:this.onAddTrack},{elementSelector:function(e){return e.audioTracks},event:"removetrack",handler:function(e){t.isReady()&&t.eventCallback(p.PlayerEvent.AudioRemoved,{track:t.convertAudioTrackNativeToApi(e.track)})}}],this.init()}return e.prototype.handleTimeUpdateEvent=function(e,t){if(this.ignoreNextDelta=!1,this.currentDuration=e.duration,t>this.currentDuration+F)return this.context.logger.debug("CurrentTime "+t+" exceeds video duration ("+this.currentDuration+"), reverting current time"),void(e.currentTime=this.currentDuration-.1);if(this.lastLegalPlaybackPosition=t,this.stateManager.stallExit(),!this.stateManager.isSeeking()&&!this.stateManager.isTimeShifting()&&this.isPlaying()){var i=this.getStartDate();if(null!=i){var n=C.Util.timeInSeconds(i)+t;this.eventCallback(p.PlayerEvent.TimeChanged,{time:t,absoluteTime:n})}else this.eventCallback(p.PlayerEvent.TimeChanged,{time:t})}},e.prototype.isIllegalSeek=function(e){if(!this.settings.GLOBAL_DISABLE_SEEKING||!this.nativeSeekCalled)return!1;var t=this.lastVerifiedPlaybackPosition!==-1&&e>this.lastVerifiedPlaybackPosition+x,i=Math.abs(e-this.lastLegalPlaybackPosition);return(!this.ignoreNextDelta||t)&&i>x},e.prototype.getElement=function(){return this.restrictedInlinePlayback&&this.audio?this.audio:this.video},e.prototype.setVideoTime=function(){var e=Date.now(),t=P.toSeconds(e-this.lastTime),i=1/30;t>=i&&(this.video.currentTime=this.audio.currentTime,this.lastTime=e),this.isPlaying()&&window.requestAnimationFrame(this.setVideoTime)}
11,e.prototype.play=function(e){return this.controlPermitted?(this.lastPlayIssuer=e,this.getElement().play()):Promise.reject("Play control not permitted")},e.prototype.getStartDate=function(){if(!this.isLive())return null;var e=this.getElement().getWrappedElement();return"function"==typeof e.getStartDate?e.getStartDate():null},e.prototype.preload=function(){this.getElement().preload="auto"},e.prototype.pause=function(e){this.lastPauseIssuer=e;var t=this.getElement();this.controlPermitted&&this.loaded&&(this.stateManager.transitionToPausedState(!1,this.lastPauseIssuer),t.pause())},e.prototype.mute=function(e){this.getElement().muted||(this.getElement().muted=!0,this.eventCallback(p.PlayerEvent.Muted,{issuer:e||"api"}))},e.prototype.unmute=function(e){this.getElement().muted&&(this.getElement().muted=!1,this.eventCallback(p.PlayerEvent.Unmuted,{issuer:e||"api"}))},e.prototype.seek=function(e,t){var i=this;return!(!this.isSeekingAllowed(e)||this.getCurrentTime()===e)&&(this.hlsLiveTimeTracker.adjustTargetTime(e,t).then(function(e){return i.lastSeekIssuer=t,i.triggerSeekEvent(e,t),i.triggerSeek({time:e,issuer:t})}),this.hasDataBeenLoaded&&this.getDuration()>0)},e.prototype.seekForLive=function(e,t){this.timeShiftJumpStartPosition=this.getElement().currentTime,this.lastSeekIssuer=t,this.triggerTimeShiftEvent(e,t),this.triggerSeekForLive({time:e,issuer:t})},e.prototype.isSeekingAllowed=function(e){this.isInitialSeekToStartTime=this.isInitialSeek&&this.hasStartTime(e);var t=!this.settings.GLOBAL_DISABLE_SEEKING&&this.isSeekingEnabled(),i=this.isInitialSeekToStartTime||t;return i&&this.controlPermitted},e.prototype.isTimeShiftingAllowed=function(){var e=this.config.playback&&this.config.playback.hasOwnProperty("timeShift"),t=!e||Boolean(this.config.playback.timeShift);return this.isLive()&&t},e.prototype.correctSeekTimeIfOutOfBounds=function(e,t){if(e<t.start||e>t.end){var i=e;e=Math.max(e,t.start),e=Math.min(e,t.end),this.logger.debug("seek time out of seekable range ("+t.start+" to "+t.end+") correcting from "+i+" to "+e)}return e},e.prototype.triggerSeek=function(e){return!this.maybeDelaySeek(e)&&(this.stateManager.transitionToSeekingState(e.time,e.issuer,!1),this.finishSeek(e),!0)},e.prototype.triggerSeekForLive=function(e){this.maybeDelaySeek(e,!0)||(this.stateManager.transitionToTimeShiftingState(this.getCurrentTime(),e.time,e.issuer,!1),e.time<0&&(e.time=this.getSeekableRangeInternal().end+e.time,this.resetTimeShift()),this.finishSeek(e))},e.prototype.maybeDelaySeek=function(e,t){return void 0===t&&(t=!1),this.hasDataBeenLoaded?0===this.getDuration()?(this.logger.debug("Delaying the seek until stream duration is known"),this.scheduleDelayedSeek(e,t,[I.MediaElementEvent.durationchange]),!0):this.video.seekable.length<1&&(this.logger.debug("Delaying the seek as the seekable range is not yet known"),this.scheduleDelayedSeek(e,t,[I.MediaElementEvent.timeupdate,I.MediaElementEvent.canplay]),!0):(this.logger.debug("Delaying the seek until data is loaded"),this.scheduleDelayedSeek(e,t,[I.MediaElementEvent.loadeddata]),!0)},e.prototype.finishSeek=function(e){var t=e.issuer===m.ADVERTISING_ISSUER_NAME,i=this.adjustSeekTimeForBoundaries(e.time,this.getSeekableRangeInternal(),t);this.logger.debug("Adjusted seek target from "+e.time+" to "+i),this.isInitialSeek=!1,this.ignoreNextDelta=this.ignoreNextDelta||this.isInitialSeekToStartTime||e.force;var n=parseFloat(i.toFixed(_));this.seekTargetTime=n,this.logger.debug("Setting time on video element from "+this.getElement().currentTime+" to "+n),this.getElement().currentTime=n},e.prototype.adjustSeekTimeForBoundaries=function(e,t,i){void 0===i&&(i=!1);var n=this.correctSeekTimeIfOutOfBounds(e,t);return this.logger.debug("Adjusting seek time for seekableRange:",t),i?e>=t.end&&(n=t.end-R):n=Math.min(n,t.end-this.settings.SEEK_TO_END_OFFSET),n},e.prototype.isSeekingEnabled=function(){var e=this.config&&this.config.hasOwnProperty("playback"),t=e?this.config.playback:{},i=t.hasOwnProperty("seeking");return!i||t.seeking},e.prototype.hasStartTime=function(e){var t=this.context.sourceContext.source?this.context.sourceContext.source:{},i=t.hasOwnProperty("options")&&t.options.hasOwnProperty("startTime");return i&&e===t.options.startTime},e.prototype.triggerSeekEvent=function(e,t){t!==m.STARTUP_ISSUER_NAME&&this.eventCallback(p.PlayerEvent.Seek,{position:this.getElement().currentTime,seekTarget:e,issuer:t||"api"})},e.prototype.triggerTimeShiftEvent=function(e,t){t!==m.STARTUP_ISSUER_NAME&&this.eventCallback(p.PlayerEvent.TimeShift,{target:e<0?this.timeShiftJumpStartPosition+e:e,position:this.timeShiftJumpStartPosition,issuer:t||"api"})},e.prototype.waitForOnSeeked=function(e){var t=this;return new Promise(function(i){var n=function(){e.removeEventListener(I.MediaElementEvent.seeked,n),i()};t.hlsSeekingGlitchEventHandlers.push({el:e,ev:I.MediaElementEvent.seeked,fn:n}),e.addEventListener(I.MediaElementEvent.seeked,n)})},e.prototype.waitForOnProgress=function(e,t){var i=this;return new Promise(function(n,r){var a=0,o=function(){var s=e.buffered,l=s.length>0?s.end(s.length-1):-(1/0);a+=isFinite(l)?1:0,a>i.settings.SAFARI_NUM_PROGRESS_EVENTS_AFTER_SEEK_GLITCH&&l<t?(e.removeEventListener(I.MediaElementEvent.progress,o),r(null)):l>=t&&(e.removeEventListener(I.MediaElementEvent.progress,o),n())};i.hlsSeekingGlitchEventHandlers.push({el:e,ev:I.MediaElementEvent.progress,fn:o}),e.addEventListener(I.MediaElementEvent.progress,o)})},e.prototype.verifyHLSPlaybackBuffer=function(e,t){var i=this;return this.type!==v.StreamType.Hls?Promise.resolve():this.waitForOnSeeked(e).then(function(){return i.waitForOnProgress(e,t)})["catch"](function(){throw i.logger.debug("seek to target time ("+t+") failed - trying to re
11cover by seeking to "+(t+1)),null})},e.prototype.clearDelayedSeekHandlers=function(){var e=this;Object.keys(this.lastDelayedSeekHandlers).forEach(function(t){e.getElement().removeEventListener(t,e.lastDelayedSeekHandlers[t])}),this.lastDelayedSeekHandlers={}},e.prototype.scheduleDelayedSeek=function(e,t,i){var n=this,r=this.getElement();this.clearDelayedSeekHandlers();var a=function(i){n.clearDelayedSeekHandlers();var o="number"==typeof i?i:e.time,s={time:o,issuer:e.issuer,force:e.force};n.verifyHLSPlaybackBuffer(r,e.time)["catch"](function(){return a(e.time+1)}),t?n.triggerSeekForLive(s):n.triggerSeek(s)};i.forEach(function(e){r.addEventListener(e,a),n.lastDelayedSeekHandlers[e]=a})},e.prototype.setAudio=function(e){var t=b.ArrayHelper.toArray(this.video.audioTracks),i=t.find(function(t){return t.id===e});i&&this.enableAudioTrack(i)},e.prototype.dispatchAudioChangedEvent=function(e,t){this.eventCallback(p.PlayerEvent.AudioChanged,{targetAudio:{id:t.id,label:t.label,lang:t.language},sourceAudio:e,time:this.video.currentTime})},e.prototype.enableAudioTrack=function(e){if(!e.enabled){var t=b.ArrayHelper.toArray(this.video.audioTracks),i=t.find(function(e){return e.enabled});i.enabled=!1;var n=this.convertAudioTrackNativeToApi(i);e.enabled=!0,this.dispatchAudioChangedEvent(n,e)}},e.prototype.setVolume=function(e,t){var i=this.getElement(),n=this.currentVol,r=Math.min(e/100,1);n!==r&&(this.currentVol=r,i.volume=r,this.eventCallback(p.PlayerEvent.VolumeChanged,{targetVolume:100*r,sourceVolume:100*n,issuer:t||"api"}))},e.prototype.startManifestTimeoutTimer=function(){var e=this;clearTimeout(this.loadTimeoutID),this.hasSourceBeenLoaded||(this.loadTimeoutID=setTimeout(function(){e.loadTimeoutID=null,e.hasSourceBeenLoaded||(e.type===v.StreamType.Hls?e.eventHandler.fireError(new l.PlayerError(s.ErrorCode.NETWORK_MANIFEST_DOWNLOAD_TIMEOUT)):e.type===v.StreamType.Progressive&&e.eventHandler.fireError(new l.PlayerError(s.ErrorCode.NETWORK_PROGRESSIVE_STREAM_DOWNLOAD_TIMEOUT)))},P.toMilliSeconds(this.settings.XHR_TIMEOUT/2)))},e.getContentDomain=function(e){var t=document.createElement("a");return t.href=e,""===t.host&&(t.href=t.href),t.hostname},e.prototype.load=function(t,i,n,r){var a=this;this.stateManager=this.context.serviceManager.get(h.ServiceName.PlayerStateService),this.stateManager.transitionToSeekedState(!1),this.video.setAttribute("preload","metadata"),this.type=this.context.sourceContext.technology.streaming,this.sourceConfig=t,t.type&&(this.type=t.type),this.loaded===!0&&this.unload()["catch"](function(){}),this.hasSourceBeenLoaded=!1,this.hasDataBeenLoaded=!1,this.getElement().nativeMediaEventListener.reset(),this.isInitialSeek=!0,this.ignoreNextVideoError=!1,t.hasOwnProperty("vr")&&t.vr&&Boolean(t.vr.restrictedInlinePlayback)?(this.restrictedInlinePlayback=!0,this.audio=C.Util.getVRAudioElement(),this.addEventListeners(this.audio)):(this.audio=null,this.restrictedInlinePlayback=!1,this.addEventListeners(this.video)),this.eventHandler.on(p.PlayerEvent.TimeChanged,this.onTimeChanged),this.unsubscribeFromStoreStoppedListener=E.subscribe(this.context.store)(function(e){return T.getIsStopped(T.getPlayerState(e))},this.onContentPlaybackFinished,function(e){return e===!0}),n?this.settings.GLOBAL_DISABLE_SEEKING=n:this.settings.GLOBAL_DISABLE_SEEKING=!1,this.seekingTimeoutId>-1&&(clearTimeout(this.seekingTimeoutId),this.seekingTimeoutId=-1);var o="";t&&t.url&&("string"==typeof t.url?o=t.url:t.url.length>0&&(o=t.url[0].url));var s=window.location.hostname===e.getContentDomain(o);t.hasOwnProperty("vr")&&Boolean(t.vr)&&!s&&(this.originalCrossOriginAttributeValue=this.video.getAttribute("crossOrigin"),this.video.setAttribute("crossOrigin","anonymous")),this.video.eventHandler.reset(),this.isProgressiveQualityChange||(this.textTrackController=this.createTextTrackController()),this.loadingDeferred=new k.Deferred;var l=Promise.resolve();return this.type===v.StreamType.Hls?l=this.loadHls(t):this.type===v.StreamType.Progressive&&(l=this.loadProgressive(t,r).then(function(){return a.loadVideoElement()})),this.loadingDeferred.promise.then(function(){a.context.sourceContext.source=t.config}).then(function(){return l}
11).then(function(){return a.initializeLoadedState(t)})},e.prototype.initializeLoadedState=function(e){this.currentSource=e,this.loaded=!0,this.lastLegalPlaybackPosition=0,this.ignoreNextDelta=!1},e.prototype.loadVideoElement=function(){this.config.tweaks.prevent_video_element_preloading||this.video.load()},e.prototype.setupVideoElement=function(t,i){var n=this;if(t.config.drm&&t.config.drm.fairplay){var r=D.ModuleManager.get(L.ModuleName.DRM).FairplayHandler;this.fpsHandler=new r(this.context,this.video,t.config.drm.fairplay)}var a=e.createSourceElement(i,null);this.appendAndSetVideoStream(a,"0",t);var o={element:a,handler:function(e){var t,i;n.logger.debug("native hls source has thrown an error: "+(i=null===(t=e)||void 0===t?void 0:t.message,null!==i&&void 0!==i?i:e)),clearTimeout(n.loadTimeoutID),n.loaded=!0,n.loadingDeferred.reject(),n.eventHandler.fireError(new l.PlayerError(s.ErrorCode.SOURCE_HLS_STREAM_ERROR))}};this.sourceElementEventListeners.push(o),o.element.addEventListener(I.MediaElementEvent.error,o.handler)},e.prototype.setSourceAndLoadVideoElement=function(e,t){this.setupVideoElement(e,t),this.loadVideoElement()},e.prototype.setVideoForServiceWorker=function(e,t){var i=this,n=M.URLHelper.appendQueryParametersToUrl(t,a(a({},this.context.config.tweaks.query_parameters),{"bitmovin-player-id":this.context.internalPlayerID}));return this.setSourceAndLoadVideoElement(e,n),this.hlsManifestController.resolveMasterManifest(e.url).then(function(){})["catch"](function(e){i.logger.debug("Couldn't access master playlist with ServiceWorker: "+e)})},e.prototype.setVideoForNativeHLSParsing=function(e,t){var i=this;return H.createHlsManifestController(this.context).then(function(n){return i.hlsManifestController=n,i.settings.NATIVE_HLS_DOWNLOAD_ERROR_HANDLING&&(i.downloadErrorHandler=new w.HlsDownloadErrorHandler(i.context,n)),H.shouldUseServiceWorker(i.context)?i.setVideoForServiceWorker(e,t):i.hlsManifestController.resolveMasterManifest(e.url).then(function(t){0!==t.indexOf("data")&&0!==t.indexOf("blob")||i.setSourceAndLoadVideoElement(e,t)})["catch"](function(e){i.logger.debug("Couldn't access master playlist for native HLS parsing: "+e)})})},e.prototype.loadHls=function(e){"string"!=typeof e.url&&this.eventHandler.fireError(new l.PlayerError(s.ErrorCode.SOURCE_INVALID));var t=this.adjustUrlForQueryParams(e.url);return this.settings.NATIVE_HLS_PARSING?this.setVideoForNativeHLSParsing(e,t):(this.setSourceAndLoadVideoElement(e,t),Promise.resolve())},e.prototype.loadProgressive=function(e,t){var i,n=this,a=!1;Array.isArray(e.url)?i=e.url:(i=[{url:e.url,bitrate:0}],a=!0),t=t||r(i),this.availableVideoStreams=[];var o=this.loadAllSupportedProgressiveSources(i,t,!a);if(o){var d={element:o,handler:function(e){var t,i;n.logger.debug("last/only source has thrown an error "+(i=null===(t=e)||void 0===t?void 0:t.message,null!==i&&void 0!==i?i:e),e),clearTimeout(n.loadTimeoutID),n.loaded=!0,n.loadingDeferred.reject(),n.eventHandler.fireError(new l.PlayerError(s.ErrorCode.SOURCE_PROGRESSIVE_STREAM_ERROR))}};this.sourceElementEventListeners.push(d),d.element.addEventListener(I.MediaElementEvent.error,d.handler),this.restrictedInlinePlayback&&this.audio&&this.audio.load()}return Promise.resolve()},e.prototype.loadAllSupportedProgressiveSources=function(t,i,n){for(var r,a=[],o=-1,s=null,l=null,d=0;d<t.length;d++){var u=t[d];if(!this.shouldIgnoreSourceObject(u,l,n)){if(r=e.createSourceElement(this.adjustUrlForQueryParams(u.url),u.type),l=l||u.type,this.addStreamToAvailableOnes(String(d),u),n){if(a.indexOf(u.type)>-1){this.logger.debug("Stream of mime type "+u.type+" already added.. continuing");continue}i===String(d)?(s=r,o=u.bitrate,this.appendAndSetVideoStream(r,String(d),u),a.push(u.type)):o===u.bitrate&&(s=r,this.appendVideoStream(r),a.push(u.type))}else s=r,this.appendAndSetVideoStream(r,String(d),u);this.restrictedInlinePlayback&&this.audio&&(this.audio.innerHTML=this.video.innerHTML)}}return s},e.prototype.shouldIgnoreSourceObject=function(t,i,n){return!e.isValidProgressiveSourceObject(t)||!!n&&(!this.isMimeTypeSupported(t.type)||!!i&&i!==t.type)},e.isValidProgressiveSourceObject=function(e){return"object"==typeof e&&(e&&e.url&&""!==e.url)}
vendor: 15,354 bytes, lines 11-12
11,e.prototype.appendAndSetVideoStream=function(e,t,i){this.video.appendChild(e),this.setCurrentVideoStream(t,i)},e.prototype.appendVideoStream=function(e){this.video.appendChild(e);
12},e.prototype.addStreamToAvailableOnes=function(e,t){var i={id:e};t.bitrate&&(i.bitrate=t.bitrate),i.label=String(t.label||t.bitrate||"unknown"),this.availableVideoStreams.push(i)},e.prototype.setCurrentVideoStream=function(e,t){this.currentVideoStream={id:e},t.bitrate&&(this.currentVideoStream.bitrate=t.bitrate),this.currentVideoStream.label=""+(t.label||t.bitrate||"unknown")},e.prototype.isMimeTypeSupported=function(e){return!(this.video.canPlayType(e).length<=0)||(this.logger.debug("Mime type"+e+" not supported.. continuing"),!1)},e.createSourceElement=function(e,t){var i=document.createElement("source");return i.src=e,t&&(t.indexOf("/")<0&&(t="video/"+t),i.type=t),i},e.prototype.unload=function(e,t){void 0===e&&(e="api"),void 0===t&&(t=!1);var i;return this.hlsLiveTimeTracker.onUnload(e),this.clearDelayedSeekHandlers(),this.loadingDeferred&&!t&&this.loadingDeferred.reject(),clearTimeout(this.loadedDataFallbackTimeoutID),clearTimeout(this.loadTimeoutID),this.ended=!1,this.fpsHandler=c.dispose(this.fpsHandler),this.downloadErrorHandler=c.dispose(this.downloadErrorHandler),this.hlsManifestController=c.dispose(this.hlsManifestController),this.hlsSeekingGlitchEventHandlers.forEach(function(e){return e.el.removeEventListener(e.ev,e.fn)}),this.hlsSeekingGlitchEventHandlers=[],this.isProgressiveQualityChange||(null===(i=this.textTrackController)||void 0===i?void 0:i.signalSourceChange(),this.textTrackController=c.dispose(this.textTrackController)),this.clearVideoElement(),this.clearAudioElement(),this.pause(),this.ignoreNextVideoError=!0,this.clearEventListeners(),this.unsubscribeFromStoreStoppedListener&&this.unsubscribeFromStoreStoppedListener(),this.allowedToThrowEvents&&(this.currentVideoStream=null),this.loaded&&(this.loaded=!1,t||(this.eventCallback(p.PlayerEvent.SourceUnloaded,{oldSource:this.currentSource}),this.lastDuration=null)),Promise.resolve()},e.prototype.clearAudioElement=function(){if(this.restrictedInlinePlayback&&this.audio){for(this.audio.removeAttribute("src");this.audio.firstChild;)this.audio.removeChild(this.audio.firstChild);this.audio.load()}},e.prototype.clearEventListeners=function(){this.restrictedInlinePlayback?this.audio&&this.removeEventListeners(this.audio):this.removeEventListeners(this.video),this.clearDelayedSeekHandlers(),this.eventHandler.off(p.PlayerEvent.TimeChanged,this.onTimeChanged),this.eventHandler.off(p.PlayerEvent.TimeChanged,this.delayedSeek),this.sourceElementEventListeners.forEach(function(e){try{e.element.removeEventListener(I.MediaElementEvent.error,e.handler)}catch(t){}})},e.prototype.clearVideoElement=function(){A.VideoElementUtil.removeSource(this.video),null!=this.originalCrossOriginAttributeValue?this.video.setAttribute("crossOrigin",this.originalCrossOriginAttributeValue):this.video.removeAttribute("crossOrigin"),this.video.load()},e.prototype.isReady=function(){return this.restrictedInlinePlayback&&this.audio&&"readyState"in this.audio?this.audio.readyState!==HTMLMediaElement.HAVE_NOTHING:!("readyState"in this.video)||this.video.readyState!==HTMLMediaElement.HAVE_NOTHING},e.prototype.isLive=function(){return this.getElement().duration===1/0},e.prototype.isPlaying=function(){return this.stateManager.isPlaying()},e.prototype.isPaused=function(){return this.stateManager.isPaused()},e.prototype.hasEnded=function(){return this.ended},e.prototype.isMuted=function(){return this.getElement().muted},e.prototype.isStalled=function(){return this.stateManager.isStalled},e.prototype.getVolume=function(){return 100*this.getElement().volume},e.prototype.getDuration=function(){return this.getElement().duration},e.prototype.convertAudioTrackNativeToApi=function(e){var t={id:e.id||String(b.ArrayHelper.toArray(this.video.audioTracks).indexOf(e)),label:e.label,lang:e.language,getQualities:null},i=this.getLabelForAudio(t);return i&&"string"==typeof i&&(t.label=i),t},e.prototype.getAudio=function(){var e=b.ArrayHelper.toArray(this.video.audioTracks),t=e.find(function(e){return e.enabled});return t?this.convertAudioTrackNativeToApi(t):null},e.prototype.getAvailableAudio=function(){var e=this;return b.ArrayHelper.toArray(this.video.audioTracks).map(function(t){return e.convertAudioTrackNativeToApi(t)})},e.prototype.getLabelForAudio=function(e){var t={id:e.id,lang:e.lang},i=this.getLabelingFunctionForAudio();return i(t)},e.prototype.getLabelingFunctionForAudio=function(){var t=this.context.sourceContext,i=t&&t.source&&t.source.labeling;return i&&i[this.type]&&i[this.type].tracks?"function"!=typeof i[this.type].tracks?e.getDefaultLabelForAudio:i[this.type].tracks:e.getDefaultLabelForAudio},e.getDefaultLabelForAudio=function(){return null},e.prototype.getDownloadedVideoData=function(){return this.type===v.StreamType.Progressive?this.currentVideoStream:this.hlsManifestController?this.hlsManifestController.getDownloadedVideoData():{id:U,bitrate:0,height:0,width:0,isAuto:!0}},e.prototype.getDownloadedAudioData=function(){return{id:U,bitrate:0,isAuto:this.type===v.StreamType.Progressive}},e.prototype.createVideoQualityObject=function(e){var t={};return t.id=e.id,t.label=e.label,e.width>1?t.width=e.width:this.currentVideoStream&&this.currentVideoStream.id===e.id&&(this.currentVideoStream.width>1?t.width=this.currentVideoStream.width:!isNaN(this.video.videoWidth)&&this.video.videoWidth>1&&(t.width=this.video.videoWidth)),e.height>1?t.height=e.height:this.currentVideoStream&&this.currentVideoStream.id===e.id&&(this.currentVideoStream.height>1?t.height=this.currentVideoStream.height:!isNaN(this.video.videoHeight)&&this.video.videoHeight>1&&(t.height=this.video.videoHeight)),void 0!==e.bitrate&&"unknown"!==e.bitrate&&(t.bitrate=e.bitrate),t},e.prototype.getPlaybackVideoData=function(){if(this.hlsManifestController){var e=this.hlsManifestController.getPlayingVideoData();if(e)return e}if(this.currentVideoStream){var t=this.createVideoQualityObject(this.currentVideoStream);return"progressive"!==this.type&&(t.id=U),t}return{id:U,bitrate:0,height:this.video.videoHeight,width:this.video.videoWidth}},e.prototype.getPlaybackAudioData=function(){return{id:U,bitrate:0}},e.prototype.getMaxTimeShift=function(){var e=this.getSeekableRangeInternal();return this.isLive()&&e.start>=0?e.start-e.end:0},e.prototype.timeShift=function(e,t){if(this.isTimeShiftingAllowed()&&this.isTimeShiftNecessary(e,t))if(0===e){var i=this.getSeekableRangeInternal();i.end>=0&&this.seekForLive(i.end)}else this.seekForLive(e,t)},e.prototype.isTimeShiftNecessary=function(e,t){if(t===m.STARTUP_ISSUER_NAME&&!n(this.context.sourceContext.source.options))return!1;var i=Math.abs(Math.abs(e)-Math.abs(this.getTimeShift())),r=this.isOffsetConsideredAsLiveEdge(e);return i>V&&!(this.isAtLiveEdge&&r)},e.prototype.getTimeShift=function(){if(this.shouldReturnDefaultTimeshiftValue())return j;var e=this.getSeekableRangeInternal();if(e.start>=0&&this.needToUpdateTimeshiftValue()){var t=this.getElement().currentTime-e.end;this.isAtLiveEdge=this.isOffsetConsideredAsLiveEdge(t)&&!this.isStalledOrPaused(),this.currentTimeShift=this.isAtLiveEdge?j:t}return isFinite(this.currentTimeShift)?this.currentTimeShift:j},e.prototype.shouldReturnDefaultTimeshiftValue=function(){return!this.isLive()||!this.stateManager.hasBeenPlaying&&!this.stateManager.seekedOrTimeshifted||this.isAtLiveEdge},e.prototype.isStalledOrPaused=function(){return this.isStalled()||this.isPaused()},e.prototype.needToUpdateTimeshiftValue=function(){return!isFinite(this.currentTimeShift)||this.isStalledOrPaused()},e.prototype.getManifest=function(){return this.hlsManifestController?this.hlsManifestController.getManifest():null},e.prototype.getSnapshot=function(e,t){if(this.isPlaying()||this.isPaused()){var i=this.video.videoWidth,n=this.video.videoHeight;if(this.snapshotCanvas||(this.snapshotCanvas=document.createElement("canvas"),this.snapshotCanvas.id="snapshotHiddenCanvas"),!this.snapshotCanvas||!this.snapshotCanvas.getContext||!this.snapshotCanvas.getContext("2d"))return null;this.snapshotCanvas.height=n,this.snapshotCanvas.width=i,this.snapshotCanvasContext=this.snapshotCanvas.getContext("2d"),this.snapshotCanvasContext.drawImage(this.video.getWrappedElement(),0,0,i,n);var r=void 0;try{"image/jpeg"===e||"image/webp"===e?(Number(t)===t?(t<0||t>1)&&(t=1):t=1,r=this.snapshotCanvas.toDataURL(e,t)):r=this.snapshotCanvas.toDataURL(e,t)}catch(a){return a&&a.message?this.logger.debug("Snapshot acquisition failed: "+a.message):this.logger.debug("Snapshot acquisition failed"),null}return{height:n,width:i,data:r}}return null},e.prototype.setPlaybackSpeed=function(e){this.getElement().playbackRate=e},e.prototype.getPlaybackSpeed=function(){return this.getElement().playbackRate},e.prototype.permitControl=function(e){this.controlPermitted=e},e.prototype.resetTimeShift=function(){this.currentTimeShift=-(1/0),this.isTimeShiftingAllowed()&&(this.isAtLiveEdge=!1)},e.prototype.isOffsetConsideredAsLiveEdge=function(e){return Math.abs(e)<2*this.settings.SEEK_TO_END_OFFSET},e.prototype.isSeekTargetChangedDuringStartup=function(){return this.seekTargetTime!==this.lastVerifiedPlaybackPosition&&this.lastSeekIssuer===m.STARTUP_ISSUER_NAME},e.prototype.maybeHandleSeekTargetChangeDuringStartup=function(){this.isSeekTargetChangedDuringStartup()&&(this.context.logger.debug("Seek target changed during startup..."),this.triggerSeekEvent(this.seekTargetTime),this.lastSeekIssuer="api",this.seekTargetTime=-1)},e.prototype.finishedSeekedTransitionState=function(){this.stateManager.isSeeking()&&(this.stateManager.transitionToSeekedState(this.lastSeekIssuer!==m.STARTUP_ISSUER_NAME),this.lastSeekIssuer="api"),this.stateManager.isTimeShifting()&&this.stateManager.transitionToTimeShiftedState(this.lastSeekIssuer!==m.STARTUP_ISSUER_NAME)},e.prototype.addEventListeners=function(e){for(var t=0;t<this.elementEvents.length;t++){var i=this.elementEvents[t].elementSelector?this.elementEvents[t].elementSelector(e):e;i&&i.addEventListener(this.elementEvents[t].event,this.elementEvents[t].handler)}},e.prototype.removeEventListeners=function(e){for(var t=0;t<this.elementEvents.length;t++){var i=this.elementEvents[t].elementSelector?this.elementEvents[t].elementSelector(e):e;i&&i.removeEventListener&&i.removeEventListener(this.elementEvents[t].event,this.elementEvents[t].handler)}},e.prototype.getBufferLevel=function(e){var t={level:null,targetLevel:null,type:e,media:v.MediaType.Video},i=this.getElement(),n=i.currentTime;if(i.buffered&&i.buffered.length>0)for(var r=0;r<i.buffered.length;r++){var a=i.buffered.start(r),o=i.buffered.end(r);a>n||o<=n||(t.level=o-n,e===v.BufferType.BackwardDuration&&(t.level=n-a))}return t},e.prototype.createTextTrackController=function(){if(!D.ModuleManager.has(L.ModuleName.SubtitlesNative))return void this.logger.log("Unable to create native SubtitleController because the "+L.ModuleName.SubtitlesNative+" module is missing");var e=D.ModuleManager.get(L.ModuleName.SubtitlesNative).TextTrackController;return new e(this.context,this.video,this.config,this.type)},e.prototype.removeSubtitle=function(e){e&&this.textTrackController&&this.textTrackController.removeSubtitle(e)},e.prototype.addSubtitle=function(e){return this.textTrackController?(this.removeSubtitle(e.id),e.kind="subtitles",this.textTrackController.addSubtitle(e)):Promise.reject()},e.prototype.listSubtitles=function(){return this.textTrackController?this.textTrackController.getAvailableSubtitles():[]},e.prototype.enableSubtitle=function(e){return this.textTrackController?this.textTrackController.enableSubtitle(e):Promise.resolve(!1)},e.prototype.disableSubtitle=function(e){return this.textTrackController?Promise.resolve(this.textTrackController.disableSubtitle(e)):Promise.resolve(!1)},e.prototype.init=function(){this.initAirplay()},e.prototype.adjustUrlForQueryParams=function(e){return M.URLHelper.appendQueryParametersToUrl(e,this.settings.QUERY_PARAMETERS)},e.prototype.onFullscreenEnter=function(e){this.textTrackController&&S.getCapabilities().isIOS&&!e.legacy&&this.textTrackController.enableNative()},e.prototype.onFullscreenExit=function(){this.textTrackController&&S.getCapabilities().isIOS&&this.textTrackController.disableNative()},e.prototype.getAvailableVideoQualities=function(){var e=this;return"progressive"!==this.type?[]:this.availableVideoStreams.map(function(t){return e.createVideoQualityObject(t)})},e.prototype.getBufferedRanges=function(){var e=[],t=this.getElement();if(t&&t.buffered)for(var i=0;i<t.buffered.length;i++)e.push({start:t.buffered.start(i),end:t.buffered.end(i)});return e},e.prototype.setVideoQuality=function(e){var t=this,i=this.getPlaybackSpeed(),n=this.availableVideoStreams.find(function(t){return t.id===e});if("progressive"===this.type&&n&&(!this.currentVideoStream||this.currentVideoStream.id!==e)){this.isProgressiveQualityChange=!0,this.currentTimeWas=this.getCurrentTime(),this.availableVideoStreams=[],this.allowedToThrowEvents=!1;var r=this.stateManager.isPlaying()||this.stateManager.isPlay();this.stateManager.stallEnter(),this.unload("api",!0)["catch"](function(){});var o=this.createVideoQualityObject(n),s={sourceQuality:this.currentVideoStream,sourceQualityId:this.currentVideoStream?this.currentVideoStream.id:null,targetQuality:o,targetQualityId:o.id};this.eventHandler.one(p.PlayerEvent.StallEnded,function(){t.allowedToThrowEvents=!0,S.getCapabilities().isIOS||S.getCapabilities().isSafari?(t.numTimeChanged=0,t.eventHandler.on(p.PlayerEvent.TimeChanged,t.delayedSeek)):(t.numTimeChanged=1/0,t.delayedSeek()),r&&(t.play(m.INTERNAL_ISSUER_NAME)["catch"](function(){t.eventCallback(p.PlayerEvent.Warning,new d.PlayerWarning(u.WarningCode.PLAYBACK_COULD_NOT_BE_STARTED))}),t.stateManager.transitionToPlayingState(m.INTERNAL_ISSUER_NAME,!1))}),this.eventCallback(p.PlayerEvent.VideoQualityChanged,a({},s),!0),this.init(),this.load(this.sourceConfig,"",this.settings.GLOBAL_DISABLE_SEEKING,e).then(function(){t.setPlaybackSpeed(i),t.eventCallback(p.PlayerEvent.VideoDownloadQualityChange,a({},s),!0),t.eventCallback(p.PlayerEvent.VideoDownloadQualityChanged,a({},s),!0),t.eventCallback(p.PlayerEvent.VideoPlaybackQualityChanged,{sourceQuality:s.sourceQuality,targetQuality:s.targetQuality},!0)})}},e.prototype.initAirplay=function(){this.video.setAttribute("x-webkit-airplay","allow"),window.WebKitPlaybackTargetAvailabilityEvent&&(this.video.addEventListener(I.MediaElementEvent.webkitplaybacktargetavailabilitychanged,this.onWebkitPlaybackTargetAvailabilityChanged),this.video.addEventListener(I.MediaElementEvent.webkitcurrentplaybacktargetiswirelesschanged,this.onWebkitPlaybackTargetIsWirelessChanged))},e.prototype.isAirplayAvailable=function(){return this.airplayAvailable},e.prototype.isAirplayActive=function(){return this.video.isAirplayActive()},e.prototype.showAirplayTargetPicker=function(){this.isAirplayAvailable()&&(this.video.webkitShowPlaybackTargetPicker(),this.eventCallback(p.PlayerEvent.ShowAirplayTargetPicker))},e.prototype.getSeekableRangeInternal=function(){var e=this.video.seekable;if(e.length>0){var t={start:e.start(0),end:e.end(0)};return t.start=Math.max(0,t.start),t}return{start:-1,end:-1}},e.prototype.getSeekableRange=function(){return!this.isLive()||this.settings.ENABLE_SEEK_FOR_LIVE?this.get
12SeekableRangeInternal():{start:-1,end:-1}},e.prototype.createManifestApi=function(){return this.hlsManifestController?N.NativePlayerManifestApiFactory.create(this.hlsManifestController):null},e.prototype.release=function(){var e=this,t=this.unload("api")["catch"](function(){});return clearTimeout(this.loadTimeoutID),this.video.removeEventListener(I.MediaElementEvent.webkitplaybacktargetavailabilitychanged,this.onWebkitPlaybackTargetAvailabilityChanged),this.video.removeEventListener(I.MediaElementEvent.webkitcurrentplaybacktargetiswirelesschanged,this.onWebkitPlaybackTargetIsWirelessChanged),t=t.then(function(){e.type=null,e.config=null,e.eventHandler=null,e.settings=null,e.currentTimeWas=null,e.snapshotCanvas=null,e.snapshotCanvasContext=null,e.audio=null,e.video=null,e.lastPlayIssuer=null,e.lastPauseIssuer=null,e.lastSeekIssuer=null,e.currentSource=null,e.sourceConfig=null,e.currentVideoStream=null,e.availableVideoStreams=null,e.sourceElementEventListeners=null}),this.textTrackController&&this.textTrackController.dispose(),this.textTrackController=null,this.fpsHandler&&this.fpsHandler.dispose(),this.fpsHandler=null,this.downloadErrorHandler&&this.downloadErrorHandler.dispose(),this.downloadErrorHandler=null,this.hlsManifestController&&this.hlsManifestController.dispose(),this.hlsManifestController=null,t},e.prototype.setQueryParameters=function(e){this.settings.QUERY_PARAMETERS=e},e.prototype.clearQueryParameters=function(){this.settings.QUERY_PARAMETERS=void 0},e.prototype.setAudioQuality=function(e){},e.prototype.setTargetBufferLevel=function(){},e.prototype.getAvailableAudioQualities=function(){return[]},e.prototype.getDroppedVideoFrames=function(){return 0},e.prototype.getTotalStalledTime=function(){return 0},e.prototype.updateCallback=function(e){},e.prototype.getAvailableSegments=function(){return{}},e.prototype.getLatency=function(){return null},e.prototype.setTargetLatency=function(e){},e.prototype.getTargetLatency=function(){return null},e.prototype.setCatchupConfig=function(e){},e.prototype.getCatchupConfig=function(){return null},e.prototype.setFallbackConfig=function(e){},e.prototype.getFallbackConfig=function(){return null},o([f.trackPerformance("NativePlayer.load",!0)],e.prototype,"load",null),e}();t.NativePlayer=W},281:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(8),r=function(){function e(){}return e.prototype.getSupportedTechnologies=function(){return[{player:n.PlayerType.Native,streaming:n.StreamType.Progressive},{player:n.PlayerType.Native,streaming:n.StreamType.Hls},{player:n.PlayerType.Native,streaming:n.StreamType.Dash}]},e}();t.TechnologyChecker=r},533:function(e,t,i){"use strict";function n(e,t,i){for(var n=[],r=0,a=0;a<e.length;a++){var o=e[a];r=0;for(var s=0;s<o.timeline.length;s++){var l=o.timeline[s];if(l.playbackTime+l.duration>=i&&(n.push(l.uri),r++),r>t)break}}return n}var r=this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0});var a,o=i(21),s=i(17),l=i(1),d=i(13),u=i(5),h=i(2),c=i(0),p=i(223),g=i(534),m=i(536),f=i(539),v=function(e){function t(t){var i=e.call(this,t)||this;return i.onLoadPlaylistError=function(e){return i.context.logger.debug("Error while loading the playlist ",e),null},a=h.ModuleManager.get(c.ModuleName.HLS).PlaylistUtils,i.hlsDownloadService=new m.HlsDownloadService(i.context),i.segmentTimelineController=new g.FallbackSegmentTimelineController(t.videoElement),i}return r(t,e),t.prototype.init=function(){return Promise.resolve()},t.prototype.getDownloadedVideoData=function(){return{id:"not available",bitrate:0,height:0,width:0,isAuto:!0}},t.prototype.getPlayingVideoData=function(){return null},t.prototype.downloadMasterManifest=function(e){var t=this;return this.hlsDownloadService.downloadPlaylist(e,d.HttpRequestType.MANIFEST_HLS_MASTER).then(function(i){var n=t.registerMasterManifest(i,e),r=t.parsedManifest.playlists[0].uri;return t.registerFirstVariantPlaylist(r).then(function(i){return t.overrideManifestUrl(n,e,i)})})},t.prototype.registerFirstVariantPlaylist=function(e){var t=this,i=this.concatManifestUrl(e);
12return this.parsedManifest.playlists.forEach(function(t){t.uri===e&&(t.uri=i)}),this.hlsDownloadService.downloadPlaylist(i,d.HttpRequestType.MANIFEST_HLS_VARIANT).then(this.registerVariantPlaylist).then(function(e){return a.isLive(e)&&t.scheduleReload(e,t.parsedManifest.playlists[0].uri),e})},t.prototype.overrideManifestUrl=function(e,t,i){return"createObjectURL"in window.URL?this.getManifestUrl(e,t,i):(this.context.eventHandler.dispatchEvent(l.PlayerEvent.Warning,new o.PlayerWarning(s.WarningCode.SETUP_CREATE_OBJECT_URL_MISSING)),Promise.resolve(this.manifestUrl))},t.prototype.getManifestUrl=function(e,t,i){var n=this;if(a.isLive(i)){var r=f.replaceManifestUrls(t,e,this.settings.QUERY_PARAMETERS);return Promise.resolve(this.createDataUrlForManifest(r))}var o=f.replaceManifestUrls(t,e);return Promise.all(this.getMediaPlaylistPromises(o)).then(function(e){return e.filter(function(e){return Boolean(e)}).forEach(function(e){o=o.replace(e.mediaUrl,e.blobUrl)}),n.createDataUrlForManifest(o)})},t.prototype.getMediaPlaylistPromises=function(e){var t=this;return e.split("\n").map(function(e){return f.parseUrlFromLine(e)}).filter(function(e){return null!==e}).map(function(e){return t.getMediaPlaylistBlobUrlMapping(e)})},t.prototype.getMediaPlaylistBlobUrlMapping=function(e){var t=this;return this.hlsDownloadService.downloadPlaylist(e,d.HttpRequestType.MANIFEST_HLS_VARIANT).then(function(i){var n=f.replaceManifestUrls(e,i.body,t.settings.QUERY_PARAMETERS);return{blobUrl:t.createBlobForManifest(n),mediaUrl:e}})["catch"](this.onLoadPlaylistError)},t.prototype.loadPlaylist=function(e){var t=this;return this.hlsDownloadService.downloadPlaylist(e.uri,d.HttpRequestType.MANIFEST_HLS_VARIANT).then(function(i){return{width:e.width,height:e.height,timeline:t.parseTimelineEntries(i.body)}})["catch"](this.onLoadPlaylistError)},t.prototype.reload=function(e){var t=this;return function(){return t.hlsDownloadService?void t.hlsDownloadService.downloadPlaylist(e,d.HttpRequestType.MANIFEST_HLS_VARIANT,!1).then(t.registerVariantPlaylist).then(function(e){return a.isLive(e)&&t.scheduleReload(e,t.parsedManifest.playlists[0].uri),e})["catch"](t.onLoadPlaylistError):function(){}}},t.prototype.scheduleReload=function(e,t){var i=this.concatManifestUrl(t);this.reloadTimerId=setTimeout(this.reload(i),u.toMilliSeconds(e.targetDuration))},t.prototype.createBlobForManifest=function(e){var t=new Blob([e],{type:"application/x-mpegURL"});return window.URL.createObjectURL(t)},t.prototype.createDataUrlForManifest=function(e){return"data:application/x-mpegURL,"+e.replace(/\n/g,"%0A").replace(/\r/g,"%0D")},t.prototype.getVariantPlaylistInfos=function(){var e=this;return this.parsedManifest.playlists.map(function(t){return{uri:e.concatManifestUrl(t.uri),width:t.attributes&&t.attributes.RESOLUTION?t.attributes.RESOLUTION.width:-1,height:t.attributes&&t.attributes.RESOLUTION?t.attributes.RESOLUTION.height:-1}})},t.prototype.loadAllVariantPlaylists=function(){var e=this,t=this.getVariantPlaylistInfos();t.reverse();var i=t.map(function(t){return e.loadPlaylist(t)});return Promise.all(i).then(function(t){var i=e.getPlaybackTimeOfFirstSegmentInTimeline(t);return i>=0&&t.forEach(function(e){e.timeline.reduce(function(e,t){return t.playbackTime=e,e+t.duration},i)}),t})},t.prototype.getCurrentSegments=function(e,t,i,r){return void 0===r&&(r=1),this.loadAllVariantPlaylists().then(function(a){var o=a.find(function(e){return e.width===t&&e.height===i}),s=o?[o]:a;return n(s,r,e)})},t.prototype.dispose=function(){e.prototype.dispose.call(this),clearTimeout(this.reloadTimerId),this.reloadTimerId=null},t}(p.AbstractHlsManifestController);t.FallbackHlsManifestController=v},534:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(184),r=function(){function e(e){this.videoElement=e,this.shouldCalculatePlaybackTimeForLive=!0,this.timelines={}}return e.prototype.isLiveStream=function(){return this.videoElement.duration===1/0},e.prototype.switchTimeline=function(e){this.timelines[e]||(this.currentActiveTimelineId=e,this.timelines[e]=[])},e.prototype.updateTimeline=function(e,t){var i=this,r=this.timelines[e],a=n.updateTimeline(r,t),o=a.findIndex(function(e){return e.hasOwnProperty("playbackTime")});o!==-1&&n.populateCurrentTimelineWithPlaybackTime(a,o,a[o].playbackTime),this.timelines[e]=a;var s=a.reduce(function(e,t){return i.isLiveStream()&&!i.shouldCalculatePlaybackTimeForLive||(t.playbackTime=e),e+t.duration},0);return this.shouldCalculatePlaybackTimeForLive&&(this.shouldCalculatePlaybackTimeForLive=!1),s},e.prototype.getPlayingSegment=function(e){for(var t=this.getCurrentTimeline(),i=0;i<t.length;i++){var n=t[i];if(e>=n.playbackTime&&e<=n.playbackTime+n.duration)return t[i]}return null},e.prototype.addDownloadedSegments=function(e){},e.prototype.getCurrentTimeline=function(){return this.timelines[this.currentActiveTimelineId]},e.prototype.getAllTimelines=function(){return this.timelines},e.prototype.reset=function(){this.timelines[this.currentActiveTimelineId].forEac
12h(function(e){return e.consumed=!1})},e.prototype.dispose=function(){this.timelines={},this.videoElement=null},e}();t.FallbackSegmentTimelineController=r},535:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(6),r=i(7),a=i(18),o=i(128),s=i(13),l=i(20),d=i(14),u=function(){function e(e,t){var i=this;this.fakeProgress=function(){for(var e=i.video.buffered,t="",n=0;n<e.length;n++)t+=e.start(n)+" - "+e.end(n)+", ";t===i.lastProgressString?i.numProgressNotChanged++:i.numProgressNotChanged=0,i.numProgressNotChanged>=10&&i.onStalled(),i.lastProgressString=t},this.fakeWaiting=function(){var e=o.TimingUtil.getHiResTimestamp(),t=!i.video.paused&&!i.video.seeking&&!i.video.ended;e-i.lastTimeUpdateTimeStamp>5&&t&&i.onWaiting()},this.onStalled=function(){i.stalledTimeStamp=o.TimingUtil.getHiResTimestamp(),i.checkStalledState()},this.onProgress=function(){i.stalledTimeStamp=-(1/0),clearTimeout(i.downloadErrorCheckTimeoutId)},this.onWaiting=function(){i.waitingEventTimeStamp=o.TimingUtil.getHiResTimestamp(),i.checkStalledState()},this.onTimeUpdate=function(){i.waitingEventTimeStamp=-(1/0),i.lastTimeUpdateTimeStamp=o.TimingUtil.getHiResTimestamp(),clearTimeout(i.downloadErrorCheckTimeoutId)},this.checkForDownloadError=function(){if(0!==i.video.buffered.length){var e=i.video.currentTime,t=i.video.buffered.end(i.video.buffered.length-1),o=e<=t&&e+.5>t,l=i.video.paused,d=i.video.networkState===HTMLMediaElement.NETWORK_LOADING,u=i.video.videoWidth,h=i.video.videoHeight;!l&&o&&d&&i.manifestController.getCurrentSegments(t,u,h,2).then(function(e){var t=new a.DefaultContentLoader(i.context),o=function(i,n){return void 0===i&&(i=!0),e.length>0&&i?t.load(e.pop(),s.HttpRequestMethod.HEAD).then(function(e){return o(e.status>=200&&e.status<300,e)}):i?Promise.resolve():Promise.reject(n)};o()["catch"](function(e){var t=e.url,a=e.status,o=e.statusText;i.context.logger.debug("Segment request for "+t+" probably failed ("+a+": "+o+")"),i.context.eventHandler.fireError(new r.PlayerError(n.ErrorCode.NETWORK_SEGMENT_DOWNLOAD_TIMEOUT))})})}},this.context=e,this.video=e.videoElement,this.manifestController=t,this.playbackAdvancing=!1,this.stalledTimeStamp=-(1/0),this.waitingEventTimeStamp=-(1/0),this.downloadErrorCheckTimeoutId=-1,this.lastProgressString="",this.numProgressNotChanged=0,this.lastTimeUpdateTimeStamp=-(1/0),this.video.addEventListener(d.MediaElementEvent.waiting,this.onWaiting),this.video.addEventListener(d.MediaElementEvent.stalled,this.onStalled),this.video.addEventListener(d.MediaElementEvent.progress,this.onProgress),this.video.addEventListener(d.MediaElementEvent.timeupdate,this.onTimeUpdate),l.getCapabilities().isIOS&&(this.fakeEventsIntervalId=window.setInterval(function(){i.fakeProgress(),i.fakeWaiting()},500))}return e.prototype.checkStalledState=function(){var e=Math.abs(this.waitingEventTimeStamp-this.stalledTimeStamp);clearTimeout(this.downloadErrorCheckTimeoutId),isFinite(e)&&(this.downloadErrorCheckTimeoutId=window.setTimeout(this.checkForDownloadError,1e3*(5-Math.min(5,e))))},e.prototype.dispose=function(){clearTimeout(this.fakeEventsIntervalId),clearTimeout(this.downloadErrorCheckTimeoutId),this.video.removeEventListener(d.MediaElementEvent.waiting,this.onWaiting),this.video.removeEventListener(d.MediaElementEvent.stalled,this.onStalled),this.video.removeEventListener(d.MediaElementEvent.progress,this.onProgress),this.video.removeEventListener(d.MediaElementEvent.timeupdate,this.onTimeUpdate),this.video=null,this.manifestController=null},e}();t.HlsDownloadErrorHandler=u},536:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(21),r=i(17),a=i(1),o=i(18),s=i(13),l=function(){function e(e){var t=this;this.useCredentialsForManifestRequests=!1,this.downloadFailureHandler=function(e){t.context.eventHandler.dispatchEvent(a.PlayerEvent.Warning,new n.PlayerWarning(r.WarningCode.NETWORK_COULD_NOT_LOAD_MANIFEST)),t.context.logger.debug("Could not load manifest, got HTTP status code "+e.status)},this.context=e,this.init()}return e.prototype.init=function(){this.initCache(),this.initUseCredentialsForManifest()},e.prototype.initCache=function(){this.requestCache={}},e.prototype.initUseCredentialsForManifest=function(){var e=this.context.sourceContext.source&&this.context.sourceContext.source.options||{};this.useCredentialsForManifestRequests="boolean"==typeof e.hlsManifestWithCredentials?e.hlsManifestWithCredentials:e.manifestWithCredentials===!0},e.prototype.downloadPlaylist=function(e,t,i){return void 0===i&&(i=!0),i&&this.requestCache.hasOwnProperty(e)?Promise.resolve(this.requestCache[e]):this.download(t,e)},e.prototype.download=function(e,t){var i=this,n=this.getContentLoader(e);return n.load(t,s.HttpRequestMethod.GET,s.HttpResponseType.TEXT,null,{},this.useCredentialsForManifestRequests).then(function(e){return n.dispose(),i.requestCache[t]=e,e})["catch"](function(e){return n.dispose(),Promise.reject(e)})},e.prototype.getContentLoader=function(e){return new o.DefaultContentLoader(this.context,{onFailure:this.downloadFailureHandler,maxRetries:this.context.settings.MAX_MPD_RETRIES,requestType:e})},e.prototype.dispose=function(){},e}();t.HlsDownloadService=l},537:function(e,t,i){"use strict";
12Object.defineProperty(t,"__esModule",{value:!0});var n=i(39),r=i(5),a=i(12),o=i(14),s=2e3,l=function(){function e(e,t){this.nativePlayer=e,this.context=t,this.timeAdjustment=0,this.unloadTimestamp=null,this.startDate=null}return e.prototype.onUnload=function(e){e===n.ADVERTISING_ISSUER_NAME&&this.context.settings.RESUME_LIVE_CONTENT_AT_PREVIOUS_POSITION_AFTER_AD_BREAK&&null==this.unloadTimestamp&&(this.nativePlayer.isLive()?(this.unloadTimestamp=Date.now(),this.timeAdjustment=this.nativePlayer.getSeekableRange().start,this.startDate=this.nativePlayer.getStartDate()):this.reset())},e.prototype.reset=function(){this.unloadTimestamp=null,this.timeAdjustment=0,this.startDate=null},e.prototype.adjustTargetTime=function(e,t){var i=this;if(t!==n.ADVERTISING_RESTORE_ISSUER_NAME||null==this.unloadTimestamp)return this.context.logger.debug("No adjustments are made",this.unloadTimestamp),Promise.resolve(e);var o=null!=this.startDate?this.waitForStartDate():Promise.resolve(null);return o.then(function(t){if(null!=t){i.context.logger.debug("StartDate progressed from "+i.startDate+" to: "+t+" during the ad");var n=a.Util.timeInSeconds(t)-a.Util.timeInSeconds(i.startDate);i.timeAdjustment=n}else{i.context.logger.debug("Adjusting time based on seekable range");var o=r.toSeconds(Date.now()-i.unloadTimestamp);i.timeAdjustment+=o}var s=e-i.timeAdjustment;return i.context.logger.debug("Adjusting target time from "+e+" by "+i.timeAdjustment+" to "+s),i.reset(),s})},e.prototype.waitForStartDate=function(){var e=this,t=this.getValidDateTime();return t?Promise.resolve(t):new Promise(function(t){var i=null,n=function(){t(e.getValidDateTime()),e.context.videoElement.removeEventListener(o.MediaElementEvent.loadeddata,n),clearTimeout(i)};e.context.logger.debug("Waiting for video.startDate to be valid"),e.context.videoElement.addEventListener(o.MediaElementEvent.loadeddata,n),i=setTimeout(n,s)})},e.prototype.getValidDateTime=function(){var e=this.nativePlayer.getStartDate();return e&&!isNaN(e.getTime())?e:null},e}();t.HlsLiveNativeTimeTracker=l},538:function(e,t,i){"use strict";function n(e){if(r(e)){var t=o.ModuleManager.get(s.ModuleName.ServiceWorkerClient).createServiceWorkerHlsManifestController(l.AbstractHlsManifestController),i=new t(e);
13return i.init().then(function(){return i})["catch"](function(){return a(e)})}return a(e)}function r(e){var t=e.config.location&&e.config.location.serviceworker;return"serviceWorker"in navigator&&t&&o.ModuleManager.has(s.ModuleName.ServiceWorkerClient)}function a(e){var t=new d.FallbackHlsManifestController(e);return t.init().then(function(){return t})}Object.defineProperty(t,"__esModule",{value:!0});var o=i(2),s=i(0),l=i(223),d=i(533);t.createHlsManifestController=n,t.shouldUseServiceWorker=r},539:function(e,t,i){"use strict";function n(e,t,i){var n=t.split(/\r?\n/);return n.forEach(function(t,o){var l=r(t);if(l&&t.match(s)){var d=a(e,l,i);n[o]=t.replace(s,'URI="'+d+'"')}else l&&(n[o]=a(e,l,i))}),n.join("\n")}function r(e){if("#"!==e[0]&&e.trim().length>0)return e;if(e.indexOf("URI")>-1){var t=e.match(s);if(t&&t[1].indexOf("skd://")<0&&t[1].indexOf("skds://")<0)return t[1]}return null}function a(e,t,i){var n=o.URLHelper.concatBaseUrlWithPartial(e,t);return o.URLHelper.appendQueryParametersToUrl(n,i)}Object.defineProperty(t,"__esModule",{value:!0});var o=i(10),s=/URI="([^"]+)"/;t.replaceManifestUrls=n,t.parseUrlFromLine=r,t.replaceUrlAndAddUriParams=a},540:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(0),r=i(280),a=i(281);t.NativeModuleDefinition={name:n.ModuleName.EngineNative,module:{NativePlayer:r.NativePlayer,technologyChecker:new a.TechnologyChecker}}
13,t["default"]=t.NativeModuleDefinition},541:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(26),r=function(){function e(){}return e.create=function(t){var i=t.getParsedManifest();return t.isValidMasterPlaylist(i)?new(function(){function i(){this.hls=e.createHlsApi(t)}return i}()):null},e.createHlsApi=function(t){var i=t.getParsedManifest(),n=i.media.filter(function(e){return"AUDIO"===e.attributes.TYPE}),r=i.media.filter(function(e){return"SUBTITLES"===e.attributes.TYPE||"CLOSED-CAPTIONS"===e.attributes.TYPE});return new(function(){function a(){this.properties=t.getParsedManifest().tags}return a.prototype.getVideoTracks=function(){return e.getVideoTracks(i.playlists)},a.prototype.getAudioTracks=function(){return e.getAudioTracks(n,i.playlists)},a.prototype.getTextTracks=function(){return e.getTextTracks(r)},a}())},e.getAudioTracks=function(e,t){var i=e.reduce(function(e,t){return e[t.attributes.LANGUAGE]||(e[t.attributes.LANGUAGE]=t.attributes.NAME),e},{}),r=Object.keys(i).map(function(t,n){return{id:"audio-"+n,label:i[t],lang:t,getQualities:function(){return e.filter(function(e){return e.attributes.LANGUAGE===t}).map(function(e,t){return{id:t+"",bitrate:0,label:e.attributes.NAME}})}}}),a=function(e){return e.attributes.CODECS&&n.CodecStringHelper.getMimeTypeForCodecString(e.attributes.CODECS).includes("audio")};return t.some(a)&&r.push({id:"audio-"+r.length,label:"und",lang:"",getQualities:function(){return t.filter(a).map(function(e,t){var i={id:t+"",bitrate:e.attributes.BANDWIDTH,codec:n.CodecStringHelper.extractCodecStrings(e.attributes.CODECS).audio};return i})}}),r},e.getVideoTracks=function(t){var i=function(e){return!e.attributes.CODECS||n.CodecStringHelper.getMimeTypeForCodecString(e.attributes.CODECS).includes("video")},r=t.filter(i);return[{id:"video-0",label:"und",getQualities:function(){return e.getVideoQualities(r)}}]},e.getTextTracks=function(e){return e.map(function(e,t){return{id:"text-"+t,label:e.attributes.NAME,lang:e.attributes.LANGUAGE,isFragmented:!0,kind:"CLOSED-CAPTIONS"===e.attributes.TYPE?"caption":"subtitle",url:e.attributes.URI}})},e.getVideoQualities=function(e){return e.map(function(e){var t=e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,i=e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height,r={id:i?i+"_"+e.attributes.BANDWIDTH:""+e.attributes.BANDWIDTH,bitrate:e.attributes.BANDWIDTH,width:t||0,height:i||0};if(e.attributes.CODECS){var a=n.CodecStringHelper.extractCodecStrings(e.attributes.CODECS);a.video&&(r.codec=a.video)}return r})},e}();t.NativePlayerManifestApiFactory=r}},[540])});
14})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.