bitmovin-player 8.280.0 → 8.281.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bitmovinplayer-serviceworker.js +2 -2
- package/bitmovinplayer-serviceworker.prod.js +2 -2
- package/bitmovinplayer-ui.js +1 -1
- package/bitmovinplayer.js +2 -2
- package/bitmovinplayer.prod.js +2 -2
- package/modules/bitmovinplayer-abr.js +2 -2
- package/modules/bitmovinplayer-abr.prod.js +2 -2
- package/modules/bitmovinplayer-advertising-bitmovin.js +2 -2
- package/modules/bitmovinplayer-advertising-bitmovin.prod.js +2 -2
- package/modules/bitmovinplayer-advertising-core.js +2 -2
- package/modules/bitmovinplayer-advertising-core.prod.js +2 -2
- package/modules/bitmovinplayer-advertising-ima.js +2 -2
- package/modules/bitmovinplayer-advertising-ima.prod.js +2 -2
- package/modules/bitmovinplayer-advertising-omsdk.js +2 -2
- package/modules/bitmovinplayer-advertising-omsdk.prod.js +2 -2
- package/modules/bitmovinplayer-analytics.js +2 -2
- package/modules/bitmovinplayer-analytics.prod.js +2 -2
- package/modules/bitmovinplayer-container-mp4.js +2 -2
- package/modules/bitmovinplayer-container-mp4.prod.js +2 -2
- package/modules/bitmovinplayer-container-ts.js +2 -2
- package/modules/bitmovinplayer-container-ts.prod.js +2 -2
- package/modules/bitmovinplayer-container-webm.js +2 -2
- package/modules/bitmovinplayer-container-webm.prod.js +2 -2
- package/modules/bitmovinplayer-core.js +2 -2
- package/modules/bitmovinplayer-core.prod.js +2 -2
- package/modules/bitmovinplayer-crypto.js +2 -2
- package/modules/bitmovinplayer-crypto.prod.js +2 -2
- package/modules/bitmovinplayer-dash.js +2 -2
- package/modules/bitmovinplayer-dash.prod.js +2 -2
- package/modules/bitmovinplayer-drm.js +2 -2
- package/modules/bitmovinplayer-drm.prod.js +2 -2
- package/modules/bitmovinplayer-engine-bitmovin.js +2 -2
- package/modules/bitmovinplayer-engine-bitmovin.prod.js +2 -2
- package/modules/bitmovinplayer-engine-native.js +2 -2
- package/modules/bitmovinplayer-engine-native.prod.js +2 -2
- package/modules/bitmovinplayer-engine-webrtc.js +2 -2
- package/modules/bitmovinplayer-engine-webrtc.prod.js +2 -2
- package/modules/bitmovinplayer-envivio.js +1 -1
- package/modules/bitmovinplayer-envivio.prod.js +1 -1
- package/modules/bitmovinplayer-hls.js +2 -2
- package/modules/bitmovinplayer-hls.prod.js +2 -2
- package/modules/bitmovinplayer-lowlatency.js +2 -2
- package/modules/bitmovinplayer-lowlatency.prod.js +2 -2
- package/modules/bitmovinplayer-mserenderer.js +2 -2
- package/modules/bitmovinplayer-mserenderer.prod.js +2 -2
- package/modules/bitmovinplayer-patch.js +1 -1
- package/modules/bitmovinplayer-patch.prod.js +1 -1
- package/modules/bitmovinplayer-playstation4.js +2 -2
- package/modules/bitmovinplayer-playstation4.prod.js +2 -2
- package/modules/bitmovinplayer-playstation5.js +2 -2
- package/modules/bitmovinplayer-playstation5.prod.js +2 -2
- package/modules/bitmovinplayer-polyfill.js +1 -1
- package/modules/bitmovinplayer-polyfill.prod.js +1 -1
- package/modules/bitmovinplayer-reactnative.js +1 -1
- package/modules/bitmovinplayer-reactnative.prod.js +1 -1
- package/modules/bitmovinplayer-remotecontrol.js +2 -2
- package/modules/bitmovinplayer-remotecontrol.prod.js +2 -2
- package/modules/bitmovinplayer-serviceworker-client.js +2 -2
- package/modules/bitmovinplayer-serviceworker-client.prod.js +2 -2
- package/modules/bitmovinplayer-serviceworker.js +2 -2
- package/modules/bitmovinplayer-serviceworker.prod.js +2 -2
- package/modules/bitmovinplayer-sgai.js +2 -2
- package/modules/bitmovinplayer-sgai.prod.js +2 -2
- package/modules/bitmovinplayer-smooth.js +2 -2
- package/modules/bitmovinplayer-smooth.prod.js +2 -2
- package/modules/bitmovinplayer-style.js +2 -2
- package/modules/bitmovinplayer-style.prod.js +2 -2
- package/modules/bitmovinplayer-subtitles-cea608.js +2 -2
- package/modules/bitmovinplayer-subtitles-cea608.prod.js +2 -2
- package/modules/bitmovinplayer-subtitles-native.js +2 -2
- package/modules/bitmovinplayer-subtitles-native.prod.js +2 -2
- package/modules/bitmovinplayer-subtitles-ttml.js +2 -2
- package/modules/bitmovinplayer-subtitles-ttml.prod.js +2 -2
- package/modules/bitmovinplayer-subtitles-vtt.js +2 -2
- package/modules/bitmovinplayer-subtitles-vtt.prod.js +2 -2
- package/modules/bitmovinplayer-subtitles.js +2 -2
- package/modules/bitmovinplayer-subtitles.prod.js +2 -2
- package/modules/bitmovinplayer-thumbnail-imp.js +2 -2
- package/modules/bitmovinplayer-thumbnail-imp.prod.js +2 -2
- package/modules/bitmovinplayer-thumbnail.js +2 -2
- package/modules/bitmovinplayer-thumbnail.prod.js +2 -2
- package/modules/bitmovinplayer-tizen.js +2 -2
- package/modules/bitmovinplayer-tizen.prod.js +2 -2
- package/modules/bitmovinplayer-ui.js +2 -2
- package/modules/bitmovinplayer-ui.prod.js +2 -2
- package/modules/bitmovinplayer-vidaa.js +2 -2
- package/modules/bitmovinplayer-vidaa.prod.js +2 -2
- package/modules/bitmovinplayer-vr.js +2 -2
- package/modules/bitmovinplayer-vr.prod.js +2 -2
- package/modules/bitmovinplayer-webos.js +2 -2
- package/modules/bitmovinplayer-webos.prod.js +2 -2
- package/modules/bitmovinplayer-wpe.js +2 -2
- package/modules/bitmovinplayer-wpe.prod.js +2 -2
- package/modules/bitmovinplayer-xml.js +1 -1
- package/modules/bitmovinplayer-xml.prod.js +1 -1
- package/package.json +1 -1
- package/types/advertising/API.d.ts +9 -0
- package/types/advertising/ConfigAPI.d.ts +6 -5
- package/types/core/BufferSettings.d.ts +58 -0
- package/types/core/LogLevels.d.ts +54 -0
- package/types/core/Logger.d.ts +51 -0
- package/types/core/Settings.d.ts +856 -0
- package/types/core/network/ManifestMimeType.d.ts +5 -0
- package/types/core/util/MimeTypeHelper.d.ts +52 -0
- package/types/sgai/SgaiConfigAPI.d.ts +1 -1
- package/types/sgai/SgaiErrorCode.d.ts +6 -1
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
* This software includes open-source components. See THIRD_PARTY_NOTICES
|
|
10
10
|
* in the distribution for details.
|
|
11
11
|
*
|
|
12
|
-
* Bitmovin Player Version 8.
|
|
12
|
+
* Bitmovin Player Version 8.281.0
|
|
13
13
|
*
|
|
14
14
|
****************************************************************************/
|
|
15
15
|
|
|
16
16
|
(function() {
|
|
17
|
-
"use strict";!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["engine-native"]=e():(t.bitmovin=t.bitmovin||{},t.bitmovin.player=t.bitmovin.player||{},t.bitmovin.player["engine-native"]=e())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[855],{48297:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractHlsManifestController=void 0;var n,r=i(80813),s=i(3714),a=i(32703),o=i(59225),u=i(32485),l=i(79721),h=i(89927),d=i(70850),c=i(88052),p=i(62756);!function(t){t.CueTag="cueTag",t.Scte35="scte35",t.DateRange="dateRange",t.CustomTags="customTags"}(n||(n={}));var v=function(){function t(t){var e,i=this;this.context=t,this.Hab=function(t){if(t.hasOwnProperty("metadata")){var e={metadataType:t.metadataType.toUpperCase(),metadata:t.metadata};(t.start||0===t.start)&&(e.start=t.start),t.end&&(e.end=t.end),i.context.eventHandler.dispatchEvent(s.PlayerEvent.Metadata,e)}},this.Iab=function(t){var e=i.segmentTimelineController.getPlayingSegment(t.relativeTime||t.time);e&&!e.consumed&&(e.consumed=!0,i.Kab(e),i.Jab(e))},this.Lab=function(){i.segmentTimelineController.reset()},this.Mab=function(){i.segmentTimelineController.reset()},this.settings=t.settings,this.Fab=t.eventHandler,this.Fab.on(s.PlayerEvent.TimeChanged,this.Iab),this.Fab.on(s.PlayerEvent.TimeShifted,this.Lab),this.Fab.on(s.PlayerEvent.Seeked,this.Mab),this.Gab=new o.MetadataService(this.context,((e={})[u.TimedMetadataType.Manifest]=this.Hab,e[u.TimedMetadataType.DateRange]=this.Hab,e))}return t.prototype.Jab=function(t){var e={url:t.uri,uid:null,mimeType:"video/mp4",playbackTime:t.playbackTime,duration:t.duration,mediaInfo:{},dateTime:null};t.dateTime&&(e.dateTime=t.dateTime.toISOString()),t.customTags&&t.customTags.length>0&&(e.EXPERIMENTAL=e.EXPERIMENTAL||{},e.EXPERIMENTAL.hlsAttributes=t.customTags.map(function(t){return t.attributes})),this.context.eventHandler.dispatchEvent(s.PlayerEvent.SegmentPlayback,e)},t.prototype.Kab=function(t){var e=this,i=t.dateTime?(0,h.toSeconds)(t.dateTime.getTime()):t.playbackTime,n=i+t.duration;t.metadata&&t.metadata.forEach(function(t){!function(t){return t.type.includes("CUE")}(t)?e.context.eventHandler.dispatchEvent(s.PlayerEvent.Metadata,{metadataType:t.type,metadata:t}):e.context.eventHandler.dispatchEvent(s.PlayerEvent.Metadata,{metadataType:s.MetadataType.CUETAG,metadata:t})}),t.customTags&&this.context.eventHandler.dispatchEvent(s.PlayerEvent.Metadata,{metadataType:s.MetadataType.CUSTOM,metadata:t.customTags,start:i,end:n})},t.prototype.isValidMasterPlaylist=function(t){return c.ModuleManager.get(p.ModuleName.HLS).NativeHlsManifestParserUtils.isValidMasterPlaylist(t)},t.prototype.Nab=function(t){return c.ModuleManager.get(p.ModuleName.HLS).NativeHlsManifestParserUtils.parsePlaylist(t)},t.prototype.dispatchDateRangeToParsedService=function(t){var e,i={metadataType:s.MetadataType.DATERANGE,metadata:t.data,data:t.data,start:t.startTime,end:t.endTime};null===(e=this.context.serviceManager.get(r.ServiceName.MetadataParsedService))||void 0===e||e.addMetadata(l.DEFAULT_PERIOD_ID,i)},t.prototype.Oab=function(t){return{metadataType:t.metadataType,metadata:t.metadata,data:t.metadata,start:t.start,end:t.end}},t.prototype.Pab=function(t){var e=t.metadataType===s.MetadataType.DATERANGE?u.TimedMetadataType.DateRange:u.TimedMetadataType.Manifest;this.Gab.addToMetadataParsedService(t.start,this.Oab(t),l.DEFAULT_PERIOD_ID),t.metadataType!==s.MetadataType.CUSTOM&&this.Gab.addToTimeline(e,t.start,t)},t.prototype.onPlaylistUpdated=function(t){var e,i,n=this,o=t.playlist,l=t.variant,h=t.segments;this.segmentTimelineController.switchTimeline(l.id);var c=this.segmentTimelineController.updateTimeline(l.id,h),p=this.context.serviceManager.get(r.ServiceName.MetadataParsedService);p&&(p.expirationTimeInSeconds=c);var v=null===(e=h[0])||void 0===e?void 0:e.dateTime;v&&this.Gab.removeUntil(d.Util.timeInSeconds(v)),(0,a.extractDateRangeMetadata)(null!==(i=o.dateRange)&&void 0!==i?i:[],o.endList?o.programDateTime:void 0,function(t){var e={metadataType:s.MetadataType.DATERANGE,metadata:t.data,start:t.startTime,end:t.endTime};n.Gab.addToTimeline(u.TimedMetadataType.DateRange,t.startTime,e)});var f=this.segmentTimelineController.getCurrentTimeline();this.extractMetadataFromTimeline(f,!o.endList)},t.prototype.extractMetadataFromTimeline=function(t,e){var i=this;t.forEach(function(t){Object.values(n).forEach(function(r){t.hasOwnProperty(r)&&function(t,e,i){var r=i&&e.dateTime?(0,h.toSeconds)(e.dateTime.getTime()):e.playbackTime;switch(t){case n.CueTag:return[{metadataType:s.MetadataType.CUETAG,metadata:e[n.CueTag],start:r}];case n.Scte35:return[{metadataType:s.MetadataType.SCTE,metadata:e[n.Scte35],start:r}];case n.CustomTags:return[{metadataType:s.MetadataType.CUSTOM,metadata:e[n.CustomTags],start:r,end:r+e.duration}];default:return[]}}(r,t,e).forEach(function(t){return i.Pab(t)})})})},t.prototype.parseTimelineEntries=function(t){var e=this.Nab(t);return c.ModuleManager.get(p.ModuleName.HLS).NativeHlsManifestParserUtils.isValidVariantPlaylist(e)?e.segments.map(function(t){var e;return{uri:t.uri,duration:t.duration,discontinuity:null!==(e=t.discontinuity)&&void 0!==e&&e,dateTime:null,metadata:[],consumed:!1,playbackTime:-1,keys:[]}}):[]},t.prototype.getPlaybackTimeOfFirstSegmentInTimeline=function(t){for(var e=0;e<t.length;e++)for(var i=t[e],n=0,r=0;r<i.timeline.length;r++){for(var s=i.timeline[r],a=this.segmentTimelineController.getCurrentTimeline(),o=0;o<a.length;o++){var u=a[o];if(u.uri===s.uri)return u.playbackTime-n}n+=s.duration}return-1},t.prototype.Qab=function(){this.Fab&&(this.Fab.off(s.PlayerEvent.TimeChanged,this.Iab),this.Fab.off(s.PlayerEvent.TimeShifted,this.Lab),this.Fab.off(s.PlayerEvent.Seeked,this.Mab))},t.prototype.dispose=function(){this.Qab(),this.segmentTimelineController&&(this.segmentTimelineController.dispose(),this.segmentTimelineController=null),this.Gab&&(this.Gab.dispose(),this.Gab=null),this.settings=null,this.Fab=null},t}();e.AbstractHlsManifestController=v},32418:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.AppleAirplayService=e.isAirplaySupported=void 0;var n,r=i(3714),s=i(19274);!function(t){t.Available="available",t.NotAvailable="not-available"}(n||(n={})),e.isAirplaySupported=function(){return Boolean(window.WebKitPlaybackTargetAvailabilityEvent)};var a=function(){function t(t,e){var i=this;this.videoElement=t,this.eventHandler=e,this.BV=!1,this.CV=function(t){switch(t.availability){case n.Available:i.BV=!0,i.eventHandler.dispatchEvent(r.PlayerEvent.AirplayAvailable);break;case n.NotAvailable:i.BV=!1}},this.DV=function(){i.eventHandler.dispatchEvent(r.PlayerEvent.AirplayChanged,{airplayEnabled:i.isAirplayActive(),time:i.videoElement.currentTime})},this.initAirplay()}return t.prototype.initAirplay=function(){this.videoElement.setAttribute("x-webkit-airplay","allow"),this.videoElement.addEventListener(s.MediaElementEvent.webkitplaybacktargetavailabilitychanged,this.CV),this.videoElement.addEventListener(s.MediaElementEvent.webkitcurrentplaybacktargetiswirelesschanged,this.DV)},t.prototype.isAirplayAvailable=function(){return this.BV},t.prototype.isAirplayActive=function(){return this.videoElement.isAirplayActive()},t.prototype.showAirplayTargetPicker=function(){this.isAirplayAvailable()&&(this.videoElement.webkitShowPlaybackTargetPicker(),this.eventHandler.dispatchEvent(r.PlayerEvent.ShowAirplayTargetPicker))},t.prototype.dispose=function(){this.videoElement.removeEventListener(s.MediaElementEvent.webkitplaybacktargetavailabilitychanged,this.CV),this.videoElement.removeEventListener(s.MediaElementEvent.webkitcurrentplaybacktargetiswirelesschanged,this.DV)},t}();e.AppleAirplayService=a},99373:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.AssetAvailabilityChecker=void 0;var n=i(4129),r=i(29669),s=i(89927),a=i(88844),o=i(19274),u=function(){function t(t,e,i){var a=this;this.context=t,this.source=e,this.mediaElement=i,this.GV=function(){a.mediaElement.removeEventListener(o.MediaElementEvent.loadstart,a.GV);var t=(0,s.toMilliSeconds)(a.context.settings.XHR_TIMEOUT)/2;a.EV=window.setTimeout(function(){var t=!1;a.FV=new n.DefaultContentLoader(a.context,{onProgress:function(e){var i;e.loadedBytes>0&&(t=!0,null===(i=a.FV)||void 0===i||i.cancel())},requestType:r.HttpRequestType.INTERNAL}),a.FV.load(a.source.src).catch(function(e){if(!t){var i=new Event(o.MediaElementEvent.error,{bubbles:!1,cancelable:!1});a.source.dispatchEvent(i)}})},t)},i.addEventListener(o.MediaElementEvent.loadstart,this.GV)}return t.prototype.dispose=function(){(0,a.clearTimeoutIfDefined)(this.EV),this.mediaElement.removeEventListener(o.MediaElementEvent.loadstart,this.GV),this.FV&&(this.FV.cancel(),this.FV.dispose())},t}();e.AssetAvailabilityChecker=u},95945:function(t,e,i){var n=this&&this.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.FallbackHlsManifestController=void 0;var r,s=i(25926),a=i(4224),o=i(3714),u=i(29669),l=i(88052),h=i(62756),d=i(48297),c=i(56191),p=i(59043),v=i(77374),f=function(t){function e(e,i){var n=t.call(this,e)||this;return n.Tab=function(t){n.onPlaylistUpdated(t)},n.kbb=function(t){return null},r=l.ModuleManager.get(h.ModuleName.HLS).PlaylistUtils,n.Rab=i,n.Sab=new p.HlsDownloadService(n.context),n.segmentTimelineController=new c.FallbackSegmentTimelineController(e.videoElement),n.Rab.setOnPlaylistUpdated(n.Tab),n}return n(e,t),e.prototype.init=function(){return Promise.resolve()},e.prototype.getDownloadedVideoData=function(){return{id:"not available",bitrate:0,height:0,width:0,isAuto:!0}},e.prototype.getPlayingVideoData=function(){return null},e.prototype.resolveMasterManifest=function(t){var e=this;return this.Rab.resolveMasterManifest(t).then(function(t){var i=t.masterManifest,n=t.firstVariantPlaylist,r=t.resolvedMasterUrl;return e.overrideManifestUrl(i,r,n)})},e.prototype.getParsedManifest=function(){return this.Rab.getParsedManifest()},e.prototype.getManifest=function(){return this.Rab.getManifest()},e.prototype.overrideManifestUrl=function(t,e,i){return"createObjectURL"in window.URL?this.Uab(t,i):(this.context.eventHandler.dispatchEvent(o.PlayerEvent.Warning,new s.PlayerWarning(a.WarningCode.SETUP_CREATE_OBJECT_URL_MISSING)),Promise.resolve(e))},e.prototype.Uab=function(t,e){var i=this;return r.isLive(e)?Promise.resolve(this.jbb(t)):Promise.all(this.Vab(t)).then(function(e){return e.filter(function(t){return Boolean(t)}).forEach(function(e){t=t.replace(e.mediaUrl,e.blobUrl)}),i.jbb(t)})},e.prototype.Vab=function(t){var e=this;return t.split("\n").map(function(t){return v.parseUrlFromLine(t)}).filter(function(t){return null!==t}).map(function(t){return e.gbb(t)})},e.prototype.gbb=function(t){var e=this;return this.Sab.downloadPlaylist(t,u.HttpRequestType.MANIFEST_HLS_VARIANT).then(function(i){var n=v.replaceManifestUrls(t,i.body,e.settings.QUERY_PARAMETERS);return{blobUrl:e.ibb(n),mediaUrl:t}}).catch(this.kbb)},e.prototype.hbb=function(t){var e=this;return this.Sab.downloadPlaylist(t.uri,u.HttpRequestType.MANIFEST_HLS_VARIANT).then(function(i){return{width:t.width,height:t.height,timeline:e.parseTimelineEntries(i.body)}}).catch(this.kbb)},e.prototype.ibb=function(t){var e=new Blob([t],{type:"application/x-mpegURL"});return window.URL.createObjectURL(e)},e.prototype.jbb=function(t){return"data:application/x-mpegURL,"+encodeURIComponent(t)},e.prototype.lbb=function(){var t=this.Rab.getParsedManifest();return t?t.playlists.map(function(t){return{uri:t.uri,width:t.attributes&&t.attributes.RESOLUTION?t.attributes.RESOLUTION.width:-1,height:t.attributes&&t.attributes.RESOLUTION?t.attributes.RESOLUTION.height:-1}}):[]},e.prototype.mbb=function(){var t=this,e=this.lbb();e.reverse();var i=e.map(function(e){return t.hbb(e)});return Promise.all(i).then(function(e){var i=t.getPlaybackTimeOfFirstSegmentInTimeline(e);return i>=0&&e.forEach(function(t){t.timeline.reduce(function(t,e){return e.playbackTime=t,t+e.duration},i)}),e})},e.prototype.getCurrentSegments=function(t,e,i,n){return void 0===n&&(n=1),this.mbb().then(function(r){var s=r.find(function(t){return t.width===e&&t.height===i});return function(t,e,i){for(var n,r=[],s=0;s<t.length;s++){var a=t[s];n=0;for(var o=0;o<a.timeline.length;o++){var u=a.timeline[o];if(u.playbackTime+u.duration>=i&&(r.push(u.uri),n++),n>e)break}}return r}(s?[s]:r,n,t)})},e.prototype.dispose=function(){var e;null===(e=this.Rab)||void 0===e||e.setOnPlaylistUpdated(void 0),t.prototype.dispose.call(this)},e}(d.AbstractHlsManifestController);e.FallbackHlsManifestController=f},56191:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.FallbackSegmentTimelineController=void 0;var n=i(25541),r=function(){function t(t){this.Phb=t,this.Qhb=!0,this.Nhb={}}return t.prototype.Rhb=function(){return this.Phb.duration===1/0},t.prototype.switchTimeline=function(t){this.Nhb[t]||(this.Ohb=t,this.Nhb[t]=[])},t.prototype.updateTimeline=function(t,e){var i=this,r=this.Nhb[t],s=n.updateTimeline(r,e),a=s.findIndex(function(t){return t.hasOwnProperty("playbackTime")});-1!==a&&n.populateCurrentTimelineWithPlaybackTime(s,a,s[a].playbackTime),this.Nhb[t]=s;var o=s.reduce(function(t,e){return i.Rhb()&&!i.Qhb||(e.playbackTime=t),t+e.duration},0);return this.Qhb&&(this.Qhb=!1),o},t.prototype.getPlayingSegment=function(t){for(var e=this.getCurrentTimeline(),i=0;i<e.length;i++){var n=e[i];if(t>=n.playbackTime&&t<=n.playbackTime+n.duration)return e[i]}return null},t.prototype.addDownloadedSegments=function(t){},t.prototype.getCurrentTimeline=function(){return this.Nhb[this.Ohb]},t.prototype.getAllTimelines=function(){return this.Nhb},t.prototype.reset=function(){this.Nhb[this.Ohb].forEach(function(t){return t.consumed=!1})},t.prototype.dispose=function(){this.Nhb={},this.Phb=null},t}();e.FallbackSegmentTimelineController=r},30712:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.HlsDownloadErrorHandler=void 0;var n=i(40306),r=i(3336),s=i(4129),a=i(43446),o=i(29669),u=i(21513),l=i(88844),h=i(19274),d=function(){function t(t,e){var i=this;this.SV=function(){for(var t=i.IV.buffered,e="",n=0;n<t.length;n++)e+="".concat(t.start(n)," - ").concat(t.end(n),", ");e===i.PV?i.QV++:i.QV=0,i.QV>=10&&i.UV(),i.PV=e},this.TV=function(){var t=a.TimingUtil.getHiResTimestamp(),e=!i.IV.paused&&!i.IV.seeking&&!i.IV.ended;t-i.RV>5&&e&&i.WV()},this.UV=function(){i.NV=a.TimingUtil.getHiResTimestamp(),i.YV()},this.VV=function(){i.NV=-1/0,(0,l.clearTimeoutIfDefined)(i.MV)},this.WV=function(){i.LV=a.TimingUtil.getHiResTimestamp(),i.YV()},this.XV=function(){i.LV=-1/0,i.RV=a.TimingUtil.getHiResTimestamp(),(0,l.clearTimeoutIfDefined)(i.MV)},this.ZV=function(){if(0!==i.IV.buffered.length){var t=i.IV.currentTime,e=i.IV.buffered.end(i.IV.buffered.length-1),a=t<=e&&t+.5>e,u=i.IV.paused,l=i.IV.networkState===HTMLMediaElement.NETWORK_LOADING,h=i.IV.videoWidth,d=i.IV.videoHeight;!u&&a&&l&&i.JV.getCurrentSegments(e,h,d,2).then(function(t){var e=new s.DefaultContentLoader(i.HV),a=function(i,n){return void 0===i&&(i=!0),t.length>0&&i?e.load(t.pop(),o.HttpRequestMethod.HEAD).then(function(t){return a(t.status>=200&&t.status<300,t)}):i?Promise.resolve():Promise.reject(n)};a().catch(function(t){var e=t.url,s=t.status,a=t.statusText;i.HV.eventHandler.fireError(new r.PlayerError(n.ErrorCode.NETWORK_ERROR,{url:e,statusCode:s,statusText:a},"Failed to load segment ".concat(e,", statusCode: ").concat(s,", statusText: ").concat(a),i.HV.sourceContext.sourceIdentifier))})})}},this.HV=t,this.IV=t.videoElement,this.JV=e,this.KV=!1,this.NV=-1/0,this.LV=-1/0,this.MV=-1,this.PV="",this.QV=0,this.RV=-1/0,this.IV.addEventListener(h.MediaElementEvent.waiting,this.WV),this.IV.addEventListener(h.MediaElementEvent.stalled,this.UV),this.IV.addEventListener(h.MediaElementEvent.progress,this.VV),this.IV.addEventListener(h.MediaElementEvent.timeupdate,this.XV),(0,u.getCapabilities)().isIOS&&(this.OV=window.setInterval(function(){i.SV(),i.TV()},500))}return t.prototype.YV=function(){var t=Math.abs(this.LV-this.NV);(0,l.clearTimeoutIfDefined)(this.MV),isFinite(t)&&(this.MV=window.setTimeout(this.ZV,1e3*(5-Math.min(5,t))))},t.prototype.dispose=function(){(0,l.clearTimeoutIfDefined)(this.OV),(0,l.clearTimeoutIfDefined)(this.MV),this.IV.removeEventListener(h.MediaElementEvent.waiting,this.WV),this.IV.removeEventListener(h.MediaElementEvent.stalled,this.UV),this.IV.removeEventListener(h.MediaElementEvent.progress,this.VV),this.IV.removeEventListener(h.MediaElementEvent.timeupdate,this.XV),this.IV=null,this.JV=null},t}();e.HlsDownloadErrorHandler=d},59043:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.HlsDownloadService=void 0;var n=i(25926),r=i(4224),s=i(3714),a=i(4129),o=i(29669),u=function(){function t(t){var e=this;this.Ghb=!1,this.Mhb=function(t){e.Ehb.eventHandler.dispatchEvent(s.PlayerEvent.Warning,new n.PlayerWarning(r.WarningCode.NETWORK_COULD_NOT_LOAD_MANIFEST))},this.Ehb=t,this.Hhb()}return t.prototype.Hhb=function(){this.Ihb(),this.Jhb()},t.prototype.Ihb=function(){this.Fhb={}},t.prototype.Jhb=function(){var t=this.Ehb.sourceContext.source&&this.Ehb.sourceContext.source.options||{};this.Ghb="boolean"==typeof t.hlsManifestWithCredentials?t.hlsManifestWithCredentials:!0===t.manifestWithCredentials},t.prototype.downloadPlaylist=function(t,e,i){return void 0===i&&(i=!0),i&&this.Fhb.hasOwnProperty(t)?Promise.resolve(this.Fhb[t]):this.Khb(e,t)},t.prototype.Khb=function(t,e){var i=this,n=this.Lhb(t);return n.load(e,o.HttpRequestMethod.GET,o.HttpResponseType.TEXT,null,{},this.Ghb).then(function(t){return n.dispose(),i.Fhb[e]=t,t}).catch(function(t){return n.dispose(),Promise.reject(t)})},t.prototype.Lhb=function(t){return new a.DefaultContentLoader(this.Ehb,{onFailure:this.Mhb,maxRetries:this.Ehb.settings.MAX_MPD_RETRIES,requestType:t})},t.prototype.dispose=function(){},t}();e.HlsDownloadService=u},81152:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.HlsLiveNativeTimeTracker=void 0;var n=i(9768),r=i(89927),s=i(88844),a=i(19274),o=function(){function t(t,e){this.nativePlayer=t,this.context=e,this.aV=0,this.bV=null,this.mW=null,this.nW=!1}return t.prototype.onUnload=function(t){if(t!==n.ADVERTISING_ISSUER_NAME)return t===n.ADVERTISING_RESTORE_ISSUER_NAME?void(this.nW=null!=this.bV):void(null!=this.bV&&this.oW());if(null!=this.bV){if(!this.nW)return;this.oW()}this.nativePlayer.isLive()?(this.bV=Date.now(),this.aV=this.nativePlayer.getSeekableRange().start,this.mW=this.nativePlayer.getStartDate()):this.oW()},t.prototype.oW=function(){this.bV=null,this.aV=0,this.mW=null,this.nW=!1},t.prototype.adjustTargetTime=function(t,e){var i=this;return e!==n.ADVERTISING_RESTORE_ISSUER_NAME||null==this.bV?Promise.resolve(t):(null!=this.mW?this.pW():Promise.resolve(null)).then(function(e){if(null!=e)return i.oW(),t;var n=(0,r.toSeconds)(Date.now()-i.bV);i.aV+=n;var s=t-i.aV;return i.oW(),s})},t.prototype.pW=function(){var t=this,e=this.qW();if(e)return Promise.resolve(e);var i=this.context.videoElement;return new Promise(function(e){var n=void 0,r=void 0,o=function(o){var l=t.qW();e(l),null==i||i.removeEventListener(a.MediaElementEvent.error,u),(0,s.clearIntervalIfDefined)(n),(0,s.clearTimeoutIfDefined)(r)},u=function(){return o()};null==i||i.addEventListener(a.MediaElementEvent.error,u),n=window.setInterval(function(){null!=t.qW()&&o()},250),r=window.setTimeout(function(){return o()},5e3)})},t.prototype.qW=function(){var t=this.nativePlayer.getStartDate();return t&&!isNaN(t.getTime())?t:null},t}();e.HlsLiveNativeTimeTracker=o},81929:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.createHlsManifestController=function(t){if(l(t)){var e=new(r.ModuleManager.get(s.ModuleName.ServiceWorkerClient).createServiceWorkerHlsManifestController(a.AbstractHlsManifestController))(t);return e.init().then(function(){return e}).catch(function(){return h(t)})}return h(t)},e.shouldUseServiceWorker=l;var n=i(80813),r=i(88052),s=i(62756),a=i(48297),o=i(95945),u=i(690);function l(t){var e=t.config.location&&t.config.location.serviceworker;return"serviceWorker"in navigator&&e&&r.ModuleManager.has(s.ModuleName.ServiceWorkerClient)}function h(t){var e=function(t){var e=t.sourceContext.sourceIdentifier,i=t.serviceManager.get(n.ServiceName.NativeManifestService,e);if(i)return i.isSuspended()&&i.restore(),i;var r=new u.NativeManifestService(t);return t.serviceManager.set(n.ServiceName.NativeManifestService,r,e),r}(t),i=new o.FallbackHlsManifestController(t,e);return i.init().then(function(){return i})}},77374:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.replaceManifestUrls=function(t,e,i){var n=e.split(/\r?\n/);return n.forEach(function(e,o){var u=s(e);if(u&&e.match(r)){var l=a(t,u,i);n[o]=e.replace(r,function(){return'URI="'.concat(l,'"')})}else u&&(n[o]=a(t,u,i))}),n.join("\n")},e.parseUrlFromLine=s,e.replaceUrlAndAddUriParams=a;var n=i(58313),r=/URI="([^"]+)"/;function s(t){if("#"!==t[0]&&t.trim().length>0)return t;if(t.indexOf("URI")>-1){var e=t.match(r);if(e&&e[1].indexOf("skd://")<0&&e[1].indexOf("skds://")<0)return e[1]}return null}function a(t,e,i){var r=n.URLHelper.concatBaseUrlWithPartial(t,e);return n.URLHelper.appendQueryParametersToUrl(r,i)}},27530:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.NativeModuleDefinition=void 0;var n=i(62756),r=i(925),s=i(49706);e.NativeModuleDefinition={name:n.ModuleName.EngineNative,module:{NativePlayer:r.NativePlayer,technologyChecker:new s.TechnologyChecker}},e.default=e.NativeModuleDefinition},690:function(t,e,i){var n=this&&this.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.NativeManifestService=void 0;var r,s=i(80813),a=i(3714),o=i(32703),u=i(29669),l=i(88847),h=i(79721),d=i(89927),c=i(88844),p=i(70850),v=i(88052),f=i(62756),y=i(59043),m=i(77374),b=function(t){function e(e){var i=t.call(this)||this;return i.rbb=null,i.sbb=null,i.tbb=null,i.ubb=null,i.wbb=[],r=v.ModuleManager.get(f.ModuleName.HLS).PlaylistUtils,i.nbb=e,i.obb=e.settings,i.pbb=e.config,i.qbb=new y.HlsDownloadService(e),i}return n(e,t),e.prototype.resolveMasterManifest=function(t){var e=this;return this.rbb&&this.tbb&&this.zbb?Promise.resolve({masterManifest:this.tbb,firstVariantPlaylist:this.zbb.playlist,resolvedMasterUrl:this.ubb}):this.qbb.downloadPlaylist(t,u.HttpRequestType.MANIFEST_HLS_MASTER).then(function(t){var i,n,r;e.ubb=t.url;var s=e.Abb(t,t.url);if(!e.rbb)throw new Error("Manifest parsing failed");e.tbb=s;var a=v.ModuleManager.get(f.ModuleName.HLS).NativeHlsManifestParserUtils.isVideoVariant,o=null!==(n=null===(i=e.rbb.playlists.find(function(t){return a(t,e.rbb)}))||void 0===i?void 0:i.uri)&&void 0!==n?n:null===(r=e.rbb.playlists[0])||void 0===r?void 0:r.uri;return e.vbb=o,e.Gbb(o,!0).then(function(e){return{masterManifest:s,firstVariantPlaylist:e,resolvedMasterUrl:t.url}})})},e.prototype.getParsedManifest=function(){return this.rbb},e.prototype.getManifest=function(){return this.sbb},e.prototype.getVariantUrl=function(){return this.vbb},e.prototype.getLastPlaylistData=function(){return this.zbb},e.prototype.setOnPlaylistUpdated=function(t){this.ybb=t,this.Cbb()},e.prototype.restore=function(){t.prototype.restore.call(this),this.Cbb()},e.prototype.dispose=function(){(0,c.clearTimeoutIfDefined)(this.xbb),this.xbb=void 0,this.qbb.dispose(),this.rbb=null,this.sbb=null,this.tbb=null,this.ubb=null,this.vbb=void 0,this.wbb=[],this.ybb=void 0,this.zbb=void 0,this.pbb=null,t.prototype.dispose.call(this)},e.prototype.Abb=function(t,e){var i,n,r=v.ModuleManager.get(f.ModuleName.HLS).NativeHlsManifestParserUtils;this.sbb=null!==(i=t.body)&&void 0!==i?i:null;var s=(0,m.replaceManifestUrls)(e,null!==(n=t.body)&&void 0!==n?n:"",this.obb.QUERY_PARAMETERS);if(this.rbb=r.parsePlaylist(s),r.isValidMasterPlaylist(this.rbb))return s;if(r.isValidVariantPlaylist(this.rbb)){var a="#EXTM3U\n#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=100000\n$VARIANT$\n".replace("$VARIANT$",e);s=(0,m.replaceManifestUrls)(e,a,this.obb.QUERY_PARAMETERS),this.sbb=a,this.rbb=r.parsePlaylist(s)}else this.rbb=null;return s},e.prototype.Bbb=function(t){var e,i=this,n=v.ModuleManager.get(f.ModuleName.HLS).NativeHlsManifestParserUtils.parseAndPrepareVariantPlaylist(this.rbb,t,this.wbb,this.pbb),r=n.playlist,s=n.variant,a=n.segments,u=n.discontinuitySequences;this.wbb=u;var l=null===(e=a[0])||void 0===e?void 0:e.dateTime;return l&&(r.programDateTime=p.Util.timeInSeconds(l)),(0,o.extractDateRangeMetadata)(r.dateRange,r.endList?r.programDateTime:void 0,function(t){return i.Dbb(t)}),this.zbb={playlist:r,variant:s,segments:a},this.Cbb(),r},e.prototype.Cbb=function(){this.zbb&&this.ybb&&!this.isSuspended()&&this.ybb(this.zbb)},e.prototype.Dbb=function(t){var e,i={metadataType:a.MetadataType.DATERANGE,metadata:t.data,data:t.data,start:t.startTime,end:t.endTime};null===(e=this.nbb.serviceManager.get(s.ServiceName.MetadataParsedService))||void 0===e||e.addMetadata(h.DEFAULT_PERIOD_ID,i)},e.prototype.Ebb=function(t,e){var i=this;(0,c.clearTimeoutIfDefined)(this.xbb),this.xbb=setTimeout(function(){return i.Fbb(e)},(0,d.toMilliSeconds)(t.targetDuration))},e.prototype.Fbb=function(t){this.Gbb(t,!1).catch(function(t){})},e.prototype.Gbb=function(t,e){var i=this;return this.qbb.downloadPlaylist(t,u.HttpRequestType.MANIFEST_HLS_VARIANT,e).then(function(e){var n=i.Bbb(e);return r.isLive(n)&&i.Ebb(n,t),n})},e}(l.Suspendable);e.NativeManifestService=b},925:function(t,e,i){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},n.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.NativePlayer=void 0;var r,s=i(4524),a=i(40306),o=i(3336),u=i(25926),l=i(4224),h=i(48143),d=i(80813),c=i(56481),p=i(9768),v=i(3714),f=i(90408),y=i(4129),m=i(44468),b=i(23690),g=i(87827),T=i(21513),E=i(93204),S=i(74853),M=i(34841),P=i(85434),A=i(15487),V=i(89927),I=i(88844),R=i(58313),_=i(70850),N=i(41138),L=i(19274),C=i(88052),w=i(62756),O=i(29669),D=i(32418),U=i(99373),k=i(30712),H=i(81152),x=i(81929),F=i(56678);!function(t){t.None="none",t.Metadata="metadata",t.Auto="auto"}(r||(r={}));var W="not available",G=.75,j=function(){function t(t){var e=this;this.Zs=0,this.fs=!1,this.gs=null,this.hs=!1,this.is=!1,this.js=!0,this.ks=-1,this.ls=!1,this.ms=!1,this.ns=!1,this.os=0,this.rs=-1,this.us=-1,this.vs=null,this.ws=p.API_ISSUER_NAME,this.xs=p.API_ISSUER_NAME,this.It=p.API_ISSUER_NAME,this.Kt=0,this.Mt=-1,this.Nt=0,this.Ot=-1,this.Pt=!1,this.Yt=0,this.Zt=[],this.bt=new Map,this.ct=1,this.et=!0,this.ft=!1,this.gt=!1,this.it=[],this.jt=!1,this.kt=!1,this.mt={},this.pt=!1,this.tt=!1,this.ut=!1,this.vt=function(t){if(e.Qu()){var i=t.track;e.Ft(v.PlayerEvent.AudioAdded,{track:e.Ru(i)}),i.enabled&&e.fs&&e.ou(null,i)}},this.wt=function(t){var i=t.track;e.Qu()&&e.Ft(v.PlayerEvent.AudioRemoved,{track:e.Ru(i)}),e.bt.delete(i)},this.xt=function(){var t,i,n=e.Vs.getViewModeFromPresentationMode();n===m.ViewMode.PictureInPicture||n===m.ViewMode.Fullscreen&&(0,T.getCapabilities)().isIOS?null===(t=e.vs)||void 0===t||t.enableNative():null===(i=e.vs)||void 0===i||i.disableNative(),e.Ts.store.dispatch((0,b.setPlayerViewMode)(n))},this.yt=function(){(0,f.maybeFireDurationChangedEvent)(e.Xt,e.getDuration(),e.Xs),e.Xt=e.getDuration(),e.gt&&e.Dt()},this.zt=function(){e.Lt.stallExit(),e.Pt&&e.gs&&e.Uu(),e.hs=!1,e.Lt.transitionToPlayState(!0,e.ws)},this.At=function(){e.Lt.isStalled?(e.Lt.stallExit(),e.Lt.transitionToPlayingState(e.ws)):e.Lt.isStopped()?e.Xu():e.Lt.isPlaying()||(e.Lt.transitionToPlayState(!0,e.ws),e.Lt.transitionToPlayingState(e.ws))},this.Et=function(){var t;(0,I.clearTimeoutIfDefined)(e.Vt),null===(t=e.Wt)||void 0===t||t.dispose(),e.ft||(0,I.clearTimeoutIfDefined)(e.Ut),e.ft=!0,e.pt=!1,e.et=!0,e.gt=!0,e.Dt()},this.Ft=function(t,i,n,r){void 0===i&&(i={}),void 0===n&&(n=!1),void 0===r&&(r=!1),e.Xs&&(e.et||n)&&e.Xs.dispatchEvent(t,i,r)},this.Gt=function(t){var i=e.Tu(),n=i.currentTime;(-1!==e.Mt||n!==e.Mt)&&!e.ms&&(e.Su(n)?(Promise.resolve(e.Vs.play()).catch(function(t){}),e.ns=!0,i.currentTime=e.Nt):e.Ht(i,n),e.ls=!1,e.at&&(e.at.width=e.Vs.videoWidth,e.at.height=e.Vs.videoHeight))},this.Xu=function(){e.isPlaying()||(e.hs=!1,e.qu(),e.Lt.transitionToPlayingState(e.ws))},this.Yu=function(){e.hs=!0},this.getCurrentTime=function(t){void 0===t&&(t=m.TimeMode.AbsoluteTime);var i=e.getStartDate();return t===m.TimeMode.AbsoluteTime&&i?_.Util.timeInSeconds(i)+e.Tu().currentTime:e.Tu().currentTime},this.getAudioQuality=this.getPlaybackAudioData,this.getVideoQuality=this.getPlaybackVideoData,this.lv=function(){var t,i=e.Tu(),n=Math.abs(i.currentTime-e.Nt),r=e.Ys.GLOBAL_DISABLE_SEEKING,s=null!==(t=e.ps)&&void 0!==t?t:i.duration;r&&(n>G||i.currentTime<s-G)?(Promise.resolve(e.Vs.play()).catch(function(t){}),e.ns=!0,e.Vs.currentTime=e.Nt):(e.Nt=0,e.Lt.isPlaying()&&e.Lt.transitionToPausedState(!0,e.xs),e.Lt.transitionToStoppedState())},this.qv=function(){e.mv(),e.os=0,!e.Ys.GLOBAL_DISABLE_SEEKING||e.jt||e.lt?(e.Mt=e.Tu().currentTime,e.lt=!1,e.Lt.isSeeking()&&(e.vs&&e.vs.seek(),e.pv())):e.ms=!1,e.rv()},this.sv=function(){if(e.Ot=-1,e.Ys.GLOBAL_DISABLE_SEEKING&&!e.lt)e.ms=!e.jt,e.os++,e.os>1&&(e.ns=!1);else if(!e.Lt.isTimeShifting()){var t=e.Tu().currentTime;e.Lt.isSeeking()?(0,T.getCapabilities)().isIOS&&e.ut&&(e.Lt.transitionToSeekingIOSState(t,p.INTERNAL_ISSUER_NAME,!0,e.Nt),e.Mt=t):e.Lt.transitionToSeekingIOSState(t,p.INTERNAL_ISSUER_NAME)}},this.wv=function(){void 0===e.qs&&(e.qs=e.Tu().currentTime)},this.xv=function(){e.Zs++,e.Zs<e.Ys.IOS_MIN_TIMEUPDATES_AFTER_AD||(e.Xs.off(v.PlayerEvent.TimeChanged,e.xv),e.jt=!0,e.du({time:e.bs,issuer:p.API_ISSUER_NAME,force:!0}))},this.Ts=t,this.ss=!1,this.Us=t.logger,this.Vs=t.videoElement,this.Ws=t.config,this.Xs=t.eventHandler,this.Ys=t.settings,this.Tt=null,this.es=this.Vs.volume,this.qt=this.Vs.getAttribute("crossOrigin"),this.ts=-1/0,(0,D.isAirplaySupported)()&&(this.Qt=new D.AppleAirplayService(this.Vs,this.Xs)),this.rt=new H.HlsLiveNativeTimeTracker(this,t),this.ot=[{event:L.MediaElementEvent.pause,handler:function(){e.mv(),e.hs||e.Lt.transitionToPausedState(!0,e.xs,!0)}},{event:L.MediaElementEvent.ended,handler:function(){e.lv()}},{event:L.MediaElementEvent.play,handler:this.zt},{event:L.MediaElementEvent.canplay,handler:function(){e.Lt.stallExit()}},{event:L.MediaElementEvent.seeking,handler:function(){e.ls=!0,e.sv(),e.getCurrentTime()>=e.getDuration()&&(e.qv(),e.lv())}},{event:L.MediaElementEvent.seeked,handler:function(){e.qv(),e.Pt&&e.gs&&e.Uu()}},{event:L.MediaElementEvent.durationchange,handler:this.yt},{event:L.MediaElementEvent.loadeddata,handler:this.Et},{event:L.MediaElementEvent.loadedmetadata,handler:function(){e.Vt=window.setTimeout(e.Et,200)}},{event:L.MediaElementEvent.playing,handler:this.At},{event:L.MediaElementEvent.waiting,handler:function(){e.mv(),e.Lt.stallEnter()}},{event:L.MediaElementEvent.timeupdate,handler:this.Gt},{event:L.MediaElementEvent.error,handler:function(t){var i;e.ft||1!==e.Zt.length||e.type!==m.StreamType.Progressive?(e.ht.reject(),e.is?e.is=!1:((0,I.clearTimeoutIfDefined)(e.Ut),null===(i=e.Xs)||void 0===i||i.fireError((0,f.createPlayerErrorFromMediaError)(t,e.Ts.sourceContext.sourceIdentifier,!0)))):e.Eu(a.ErrorCode.SOURCE_PROGRESSIVE_STREAM_ERROR,e.Vs.getWrappedElement().src,t)}},{event:L.MediaElementEvent.webkitpresentationmodechanged,handler:this.xt},{elementSelector:function(t){return t.audioTracks},event:"addtrack",handler:this.vt},{elementSelector:function(t){return t.audioTracks},event:"removetrack",handler:this.wt}]}return t.prototype.Bt=function(){var t,e;return!((0,A.isWebOS)()||(0,A.isTizenOs7OrNewer)()||(0,A.isEdgeAndroid)()||(null===(e=null===(t=this.Ws)||void 0===t?void 0:t.tweaks)||void 0===e?void 0:e.prevent_video_element_preloading)||this.getDuration())},t.prototype.Ct=function(){var t,e;if(!this.gv()||(null===(e=null===(t=this.Ws)||void 0===t?void 0:t.tweaks)||void 0===e?void 0:e.prevent_video_element_preloading)||(0,A.isWebOS)()||this.tt)return!1;var i=this.Vs.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA;return!function(t){return t.length>0&&t.end(t.length-1)!==1/0}(this.Tu().seekable)&&!i},t.prototype.Dt=function(){this.Bt()||this.Ct()||this.ht.resolve()},t.prototype.Ht=function(t,e){if(this.ns=!1,this.ps=t.duration,e>this.ps+2)t.currentTime=this.ps-.1;else{this.Lt.isSeeking()||(this.Nt=e);var i=e>this.Ot;this.Ot=Math.max(e,this.Ot),i&&this.Lt.stallExit(),this.Lt.isSeeking()||this.Lt.isTimeShifting()||!this.isPlaying()||(null!=this.getStartDate()?this.Ft(v.PlayerEvent.TimeChanged,{time:this.getCurrentTime(),relativeTime:e}):this.Ft(v.PlayerEvent.TimeChanged,{time:this.getCurrentTime()}))}},t.prototype.Su=function(t){if(!this.Ys.GLOBAL_DISABLE_SEEKING||!this.ls)return!1;var e=-1!==this.Mt&&t>this.Mt+G,i=Math.abs(t-this.Nt);return(!this.ns||e)&&i>G},t.prototype.Tu=function(){return this.Pt&&this.gs?this.gs:this.Vs},t.prototype.Uu=function(){var t=Date.now();(0,V.toSeconds)(t-this.Yt)>=1/30&&(this.Vs.currentTime=this.gs.currentTime,this.Yt=t),this.isPlaying()&&window.requestAnimationFrame(this.Uu)},t.prototype.Vu=function(){if(this.isLive()&&!this.cu()){var t=this.zv();t.end>=0&&this.au(t.end,p.STARTUP_ISSUER_NAME)}},t.prototype.Wu=function(){void 0!==this.st&&(this.mu(),this.seek(this.st,"api-play"))},t.prototype.play=function(t){return this.js?(this.ws=t,this.Wu(),this.Vu(),this.Tu().play()):Promise.reject("Play control not permitted")},t.prototype.getStartDate=function(){if(!this.isLive())return null;var t=this.Tu().getWrappedElement(),e="function"==typeof t.getStartDate?t.getStartDate():null;return e&&!isNaN(e.getTime())?e:null},t.prototype.preload=function(){this.Tu().preload=this.su()},t.prototype.pause=function(t){this.xs=t;var e=this.Tu();this.js&&this.fs&&(this.Lt.transitionToPausedState(!1,this.xs),e.pause())},t.prototype.mute=function(t){this.Tu().muted||(this.Tu().muted=!0,this.Ft(v.PlayerEvent.Muted,{issuer:t||p.API_ISSUER_NAME}))},t.prototype.unmute=function(t){this.Tu().muted&&(this.Tu().muted=!1,this.Ft(v.PlayerEvent.Unmuted,{issuer:t||p.API_ISSUER_NAME}))},t.prototype.Zu=function(t){var e=this.getStartDate();return e?t-(0,V.toSeconds)(e.getTime()):(this.isLive(),t)},t.prototype.seek=function(t,e){var i=this,n=this.bu(t),r=this.getCurrentTime();return!(!n||r===t)&&(this.rt.adjustTargetTime(t,e).then(function(t){i.It=e,i.ku(t,e);var n=i.Zu(t);return i.du({time:n,issuer:e})}),this.gt&&this.getDuration()>0)},t.prototype.au=function(t,e){this.rs=this.getCurrentTime(),this.It=e,this.lu(t,e),this.eu({time:t,issuer:e})},t.prototype.bu=function(t){this.lt=this.kt&&this.ju(t);var e=!this.Ys.GLOBAL_DISABLE_SEEKING&&this.iu();return(this.lt||e)&&this.js},t.prototype.cu=function(){var t=!(this.Ws.playback&&this.Ws.playback.hasOwnProperty("timeShift"))||Boolean(this.Ws.playback.timeShift);return this.isLive()&&t},t.prototype.du=function(t){return!this.fu(t)&&(this.Lt.transitionToSeekingState(t.time,t.issuer,!1),this.gu(t),!0)},t.prototype.eu=function(t){this.fu(t,!0)||(this.Lt.transitionToTimeShiftingState(this.getCurrentTime(),t.time,t.issuer,!1),t.time<0&&(t.time=this.zv().end+t.time,this.mv()),this.gu(t))},t.prototype.fu=function(t,e){return void 0===e&&(e=!1),this.Lt.isSeeking()&&"api-play"!==t.issuer?(this.nu(t,e,[L.MediaElementEvent.seeked]),!0):this.gt?0===this.getDuration()?(this.nu(t,e,[L.MediaElementEvent.durationchange]),!0):this.Vs.seekable.length<1&&(this.nu(t,e,[L.MediaElementEvent.timeupdate,L.MediaElementEvent.canplay]),!0):(this.nu(t,e,[L.MediaElementEvent.loadeddata]),!0)},t.prototype.gu=function(t){var e=t.issuer===p.ADVERTISING_ISSUER_NAME,i=this.zv(),n=this.hu(t.time,i,e);this.kt=!1,this.ns=this.ns||this.lt||t.force;var r=parseFloat(n.toFixed(2));this.us=r,this.Tu().currentTime=r},t.prototype.hu=function(t,e,i){void 0===i&&(i=!1);var n=Q(t,e);return i?t>=e.end&&(n=e.end-.1):this.isLive()||(n=Math.min(n,e.end-this.Ys.SEEK_TO_END_OFFSET)),n},t.prototype.iu=function(){var t=this.Ws&&this.Ws.hasOwnProperty("playback")?this.Ws.playback:{};return!t.hasOwnProperty("seeking")||t.seeking},t.prototype.ju=function(t){var e=this.Ts.sourceContext.source?this.Ts.sourceContext.source:{};return e.hasOwnProperty("options")&&e.options.hasOwnProperty("startTime")&&t===e.options.startTime},t.prototype.ku=function(t,e){e!==p.STARTUP_ISSUER_NAME&&this.Ft(v.PlayerEvent.Seek,{position:this.getCurrentTime(),seekTarget:t,issuer:e||p.API_ISSUER_NAME})},t.prototype.lu=function(t,e){e!==p.STARTUP_ISSUER_NAME&&this.Ft(v.PlayerEvent.TimeShift,{target:t<0?this.rs+t:t,position:this.rs,issuer:e||p.API_ISSUER_NAME})},t.prototype.mu=function(){var t=this;Object.keys(this.mt).forEach(function(e){t.Tu().removeEventListener(e,t.mt[e])}),this.mt={}},t.prototype.nu=function(t,e,i){var n=this,r=this.Tu();this.mu(),this.st=t.time;var s=function(){var i;if(n.mu(),e&&t.time>=0){var r=n.zv().end;i=r>0?r:t.time}else i=t.time;var s={time:i,issuer:t.issuer,force:t.force};n.st=void 0,e?n.eu(s):n.du(s)};i.forEach(function(t){r.addEventListener(t,s),n.mt[t]=s})},t.prototype.setAudio=function(t){var e=this,i=S.ArrayHelper.toArray(this.Vs.audioTracks).find(function(i){return e.cv(i)===t});i&&this.pu(i)},t.prototype.ou=function(t,e){this.Ft(v.PlayerEvent.AudioChanged,{targetAudio:this.Ru(e),sourceAudio:t,time:this.Vs.currentTime})},t.prototype.pu=function(t){if(!t.enabled){var e=S.ArrayHelper.toArray(this.Vs.audioTracks).find(function(t){return t.enabled}),i=null;e&&(e.enabled=!1,i=this.Ru(e)),t.enabled=!0,this.ou(i,t)}},t.prototype.setVolume=function(t,e){var i=this.Tu(),n=this.es,r=Math.min(t/100,1);n!==r&&(this.es=r,i.volume=r,this.Ft(v.PlayerEvent.VolumeChanged,{targetVolume:100*r,sourceVolume:100*n,issuer:e||p.API_ISSUER_NAME}))},t.prototype.qu=function(){var t=this;(0,I.clearTimeoutIfDefined)(this.Ut),this.ft||(this.Ut=window.setTimeout(function(){t.Ut=void 0,!t.ft&&t.Xs&&(t.type===m.StreamType.Hls?t.Xs.fireError(new o.PlayerError(a.ErrorCode.NETWORK_MANIFEST_DOWNLOAD_TIMEOUT,{sourceUrl:t.dt.url},"Failed to load the HLS playlist: the request timed out.",t.Ts.sourceContext.sourceIdentifier)):t.type===m.StreamType.Progressive&&t.Xs.fireError(new o.PlayerError(a.ErrorCode.NETWORK_PROGRESSIVE_STREAM_DOWNLOAD_TIMEOUT,{sourceUrl:t.dt.url},"Failed to load the progressive source: the request timed out.",t.Ts.sourceContext.sourceIdentifier)))},(0,V.toMilliSeconds)(this.Ys.XHR_TIMEOUT/2)))},t.getContentDomain=function(t){var e=document.createElement("a");return e.href=t,""===e.host&&(e.href=e.href),e.hostname},t.prototype.ru=function(t){var e;(0,A.isTizen)()&&(null===(e=this.Wt)||void 0===e||e.dispose(),this.Wt=new U.AssetAvailabilityChecker(this.Ts,t,this.Vs))},t.prototype.prepareLoad=function(){return Promise.resolve()},t.prototype.prepareSource=function(t,e){return Promise.resolve()},t.prototype.su=function(){var t,e,i,n;return(null===(e=null===(t=this.Ws)||void 0===t?void 0:t.tweaks)||void 0===e?void 0:e.prevent_video_element_preloading)?r.None:!1===(null===(n=null===(i=this.Ws)||void 0===i?void 0:i.adaptation)||void 0===n?void 0:n.preload)?r.Metadata:r.Auto},t.prototype.load=function(e,i,n){var s,a=this,o=null!==(s=null==i?void 0:i.seeking)&&void 0!==s&&s;this.Lt=this.Ts.serviceManager.get(d.ServiceName.PlayerStateService),this.Lt.transitionToSeekedState(!1);var u=this.su();u!==r.Auto&&this.Vs.setAttribute("preload",u),this.type=this.Ts.sourceContext.technology.streaming,this.dt=e,e.type&&(this.type=e.type),!0===this.fs&&this.unload().catch(function(){}),this.ft=!1,this.gt=!1,this.Tu().nativeMediaEventListener.reset(),this.kt=!0,this.is=!1,this.Kt=0,this.st=void 0,this.tt=!1,this.ct=1,this.bt=new Map,e.hasOwnProperty("vr")&&e.vr&&Boolean(e.vr.restrictedInlinePlayback)?(this.Pt=!0,this.gs=_.Util.getVRAudioElement(),this.tv(this.gs)):(this.gs=null,this.Pt=!1,this.tv(this.Vs)),this.Xs.on(v.PlayerEvent.TimeChanged,this.wv),this.nt=(0,E.subscribe)(this.Ts.store)(function(t){return(0,g.getIsStopped)((0,g.getPlayerState)(t))},this.Yu,function(t){return!0===t}),this.Ys.GLOBAL_DISABLE_SEEKING=o||!1,this.ks>-1&&((0,I.clearTimeoutIfDefined)(this.ks),this.ks=-1);var l="";e&&e.url&&("string"==typeof e.url?l=e.url:e.url.length>0&&(l=e.url[0].url));var h=window.location.hostname===t.getContentDomain(l);e.hasOwnProperty("vr")&&Boolean(e.vr)&&!h&&(this.qt=this.Vs.getAttribute("crossOrigin"),this.Vs.setAttribute("crossOrigin","anonymous")),this.Vs.eventHandler.reset(),this.pt||(this.vs=this.vv()),this.ht=new M.Deferred;var c=this.uu(e,n);return this.ht.promise.then(function(){a.Ts.sourceContext.source=e.config}).then(function(){return c}).then(function(){return a.vu(e)})},t.prototype.tu=function(t){var e=this;(0,A.isSafari17orIOS17)()&&fetch(t.url,{method:O.HttpRequestMethod.GET,headers:{Range:"bytes=0-0"}}).then(function(t){t.redirected&&(e.gt&&e.ht.resolve(),e.tt=!0)}).catch(function(){})},t.prototype.uu=function(t,e){var i=this;return this.type===m.StreamType.Hls?(this.tu(t),this.Bu(t)):this.type===m.StreamType.Progressive?this.Cu(t,e).then(function(){return i.wu()}):Promise.resolve()},t.prototype.vu=function(t){this.Jt=t,this.fs=!0,this.Nt=0,this.Ot=-1,this.ns=!1},t.prototype.wu=function(){var t,e;(null===(e=null===(t=this.Ws)||void 0===t?void 0:t.tweaks)||void 0===e?void 0:e.prevent_video_element_preloading)?this.Dt():this.Vs.load()},t.prototype.xu=function(e,i){var n=this;if(e.config.drm&&e.config.drm.fairplay){var r=C.ModuleManager.get(w.ModuleName.DRM).FairplayHandler;this.Rt=new r(this.Ts,this.Vs,e.config.drm.fairplay)}var s=t.createSourceElement(i,null);this.Hu(s,"0",e),this.ru(s);var o={element:s,handler:function(t){return n.Eu(a.ErrorCode.SOURCE_HLS_STREAM_ERROR,s.src,t)}};this.it.push(o),o.element.addEventListener(L.MediaElementEvent.error,o.handler)},t.prototype.yu=function(t,e){this.xu(t,e),this.wu()},t.prototype.zu=function(t,e){var i,n,r=R.URLHelper.appendQueryParametersToUrl(e,{"bitmovin-player-id":this.Ts.internalPlayerID});this.yu(t,r);var s=this.St.resolveMasterManifest(t.url).then(function(){}).catch(function(t){});return(null===(n=null===(i=this.Ws)||void 0===i?void 0:i.tweaks)||void 0===n?void 0:n.prevent_video_element_preloading)?Promise.resolve():s},t.prototype.Au=function(t,e){var i=this;return x.createHlsManifestController(this.Ts).then(function(n){return i.St=n,i.Ys.NATIVE_HLS_DOWNLOAD_ERROR_HANDLING&&(i.Tt=new k.HlsDownloadErrorHandler(i.Ts,n)),x.shouldUseServiceWorker(i.Ts)?i.zu(t,e):i.St.resolveMasterManifest(t.url).then(function(e){0!==e.indexOf("data")&&0!==e.indexOf("blob")||i.yu(t,e)}).catch(function(t){})})},t.prototype.Bu=function(t){var e;if("string"!=typeof t.url){var i=new o.PlayerError(a.ErrorCode.SOURCE_INVALID,{given:t.url},"Cannot load the HLS playlist: the source URL should be a string.",this.Ts.sourceContext.sourceIdentifier);return null===(e=this.Xs)||void 0===e||e.fireError(i),this.ht.reject(i),Promise.resolve()}var n=this.adjustToFullUrlWithQueryParams(t.url);return this.Ys.NATIVE_HLS_PARSING?this.Au(t,n):(this.yu(t,n),Promise.resolve())},t.prototype.Cu=function(t,e){if(this.Zt=[],Array.isArray(t.url))this.Du(t.url,e);else{var i={url:t.url,bitrate:0};this.Vs.src=this.adjustToFullUrlWithQueryParams(i.url),this.Ju("0",i),this.Ku("0",i),this.ru(this.Vs.getWrappedElement())}return Promise.resolve()},t.prototype.Du=function(t,e){var i=this;e=e||function(t){var e=t.findIndex(function(t){return!0===t.preferred});return e>-1?String(e):"0"}(t);var n=this.Fu(t,e,!0);if(n){var r={element:n,handler:function(t){return i.Eu(a.ErrorCode.SOURCE_PROGRESSIVE_STREAM_ERROR,n.src,t)}};this.it.push(r),r.element.addEventListener(L.MediaElementEvent.error,r.handler),this.Pt&&this.gs&&this.gs.load(),this.ru(n)}},t.prototype.Eu=function(t,e,i){var n,r=this;(0,I.clearTimeoutIfDefined)(this.Ut),null===(n=this.Wt)||void 0===n||n.dispose(),this.fs=!0,new y.DefaultContentLoader(this.Ts).load(e).then(function(t){return{status:t.status,statusText:t.statusText,error:void 0}}).catch(function(t){return{error:t,status:(null==t?void 0:t.status)||0,statusText:(null==t?void 0:t.statusText)||""}}).then(function(n){var s,a=n.error,u=n.status,l=n.statusText,h=(null==i?void 0:i.message)||i,d=function(t,e){r.ht.reject(new o.PlayerError(t,e,"The video element has thrown an error while loading the stream.",r.Ts.sourceContext.sourceIdentifier))};200!==u?d(t,s={event:i,error:a,status:u,statusText:l,src:e,extraMessage:h}):(s={event:i,error:a,src:e,extraMessage:h},r.dt&&r.Kt<r.Ys.MAX_RETRIES?(r.Kt++,r.uu(r.dt).catch(function(){return d(t,s)})):d(t,s))})},t.prototype.Fu=function(e,i,n){for(var r,s=[],a=-1,o=null,u=null,l=0;l<e.length;l++){var h=e[l];if(!this.Gu(h,u,n)){if(r=t.createSourceElement(this.adjustToFullUrlWithQueryParams(h.url),h.type),u=u||h.type,this.Ju(String(l),h),n){if(s.indexOf(h.type)>-1)continue;i===String(l)?(o=r,a=h.bitrate,this.Hu(r,String(l),h),s.push(h.type)):a===h.bitrate&&(o=r,this.Iu(r),s.push(h.type))}else o=r,this.Hu(r,String(l),h);this.Pt&&this.gs&&(this.gs.innerHTML=this.Vs.innerHTML)}}return o},t.prototype.Gu=function(e,i,n){return!t.isValidProgressiveSourceObject(e)||!!n&&(!this.Lu(e.type)||!!i&&i!==e.type)},t.isValidProgressiveSourceObject=function(t){return"object"==typeof t&&t&&t.url&&""!==t.url},t.prototype.Hu=function(t,e,i){this.Vs.appendChild(t),this.Ku(e,i)},t.prototype.Iu=function(t){this.Vs.appendChild(t)},t.prototype.Ju=function(t,e){var i={id:t};e.bitrate&&(i.bitrate=e.bitrate),i.label=String(e.label||e.bitrate||"unknown"),this.Zt.push(i)},t.prototype.Ku=function(t,e){this.at={id:t},e.bitrate&&(this.at.bitrate=e.bitrate),this.at.label=""+(e.label||e.bitrate||"unknown")},t.prototype.Lu=function(t){return!(this.Vs.canPlayType(t).length<=0)},t.createSourceElement=function(t,e){var i=document.createElement("source");return i.src=t,e&&(e.indexOf("/")<0&&(e="video/"+e),i.type=e),i},t.prototype.unload=function(t,e){var i,n;return void 0===t&&(t=p.API_ISSUER_NAME),void 0===e&&(e=!1),this.rt.onUnload(t),this.mu(),this.ht&&!e&&this.ht.reject(),(0,I.clearTimeoutIfDefined)(this.Vt),(0,I.clearTimeoutIfDefined)(this.Ut),null===(i=this.Wt)||void 0===i||i.dispose(),this.hs=!1,this.Ot=-1,this.Rt=(0,c.dispose)(this.Rt),this.Tt=(0,c.dispose)(this.Tt),this.St=(0,c.dispose)(this.St),this.Mu(t),this.pt||(null===(n=this.vs)||void 0===n||n.signalSourceChange(),this.vs=(0,c.dispose)(this.vs)),this.Pu(),this.Nu(),this.pause(),this.is=!0,this.Ou(),this.bt.clear(),this.nt&&this.nt(),this.et&&(this.at=null),this.fs&&(this.fs=!1,e||(this.Ft(v.PlayerEvent.SourceUnloaded,{oldSource:this.Jt}),this.Xt=null)),Promise.resolve()},t.prototype.Mu=function(t){var e,i,n,r=null===(e=this.Ts.sourceContext)||void 0===e?void 0:e.sourceIdentifier;if(r){var s=this.Ts.serviceManager,a=!(null===(i=this.Ts.sourceContext)||void 0===i?void 0:i.isAd);t===p.ADVERTISING_ISSUER_NAME&&a?null===(n=s.get(d.ServiceName.NativeManifestService,r))||void 0===n||n.suspend():(0,h.disposeService)(s,d.ServiceName.NativeManifestService,r)}},t.prototype.Nu=function(){if(this.Pt&&this.gs){for(this.gs.removeAttribute("src");this.gs.firstChild;)this.gs.removeChild(this.gs.firstChild);this.gs.load()}},t.prototype.Ou=function(){this.Pt?this.gs&&this.uv(this.gs):this.uv(this.Vs),this.mu(),this.Xs.off(v.PlayerEvent.TimeChanged,this.wv),this.Xs.off(v.PlayerEvent.TimeChanged,this.xv),this.it.forEach(function(t){try{t.element.removeEventListener(L.MediaElementEvent.error,t.handler)}catch(t){}})},t.prototype.Pu=function(){N.VideoElementUtil.removeSource(this.Vs),null!=this.qt?this.Vs.setAttribute("crossOrigin",this.qt):this.Vs.removeAttribute("crossOrigin"),this.Vs.load()},t.prototype.Qu=function(){return this.Pt&&this.gs&&"readyState"in this.gs?this.gs.readyState!==HTMLMediaElement.HAVE_NOTHING:!("readyState"in this.Vs)||this.Vs.readyState!==HTMLMediaElement.HAVE_NOTHING},t.prototype.isLive=function(){return this.Tu().duration===1/0},t.prototype.isPlaying=function(){return this.Lt.isPlaying()},t.prototype.isPaused=function(){return this.Lt.isPaused()},t.prototype.hasEnded=function(){return this.hs},t.prototype.isMuted=function(){return this.Tu().muted},t.prototype.isStalled=function(){return this.Lt.isStalled},t.prototype.getVolume=function(){return 100*this.Tu().volume},t.prototype.getDuration=function(){return this.Tu().duration},t.prototype.Ru=function(t){var e={id:this.cv(t),label:t.label,lang:t.language,getQualities:null},i=this.dv(e);return i&&"string"==typeof i&&(e.label=i),e},t.prototype.getAudio=function(){var t=S.ArrayHelper.toArray(this.Vs.audioTracks).findIndex(function(t){return t.enabled});return-1===t?null:this.getAvailableAudio()[t]},t.prototype.getAvailableAudio=function(){var t=this;return S.ArrayHelper.toArray(this.Vs.audioTracks).map(function(e){return t.Ru(e)})},t.prototype.cv=function(t){return this.bt.has(t)||this.bt.set(t,String(this.ct++)),this.bt.get(t)},t.prototype.dv=function(t){var e={id:t.id,lang:t.lang,mimeType:P.MimeType.AudioMp4};return this.ev()(e)},t.prototype.ev=function(){var e=this.Ts.sourceContext,i=e&&e.source&&e.source.labeling;return i&&i[this.type]&&i[this.type].tracks?"function"!=typeof i[this.type].tracks?t.getDefaultLabelForAudio:i[this.type].tracks:t.getDefaultLabelForAudio},t.getDefaultLabelForAudio=function(){return null},t.prototype.getDownloadedVideoData=function(){return this.type===m.StreamType.Progressive?this.at:this.St?this.St.getDownloadedVideoData():{id:W,bitrate:0,height:0,width:0,isAuto:!0}},t.prototype.getDownloadedAudioData=function(){return{id:W,bitrate:0,isAuto:this.type===m.StreamType.Progressive}},t.prototype.fv=function(t){var e={};return e.id=t.id,e.label=t.label,t.width>1?e.width=t.width:this.at&&this.at.id===t.id&&(this.at.width>1?e.width=this.at.width:!isNaN(this.Vs.videoWidth)&&this.Vs.videoWidth>1&&(e.width=this.Vs.videoWidth)),t.height>1?e.height=t.height:this.at&&this.at.id===t.id&&(this.at.height>1?e.height=this.at.height:!isNaN(this.Vs.videoHeight)&&this.Vs.videoHeight>1&&(e.height=this.Vs.videoHeight)),void 0!==t.bitrate&&"unknown"!==t.bitrate&&(e.bitrate=t.bitrate),e},t.prototype.getPlaybackVideoData=function(){if(this.St){var t=this.St.getPlayingVideoData();if(t)return t}if(this.at){var e=this.fv(this.at);return"progressive"!==this.type&&(e.id=W),e}return{id:W,bitrate:0,height:this.Vs.videoHeight,width:this.Vs.videoWidth}},t.prototype.getPlaybackAudioData=function(){return{id:W,bitrate:0}},t.prototype.getMaxTimeShift=function(){if(!this.cu())return 0;var t=this.zv();return this.gv()&&t.start>=0?t.start-t.end:0},t.prototype.gv=function(){return this.type===m.StreamType.Hls&&this.isLive()},t.prototype.timeShift=function(t,e){if(this.cu()&&this.hv(t,e))if(0===t){var i=this.zv();i.end>=0&&this.au(i.end)}else this.au(t,e)},t.prototype.hv=function(t,e){if(e===p.STARTUP_ISSUER_NAME&&!function(t){return null!=(null==t?void 0:t.startTime)||null!=(null==t?void 0:t.startOffset)}(this.Ts.sourceContext.source.options))return!1;var i=Math.abs(Math.abs(t)-Math.abs(this.getTimeShift())),n=this.nv(t);return i>.25&&!(this.ss&&n)},t.prototype.getTimeShift=function(){if(this.iv())return 0;var t=this.zv();if(t.start>=0&&this.kv()){var e=Q(this.Tu().currentTime-t.end,this.yv());this.ss=this.nv(e)&&!this.jv(),this.ts=this.ss?0:e}return isFinite(this.ts)?this.ts:0},t.prototype.iv=function(){return!this.isLive()||!this.Lt.hasBeenPlaying&&!this.Lt.seekedOrTimeshifted||this.ss},t.prototype.jv=function(){return this.isStalled()||this.isPaused()},t.prototype.kv=function(){return!isFinite(this.ts)||this.jv()},t.prototype.getManifest=function(){return this.St?this.St.getManifest():null},t.prototype.getSnapshot=function(t,e){if(this.isPlaying()||this.isPaused()){var i=this.Vs.videoWidth,n=this.Vs.videoHeight;if(this.cs||(this.cs=document.createElement("canvas"),this.cs.id="snapshotHiddenCanvas"),!this.cs||!this.cs.getContext||!this.cs.getContext("2d"))return;this.cs.height=n,this.cs.width=i,this.ds=this.cs.getContext("2d"),this.ds.drawImage(this.Vs.getWrappedElement(),0,0,i,n);var r=void 0;try{"image/jpeg"===t||"image/webp"===t?(Number(e)===e?(e<0||e>1)&&(e=1):e=1,r=this.cs.toDataURL(t,e)):r=this.cs.toDataURL(t,e)}catch(t){return void(t&&t.message)}return{height:n,width:i,data:r}}},t.prototype.setPlaybackSpeed=function(t){this.Tu().playbackRate=t},t.prototype.getPlaybackSpeed=function(){return this.Tu().playbackRate},t.prototype.permitControl=function(t){this.js=t},t.prototype.mv=function(){this.ts=-1/0,this.cu()&&(this.ss=!1)},t.prototype.nv=function(t){return Math.abs(t)<2*this.Ys.SEEK_TO_END_OFFSET},t.prototype.ov=function(){return this.us!==this.Mt&&this.It===p.STARTUP_ISSUER_NAME},t.prototype.pv=function(){this.ov()&&(this.ku(this.us),this.It=p.API_ISSUER_NAME,this.us=-1)},t.prototype.rv=function(){this.Lt.isSeeking()&&(this.Lt.transitionToSeekedState(this.It!==p.STARTUP_ISSUER_NAME),this.It=p.API_ISSUER_NAME),this.Lt.isTimeShifting()&&this.Lt.transitionToTimeShiftedState(this.It!==p.STARTUP_ISSUER_NAME)},t.prototype.tv=function(t){for(var e=0;e<this.ot.length;e++){var i=this.ot[e].elementSelector?this.ot[e].elementSelector(t):t;i&&i.addEventListener(this.ot[e].event,this.ot[e].handler)}},t.prototype.uv=function(t){for(var e=0;e<this.ot.length;e++){var i=this.ot[e].elementSelector?this.ot[e].elementSelector(t):t;i&&i.removeEventListener&&i.removeEventListener(this.ot[e].event,this.ot[e].handler)}},t.prototype.getBufferLevel=function(t){var e={level:null,targetLevel:null,type:t,media:m.MediaType.Video},i=this.Tu();if(!i.buffered||i.buffered.length<1)return e;var n=function(n){for(var r=0;r<i.buffered.length;r++){var s=i.buffered.start(r),a=i.buffered.end(r);s>n||a<=n||(e.level=a-n,t===m.BufferType.BackwardDuration&&(e.level=n-s))}},r=i.currentTime;if(n(r),null==e.level){var s=function(t,e){for(var i=t.buffered.start(0),n=Math.abs(i-e),r=1;r<t.buffered.length;r++){var s=Math.abs(t.buffered.start(r)-e);s<n&&(n=s,i=t.buffered.start(r))}return{distanceToCurrentTime:n,closestBufferStart:i}}(i,r),a=s.distanceToCurrentTime,o=s.closestBufferStart;a<1&&n(o)}return e},t.prototype.vv=function(){if(C.ModuleManager.has(w.ModuleName.SubtitlesNative))return new(0,C.ModuleManager.get(w.ModuleName.SubtitlesNative).TextTrackController)(this.Ts,this.Vs,this.Ws,this.type)},t.prototype.removeSubtitle=function(t){t&&this.vs&&this.vs.removeSubtitle(t)},t.prototype.addSubtitle=function(t){return this.vs?(this.removeSubtitle(t.id),t.kind="subtitles",this.vs.addSubtitle(t)):Promise.reject()},t.prototype.listSubtitles=function(){return this.vs?this.vs.getAvailableSubtitles():[]},t.prototype.enableSubtitle=function(t){return this.vs?this.vs.enableSubtitle(t):Promise.resolve(!1)},t.prototype.disableSubtitle=function(t){return this.vs?Promise.resolve(this.vs.disableSubtitle(t)):Promise.resolve(!1)},t.prototype.adjustToFullUrlWithQueryParams=function(t){var e=R.URLHelper.toFullUrl(t);return R.URLHelper.appendQueryParametersToUrl(e,this.Ys.QUERY_PARAMETERS)},t.prototype.onFullscreenEnter=function(){this.ut=this.Vs.webkitDisplayingFullscreen,this.vs&&this.ut&&this.vs.enableNative()},t.prototype.onFullscreenExit=function(){this.vs&&this.ut&&this.vs.disableNative(),this.ut=!1},t.prototype.getAvailableVideoQualities=function(){var t=this;return"progressive"!==this.type?[]:this.Zt.map(function(e){return t.fv(e)})},t.prototype.getBufferedRanges=function(){var t=this;return(0,s.getBufferedRanges)(this.Tu()).map(function(e){return(0,s.convertRangeToTimeMode)(e,t.getStartDate(),m.TimeMode.AbsoluteTime)})},t.prototype.setVideoQuality=function(t){var e,i=this,r=this.getPlaybackSpeed(),s=this.Zt.find(function(e){return e.id===t});if("progressive"===this.type&&s&&(!this.at||this.at.id!==t)){this.pt=!0,this.bs=this.getCurrentTime(),this.Zt=[],this.et=!1;var a=this.Lt.isPlaying()||this.Lt.isPlay();this.Lt.stallEnter(),this.unload(p.API_ISSUER_NAME,!0).catch(function(){});var o=this.fv(s),h={sourceQuality:this.at,sourceQualityId:this.at?this.at.id:null,targetQuality:o,targetQualityId:o.id};this.Xs.one(v.PlayerEvent.StallEnded,function(){i.et=!0,(0,T.getCapabilities)().isIOS||(0,T.getCapabilities)().isSafari?(i.Zs=0,i.Xs.on(v.PlayerEvent.TimeChanged,i.xv)):(i.Zs=1/0,i.xv()),a&&(i.play(p.INTERNAL_ISSUER_NAME).catch(function(){i.Ft(v.PlayerEvent.Warning,new u.PlayerWarning(l.WarningCode.PLAYBACK_COULD_NOT_BE_STARTED))}),i.Lt.transitionToPlayingState(p.INTERNAL_ISSUER_NAME,!1))}),this.Ft(v.PlayerEvent.VideoQualityChanged,n({},h),!0),null===(e=this.Qt)||void 0===e||e.initAirplay(),this.load(this.dt,{seeking:this.Ys.GLOBAL_DISABLE_SEEKING},t).then(function(){i.setPlaybackSpeed(r),i.Ft(v.PlayerEvent.VideoDownloadQualityChange,n({},h),!0),i.Ft(v.PlayerEvent.VideoDownloadQualityChanged,n({},h),!0),i.Ft(v.PlayerEvent.VideoPlaybackQualityChanged,{sourceQuality:h.sourceQuality,targetQuality:h.targetQuality},!0)})}},t.prototype.isAirplayAvailable=function(){var t,e;return null!==(e=null===(t=this.Qt)||void 0===t?void 0:t.isAirplayAvailable())&&void 0!==e&&e},t.prototype.isAirplayActive=function(){var t,e;return null!==(e=null===(t=this.Qt)||void 0===t?void 0:t.isAirplayActive())&&void 0!==e&&e},t.prototype.showAirplayTargetPicker=function(){var t;null===(t=this.Qt)||void 0===t||t.showAirplayTargetPicker()},t.prototype.yv=function(){return this.isLive()?{start:this.getMaxTimeShift(),end:0}:{start:-1,end:-1}},t.prototype.zv=function(){var t=this.Vs.seekable;if(t.length>0){var e={start:t.start(0),end:t.end(0)};return e.start=Math.max(0,e.start),e}return{start:-1,end:-1}},t.prototype.getSeekableRange=function(){if(!this.isLive()||this.Ys.ENABLE_SEEK_FOR_LIVE){var t=this.getStartDate(),e=this.zv();return t?(0,s.convertRangeToTimeMode)(e,t,m.TimeMode.AbsoluteTime):e}return{start:-1,end:-1}},t.prototype.createManifestApi=function(){return this.St?F.NativePlayerManifestApiFactory.create(this.St):null},t.prototype.release=function(){var t,e=this,i=this.unload(p.API_ISSUER_NAME).catch(function(){});return(0,I.clearTimeoutIfDefined)(this.Ut),i=i.then(function(){e.type=null,e.Ws=null,e.Xs=null,e.Ys=null,e.bs=null,e.cs=null,e.ds=null,e.gs=null,e.Vs=null,e.ws=null,e.xs=null,e.It=null,e.Jt=null,e.dt=null,e.at=null,e.Zt=null,e.it=null,e.st=void 0}),null===(t=this.Qt)||void 0===t||t.dispose(),this.vs&&this.vs.dispose(),this.vs=null,this.Rt&&this.Rt.dispose(),this.Rt=null,this.Tt&&this.Tt.dispose(),this.Tt=null,this.St&&this.St.dispose(),this.St=null,i},t.prototype.setQueryParameters=function(t){this.Ys.QUERY_PARAMETERS=t},t.prototype.clearQueryParameters=function(){this.Ys.QUERY_PARAMETERS=void 0},t.prototype.setAudioQuality=function(t){},t.prototype.setTargetBufferLevel=function(){},t.prototype.getAvailableAudioQualities=function(){return[]},t.prototype.getDroppedVideoFrames=function(){return 0},t.prototype.getTotalStalledTime=function(){return 0},t.prototype.updateCallback=function(t){},t.prototype.getAvailableSegments=function(){return{}},t.prototype.getLatency=function(){var t=this.Vs.getWrappedElement();if(!t.getStartDate)return 1/0;var e=t.getStartDate().getTime();if(isNaN(e))return 1/0;var i=(new Date).getTime();return(0,V.toSeconds)(i-e)-this.Vs.currentTime},t.prototype.setTargetLatency=function(t){},t.prototype.getTargetLatency=function(){},t.prototype.setCatchupConfig=function(t){},t.prototype.getCatchupConfig=function(){},t.prototype.setFallbackConfig=function(t){},t.prototype.getFallbackConfig=function(){},t}();function Q(t,e){return(t<e.start||t>e.end)&&(t=Math.max(t,e.start),t=Math.min(t,e.end)),t}e.NativePlayer=j},56678:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.NativePlayerManifestApiFactory=void 0;var n=i(34047),r=i(21216),s=function(){function t(){}return t.create=function(e){var i=e.getParsedManifest();return e.isValidMasterPlaylist(i)?new(function(){return function(){this.hls=t.createHlsApi(e)}}()):null},t.createHlsApi=function(e){var i=e.getParsedManifest(),n=i.media.filter(function(t){return"AUDIO"===t.attributes.TYPE}),r=i.media.filter(function(t){return"SUBTITLES"===t.attributes.TYPE||"CLOSED-CAPTIONS"===t.attributes.TYPE});return new(function(){function s(){this.properties=e.getParsedManifest().tags}return s.prototype.getVideoTracks=function(){return t.getVideoTracks(i.playlists)},s.prototype.getAudioTracks=function(){return t.getAudioTracks(n,i.playlists)},s.prototype.getTextTracks=function(){return t.getTextTracks(r)},s}())},t.getAudioTracks=function(t,e){var i=t.reduce(function(t,e){return t[e.attributes.LANGUAGE]||(t[e.attributes.LANGUAGE]=e.attributes.NAME),t},{}),r=Object.keys(i).map(function(e,n){return{id:"audio-".concat(n),label:i[e],lang:e,getQualities:function(){return t.filter(function(t){return t.attributes.LANGUAGE===e}).map(function(t,e){return{id:e+"",bitrate:0,label:t.attributes.NAME}})}}}),s=function(t){return t.attributes.CODECS&&n.CodecStringHelper.getMimeTypeForCodecString(t.attributes.CODECS).includes("audio")};return e.some(s)&&r.push({id:"audio-".concat(r.length),label:"und",lang:"",getQualities:function(){return e.filter(s).map(function(t,e){return{id:e+"",bitrate:t.attributes.BANDWIDTH,codec:n.CodecStringHelper.getExtractedCodecStrings(t.attributes.CODECS).audio}})}}),r},t.getVideoTracks=function(e){var i=e.filter(function(t){return!t.attributes.CODECS||n.CodecStringHelper.getMimeTypeForCodecString(t.attributes.CODECS).includes("video")});return[{id:"video-0",label:"und",getQualities:function(){return t.getVideoQualities(i)}}]},t.getTextTracks=function(t){return t.map(function(t,e){return{id:"text-".concat(e),label:t.attributes.NAME,lang:t.attributes.LANGUAGE,isFragmented:!0,kind:"CLOSED-CAPTIONS"===t.attributes.TYPE?"caption":"subtitle",url:t.attributes.URI}})},t.getVideoQualities=function(t){return t.map(function(t){var e=t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width,i=t.attributes.RESOLUTION&&t.attributes.RESOLUTION.height,s=n.CodecStringHelper.getExtractedCodecStrings(t.attributes.CODECS).video,a={id:i?"".concat(i,"_").concat(t.attributes.BANDWIDTH):"".concat(t.attributes.BANDWIDTH),bitrate:t.attributes.BANDWIDTH,width:e||0,height:i||0,colorInfo:{dynamicRange:(0,r.getDynamicRangeForHlsVariant)(t.attributes["VIDEO-RANGE"],s)}};return s&&(a.codec=s),a})},t}();e.NativePlayerManifestApiFactory=s},49706:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.TechnologyChecker=void 0;var n=i(44468),r=function(){function t(){}return t.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}]},t}();e.TechnologyChecker=r}},function(t){return function(){return t(27530)}()}])});
|
|
17
|
+
"use strict";!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["engine-native"]=e():(t.bitmovin=t.bitmovin||{},t.bitmovin.player=t.bitmovin.player||{},t.bitmovin.player["engine-native"]=e())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[855],{48297:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractHlsManifestController=void 0;var n,r=i(80813),a=i(3714),o=i(32703),s=i(59225),l=i(32485),u=i(79721),h=i(89927),d=i(70850),c=i(88052),p=i(62756);!function(t){t.CueTag="cueTag",t.Scte35="scte35",t.DateRange="dateRange",t.CustomTags="customTags"}(n||(n={}));var f=function(){function t(t){var e,i=this;this.context=t,this.y9=function(t){if(t.hasOwnProperty("metadata")){var e={metadataType:t.metadataType.toUpperCase(),metadata:t.metadata};(t.start||0===t.start)&&(e.start=t.start),t.end&&(e.end=t.end),i.context.eventHandler.dispatchEvent(a.PlayerEvent.Metadata,e)}},this.z9=function(t){var e=i.segmentTimelineController.getPlayingSegment(t.relativeTime||t.time);e&&!e.consumed&&(e.consumed=!0,i.B9(e),i.A9(e))},this.C9=function(){i.segmentTimelineController.reset()},this.D9=function(){i.segmentTimelineController.reset()},this.settings=t.settings,this.w9=t.eventHandler,this.w9.on(a.PlayerEvent.TimeChanged,this.z9),this.w9.on(a.PlayerEvent.TimeShifted,this.C9),this.w9.on(a.PlayerEvent.Seeked,this.D9),this.x9=new s.MetadataService(this.context,((e={})[l.TimedMetadataType.Manifest]=this.y9,e[l.TimedMetadataType.DateRange]=this.y9,e))}return t.prototype.A9=function(t){var e={url:t.uri,uid:null,mimeType:"video/mp4",playbackTime:t.playbackTime,duration:t.duration,mediaInfo:{},dateTime:null};t.dateTime&&(e.dateTime=t.dateTime.toISOString()),t.customTags&&t.customTags.length>0&&(e.EXPERIMENTAL=e.EXPERIMENTAL||{},e.EXPERIMENTAL.hlsAttributes=t.customTags.map(function(t){return t.attributes})),this.context.eventHandler.dispatchEvent(a.PlayerEvent.SegmentPlayback,e)},t.prototype.B9=function(t){var e=this,i=t.dateTime?(0,h.toSeconds)(t.dateTime.getTime()):t.playbackTime,n=i+t.duration;t.metadata&&t.metadata.forEach(function(t){!function(t){return t.type.includes("CUE")}(t)?e.context.eventHandler.dispatchEvent(a.PlayerEvent.Metadata,{metadataType:t.type,metadata:t}):e.context.eventHandler.dispatchEvent(a.PlayerEvent.Metadata,{metadataType:a.MetadataType.CUETAG,metadata:t})}),t.customTags&&this.context.eventHandler.dispatchEvent(a.PlayerEvent.Metadata,{metadataType:a.MetadataType.CUSTOM,metadata:t.customTags,start:i,end:n})},t.prototype.isValidMasterPlaylist=function(t){return c.ModuleManager.get(p.ModuleName.HLS).NativeHlsManifestParserUtils.isValidMasterPlaylist(t)},t.prototype.E9=function(t){return c.ModuleManager.get(p.ModuleName.HLS).NativeHlsManifestParserUtils.parsePlaylist(t)},t.prototype.dispatchDateRangeToParsedService=function(t){var e,i={metadataType:a.MetadataType.DATERANGE,metadata:t.data,data:t.data,start:t.startTime,end:t.endTime};null===(e=this.context.serviceManager.get(r.ServiceName.MetadataParsedService))||void 0===e||e.addMetadata(u.DEFAULT_PERIOD_ID,i)},t.prototype.F9=function(t){return{metadataType:t.metadataType,metadata:t.metadata,data:t.metadata,start:t.start,end:t.end}},t.prototype.G9=function(t){var e=t.metadataType===a.MetadataType.DATERANGE?l.TimedMetadataType.DateRange:l.TimedMetadataType.Manifest;this.x9.addToMetadataParsedService(t.start,this.F9(t),u.DEFAULT_PERIOD_ID),t.metadataType!==a.MetadataType.CUSTOM&&this.x9.addToTimeline(e,t.start,t)},t.prototype.onPlaylistUpdated=function(t){var e,i,n=this,s=t.playlist,u=t.variant,h=t.segments;this.segmentTimelineController.switchTimeline(u.id);var c=this.segmentTimelineController.updateTimeline(u.id,h),p=this.context.serviceManager.get(r.ServiceName.MetadataParsedService);p&&(p.expirationTimeInSeconds=c);var f=null===(e=h[0])||void 0===e?void 0:e.dateTime;f&&this.x9.removeUntil(d.Util.timeInSeconds(f)),(0,o.extractDateRangeMetadata)(null!==(i=s.dateRange)&&void 0!==i?i:[],s.endList?s.programDateTime:void 0,function(t){var e={metadataType:a.MetadataType.DATERANGE,metadata:t.data,start:t.startTime,end:t.endTime};n.x9.addToTimeline(l.TimedMetadataType.DateRange,t.startTime,e)});var v=this.segmentTimelineController.getCurrentTimeline();this.extractMetadataFromTimeline(v,!s.endList)},t.prototype.extractMetadataFromTimeline=function(t,e){var i=this;t.forEach(function(t){Object.values(n).forEach(function(r){t.hasOwnProperty(r)&&function(t,e,i){var r=i&&e.dateTime?(0,h.toSeconds)(e.dateTime.getTime()):e.playbackTime;switch(t){case n.CueTag:return[{metadataType:a.MetadataType.CUETAG,metadata:e[n.CueTag],start:r}];case n.Scte35:return[{metadataType:a.MetadataType.SCTE,metadata:e[n.Scte35],start:r}];case n.CustomTags:return[{metadataType:a.MetadataType.CUSTOM,metadata:e[n.CustomTags],start:r,end:r+e.duration}];default:return[]}}(r,t,e).forEach(function(t){return i.G9(t)})})})},t.prototype.parseTimelineEntries=function(t){var e=this.E9(t);return c.ModuleManager.get(p.ModuleName.HLS).NativeHlsManifestParserUtils.isValidVariantPlaylist(e)?e.segments.map(function(t){var e;return{uri:t.uri,duration:t.duration,discontinuity:null!==(e=t.discontinuity)&&void 0!==e&&e,dateTime:null,metadata:[],consumed:!1,playbackTime:-1,keys:[]}}):[]},t.prototype.getPlaybackTimeOfFirstSegmentInTimeline=function(t){for(var e=0;e<t.length;e++)for(var i=t[e],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},t.prototype.H9=function(){this.w9&&(this.w9.off(a.PlayerEvent.TimeChanged,this.z9),this.w9.off(a.PlayerEvent.TimeShifted,this.C9),this.w9.off(a.PlayerEvent.Seeked,this.D9))},t.prototype.dispose=function(){this.H9(),this.segmentTimelineController&&(this.segmentTimelineController.dispose(),this.segmentTimelineController=null),this.x9&&(this.x9.dispose(),this.x9=null),this.settings=null,this.w9=null},t}();e.AbstractHlsManifestController=f},32418:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.AppleAirplayService=e.isAirplaySupported=void 0;var n,r=i(3714),a=i(19274);!function(t){t.Available="available",t.NotAvailable="not-available"}(n||(n={})),e.isAirplaySupported=function(){return Boolean(window.WebKitPlaybackTargetAvailabilityEvent)};var o=function(){function t(t,e){var i=this;this.videoElement=t,this.eventHandler=e,this.jP=!1,this.kP=function(t){switch(t.availability){case n.Available:i.jP=!0,i.eventHandler.dispatchEvent(r.PlayerEvent.AirplayAvailable);break;case n.NotAvailable:i.jP=!1}},this.lP=function(){i.eventHandler.dispatchEvent(r.PlayerEvent.AirplayChanged,{airplayEnabled:i.isAirplayActive(),time:i.videoElement.currentTime})},this.initAirplay()}return t.prototype.initAirplay=function(){this.videoElement.setAttribute("x-webkit-airplay","allow"),this.videoElement.addEventListener(a.MediaElementEvent.webkitplaybacktargetavailabilitychanged,this.kP),this.videoElement.addEventListener(a.MediaElementEvent.webkitcurrentplaybacktargetiswirelesschanged,this.lP)},t.prototype.isAirplayAvailable=function(){return this.jP},t.prototype.isAirplayActive=function(){return this.videoElement.isAirplayActive()},t.prototype.showAirplayTargetPicker=function(){this.isAirplayAvailable()&&(this.videoElement.webkitShowPlaybackTargetPicker(),this.eventHandler.dispatchEvent(r.PlayerEvent.ShowAirplayTargetPicker))},t.prototype.dispose=function(){this.videoElement.removeEventListener(a.MediaElementEvent.webkitplaybacktargetavailabilitychanged,this.kP),this.videoElement.removeEventListener(a.MediaElementEvent.webkitcurrentplaybacktargetiswirelesschanged,this.lP)},t}();e.AppleAirplayService=o},99373:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.AssetAvailabilityChecker=void 0;var n=i(4129),r=i(29669),a=i(89927),o=i(88844),s=i(19274),l=function(){function t(t,e,i){var o=this;this.context=t,this.source=e,this.mediaElement=i,this.oP=function(){o.mediaElement.removeEventListener(s.MediaElementEvent.loadstart,o.oP);var t=(0,a.toMilliSeconds)(o.context.settings.XHR_TIMEOUT)/2;o.mP=window.setTimeout(function(){var t=!1;o.nP=new n.DefaultContentLoader(o.context,{onProgress:function(e){var i;e.loadedBytes>0&&(t=!0,null===(i=o.nP)||void 0===i||i.cancel())},requestType:r.HttpRequestType.INTERNAL}),o.nP.load(o.source.src).catch(function(e){if(!t){var i=new Event(s.MediaElementEvent.error,{bubbles:!1,cancelable:!1});o.source.dispatchEvent(i)}})},t)},i.addEventListener(s.MediaElementEvent.loadstart,this.oP)}return t.prototype.dispose=function(){(0,o.clearTimeoutIfDefined)(this.mP),this.mediaElement.removeEventListener(s.MediaElementEvent.loadstart,this.oP),this.nP&&(this.nP.cancel(),this.nP.dispose())},t}();e.AssetAvailabilityChecker=l},95945:function(t,e,i){var n=this&&this.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.FallbackHlsManifestController=void 0;var r,a=i(25926),o=i(4224),s=i(3714),l=i(29669),u=i(88052),h=i(62756),d=i(48297),c=i(56191),p=i(59043),f=i(77374),v=function(t){function e(e,i){var n=t.call(this,e)||this;return n.oab=function(t){n.onPlaylistUpdated(t)},n.vab=function(t){return null},r=u.ModuleManager.get(h.ModuleName.HLS).PlaylistUtils,n.mab=i,n.nab=new p.HlsDownloadService(n.context),n.segmentTimelineController=new c.FallbackSegmentTimelineController(e.videoElement),n.mab.setOnPlaylistUpdated(n.oab),n}return n(e,t),e.prototype.init=function(){return Promise.resolve()},e.prototype.getDownloadedVideoData=function(){return{id:"not available",bitrate:0,height:0,width:0,isAuto:!0}},e.prototype.getPlayingVideoData=function(){return null},e.prototype.resolveMasterManifest=function(t){var e=this;return this.mab.resolveMasterManifest(t).then(function(t){var i=t.masterManifest,n=t.firstVariantPlaylist,r=t.resolvedMasterUrl;return e.overrideManifestUrl(i,r,n)})},e.prototype.getParsedManifest=function(){return this.mab.getParsedManifest()},e.prototype.getManifest=function(){return this.mab.getManifest()},e.prototype.overrideManifestUrl=function(t,e,i){return"createObjectURL"in window.URL?this.pab(t,i):(this.context.eventHandler.dispatchEvent(s.PlayerEvent.Warning,new a.PlayerWarning(o.WarningCode.SETUP_CREATE_OBJECT_URL_MISSING)),Promise.resolve(e))},e.prototype.pab=function(t,e){var i=this;return r.isLive(e)?Promise.resolve(this.uab(t)):Promise.all(this.qab(t)).then(function(e){return e.filter(function(t){return Boolean(t)}).forEach(function(e){t=t.replace(e.mediaUrl,e.blobUrl)}),i.uab(t)})},e.prototype.qab=function(t){var e=this;return t.split("\n").map(function(t){return f.parseUrlFromLine(t)}).filter(function(t){return null!==t}).map(function(t){return e.rab(t)})},e.prototype.rab=function(t){var e=this;return this.nab.downloadPlaylist(t,l.HttpRequestType.MANIFEST_HLS_VARIANT).then(function(i){var n=f.replaceManifestUrls(t,i.body,e.settings.QUERY_PARAMETERS);return{blobUrl:e.tab(n),mediaUrl:t}}).catch(this.vab)},e.prototype.sab=function(t){var e=this;return this.nab.downloadPlaylist(t.uri,l.HttpRequestType.MANIFEST_HLS_VARIANT).then(function(i){return{width:t.width,height:t.height,timeline:e.parseTimelineEntries(i.body)}}).catch(this.vab)},e.prototype.tab=function(t){var e=new Blob([t],{type:"application/x-mpegURL"});return window.URL.createObjectURL(e)},e.prototype.uab=function(t){return"data:application/x-mpegURL,"+encodeURIComponent(t)},e.prototype.wab=function(){var t=this.mab.getParsedManifest();return t?t.playlists.map(function(t){return{uri:t.uri,width:t.attributes&&t.attributes.RESOLUTION?t.attributes.RESOLUTION.width:-1,height:t.attributes&&t.attributes.RESOLUTION?t.attributes.RESOLUTION.height:-1}}):[]},e.prototype.xab=function(){var t=this,e=this.wab();e.reverse();var i=e.map(function(e){return t.sab(e)});return Promise.all(i).then(function(e){var i=t.getPlaybackTimeOfFirstSegmentInTimeline(e);return i>=0&&e.forEach(function(t){t.timeline.reduce(function(t,e){return e.playbackTime=t,t+e.duration},i)}),e})},e.prototype.getCurrentSegments=function(t,e,i,n){return void 0===n&&(n=1),this.xab().then(function(r){var a=r.find(function(t){return t.width===e&&t.height===i});return function(t,e,i){for(var n,r=[],a=0;a<t.length;a++){var o=t[a];n=0;for(var s=0;s<o.timeline.length;s++){var l=o.timeline[s];if(l.playbackTime+l.duration>=i&&(r.push(l.uri),n++),n>e)break}}return r}(a?[a]:r,n,t)})},e.prototype.dispose=function(){var e;null===(e=this.mab)||void 0===e||e.setOnPlaylistUpdated(void 0),t.prototype.dispose.call(this)},e}(d.AbstractHlsManifestController);e.FallbackHlsManifestController=v},56191:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.FallbackSegmentTimelineController=void 0;var n=i(25541),r=function(){function t(t){this.Phb=t,this.Qhb=!0,this.Nhb={}}return t.prototype.Rhb=function(){return this.Phb.duration===1/0},t.prototype.switchTimeline=function(t){this.Nhb[t]||(this.Ohb=t,this.Nhb[t]=[])},t.prototype.updateTimeline=function(t,e){var i=this,r=this.Nhb[t],a=n.updateTimeline(r,e),o=a.findIndex(function(t){return t.hasOwnProperty("playbackTime")});-1!==o&&n.populateCurrentTimelineWithPlaybackTime(a,o,a[o].playbackTime),this.Nhb[t]=a;var s=a.reduce(function(t,e){return i.Rhb()&&!i.Qhb||(e.playbackTime=t),t+e.duration},0);return this.Qhb&&(this.Qhb=!1),s},t.prototype.getPlayingSegment=function(t){for(var e=this.getCurrentTimeline(),i=0;i<e.length;i++){var n=e[i];if(t>=n.playbackTime&&t<=n.playbackTime+n.duration)return e[i]}return null},t.prototype.addDownloadedSegments=function(t){},t.prototype.getCurrentTimeline=function(){return this.Nhb[this.Ohb]},t.prototype.getAllTimelines=function(){return this.Nhb},t.prototype.reset=function(){this.Nhb[this.Ohb].forEach(function(t){return t.consumed=!1})},t.prototype.dispose=function(){this.Nhb={},this.Phb=null},t}();e.FallbackSegmentTimelineController=r},30712:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.HlsDownloadErrorHandler=void 0;var n=i(40306),r=i(3336),a=i(4129),o=i(43446),s=i(29669),l=i(21513),u=i(88844),h=i(19274),d=function(){function t(t,e){var i=this;this.AP=function(){for(var t=i.qP.buffered,e="",n=0;n<t.length;n++)e+="".concat(t.start(n)," - ").concat(t.end(n),", ");e===i.xP?i.yP++:i.yP=0,i.yP>=10&&i.CP(),i.xP=e},this.BP=function(){var t=o.TimingUtil.getHiResTimestamp(),e=!i.qP.paused&&!i.qP.seeking&&!i.qP.ended;t-i.zP>5&&e&&i.EP()},this.CP=function(){i.vP=o.TimingUtil.getHiResTimestamp(),i.GP()},this.DP=function(){i.vP=-1/0,(0,u.clearTimeoutIfDefined)(i.uP)},this.EP=function(){i.tP=o.TimingUtil.getHiResTimestamp(),i.GP()},this.FP=function(){i.tP=-1/0,i.zP=o.TimingUtil.getHiResTimestamp(),(0,u.clearTimeoutIfDefined)(i.uP)},this.HP=function(){if(0!==i.qP.buffered.length){var t=i.qP.currentTime,e=i.qP.buffered.end(i.qP.buffered.length-1),o=t<=e&&t+.5>e,l=i.qP.paused,u=i.qP.networkState===HTMLMediaElement.NETWORK_LOADING,h=i.qP.videoWidth,d=i.qP.videoHeight;!l&&o&&u&&i.rP.getCurrentSegments(e,h,d,2).then(function(t){var e=new a.DefaultContentLoader(i.pP),o=function(i,n){return void 0===i&&(i=!0),t.length>0&&i?e.load(t.pop(),s.HttpRequestMethod.HEAD).then(function(t){return o(t.status>=200&&t.status<300,t)}):i?Promise.resolve():Promise.reject(n)};o().catch(function(t){var e=t.url,a=t.status,o=t.statusText;i.pP.eventHandler.fireError(new r.PlayerError(n.ErrorCode.NETWORK_ERROR,{url:e,statusCode:a,statusText:o},"Failed to load segment ".concat(e,", statusCode: ").concat(a,", statusText: ").concat(o),i.pP.sourceContext.sourceIdentifier))})})}},this.pP=t,this.qP=t.videoElement,this.rP=e,this.sP=!1,this.vP=-1/0,this.tP=-1/0,this.uP=-1,this.xP="",this.yP=0,this.zP=-1/0,this.qP.addEventListener(h.MediaElementEvent.waiting,this.EP),this.qP.addEventListener(h.MediaElementEvent.stalled,this.CP),this.qP.addEventListener(h.MediaElementEvent.progress,this.DP),this.qP.addEventListener(h.MediaElementEvent.timeupdate,this.FP),(0,l.getCapabilities)().isIOS&&(this.wP=window.setInterval(function(){i.AP(),i.BP()},500))}return t.prototype.GP=function(){var t=Math.abs(this.tP-this.vP);(0,u.clearTimeoutIfDefined)(this.uP),isFinite(t)&&(this.uP=window.setTimeout(this.HP,1e3*(5-Math.min(5,t))))},t.prototype.dispose=function(){(0,u.clearTimeoutIfDefined)(this.wP),(0,u.clearTimeoutIfDefined)(this.uP),this.qP.removeEventListener(h.MediaElementEvent.waiting,this.EP),this.qP.removeEventListener(h.MediaElementEvent.stalled,this.CP),this.qP.removeEventListener(h.MediaElementEvent.progress,this.DP),this.qP.removeEventListener(h.MediaElementEvent.timeupdate,this.FP),this.qP=null,this.rP=null},t}();e.HlsDownloadErrorHandler=d},59043:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.HlsDownloadService=void 0;var n=i(25926),r=i(4224),a=i(3714),o=i(4129),s=i(29669),l=function(){function t(t){var e=this;this.Mgb=!1,this.Sgb=function(t){e.Kgb.eventHandler.dispatchEvent(a.PlayerEvent.Warning,new n.PlayerWarning(r.WarningCode.NETWORK_COULD_NOT_LOAD_MANIFEST))},this.Kgb=t,this.Ngb()}return t.prototype.Ngb=function(){this.Ogb(),this.Pgb()},t.prototype.Ogb=function(){this.Lgb={}},t.prototype.Pgb=function(){var t=this.Kgb.sourceContext.source&&this.Kgb.sourceContext.source.options||{};this.Mgb="boolean"==typeof t.hlsManifestWithCredentials?t.hlsManifestWithCredentials:!0===t.manifestWithCredentials},t.prototype.downloadPlaylist=function(t,e,i){return void 0===i&&(i=!0),i&&this.Lgb.hasOwnProperty(t)?Promise.resolve(this.Lgb[t]):this.Qgb(e,t)},t.prototype.Qgb=function(t,e){var i=this,n=this.Rgb(t);return n.load(e,s.HttpRequestMethod.GET,s.HttpResponseType.TEXT,null,{},this.Mgb).then(function(t){return n.dispose(),i.Lgb[e]=t,t}).catch(function(t){return n.dispose(),Promise.reject(t)})},t.prototype.Rgb=function(t){return new o.DefaultContentLoader(this.Kgb,{onFailure:this.Sgb,maxRetries:this.Kgb.settings.MAX_MPD_RETRIES,requestType:t})},t.prototype.dispose=function(){},t}();e.HlsDownloadService=l},81152:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.HlsLiveNativeTimeTracker=void 0;var n=i(9768),r=i(89927),a=i(88844),o=i(19274),s=function(){function t(t,e){this.nativePlayer=t,this.context=e,this.IP=0,this.JP=null,this.KP=null,this.LP=!1}return t.prototype.onUnload=function(t){if(t!==n.ADVERTISING_ISSUER_NAME)return t===n.ADVERTISING_RESTORE_ISSUER_NAME?void(this.LP=null!=this.JP):void(null!=this.JP&&this.MP());if(null!=this.JP){if(!this.LP)return;this.MP()}this.nativePlayer.isLive()?(this.JP=Date.now(),this.IP=this.nativePlayer.getSeekableRange().start,this.KP=this.nativePlayer.getStartDate()):this.MP()},t.prototype.MP=function(){this.JP=null,this.IP=0,this.KP=null,this.LP=!1},t.prototype.adjustTargetTime=function(t,e){var i=this;return e!==n.ADVERTISING_RESTORE_ISSUER_NAME||null==this.JP?Promise.resolve(t):(null!=this.KP?this.NP():Promise.resolve(null)).then(function(e){if(null!=e)return i.MP(),t;var n=(0,r.toSeconds)(Date.now()-i.JP);i.IP+=n;var a=t-i.IP;return i.MP(),a})},t.prototype.NP=function(){var t=this,e=this.OP();if(e)return Promise.resolve(e);var i=this.context.videoElement;return new Promise(function(e){var n=void 0,r=void 0,s=function(s){var u=t.OP();e(u),null==i||i.removeEventListener(o.MediaElementEvent.error,l),(0,a.clearIntervalIfDefined)(n),(0,a.clearTimeoutIfDefined)(r)},l=function(){return s()};null==i||i.addEventListener(o.MediaElementEvent.error,l),n=window.setInterval(function(){null!=t.OP()&&s()},250),r=window.setTimeout(function(){return s()},5e3)})},t.prototype.OP=function(){var t=this.nativePlayer.getStartDate();return t&&!isNaN(t.getTime())?t:null},t}();e.HlsLiveNativeTimeTracker=s},81929:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.createHlsManifestController=function(t){if(u(t)){var e=new(r.ModuleManager.get(a.ModuleName.ServiceWorkerClient).createServiceWorkerHlsManifestController(o.AbstractHlsManifestController))(t);return e.init().then(function(){return e}).catch(function(){return h(t)})}return h(t)},e.shouldUseServiceWorker=u;var n=i(80813),r=i(88052),a=i(62756),o=i(48297),s=i(95945),l=i(690);function u(t){var e=t.config.location&&t.config.location.serviceworker;return"serviceWorker"in navigator&&e&&r.ModuleManager.has(a.ModuleName.ServiceWorkerClient)}function h(t){var e=function(t){var e=t.sourceContext.sourceIdentifier,i=t.serviceManager.get(n.ServiceName.NativeManifestService,e);if(i)return i.isSuspended()&&i.restore(),i;var r=new l.NativeManifestService(t);return t.serviceManager.set(n.ServiceName.NativeManifestService,r,e),r}(t),i=new s.FallbackHlsManifestController(t,e);return i.init().then(function(){return i})}},77374:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.replaceManifestUrls=function(t,e,i){var n=e.split(/\r?\n/);return n.forEach(function(e,s){var l=a(e);if(l&&e.match(r)){var u=o(t,l,i);n[s]=e.replace(r,function(){return'URI="'.concat(u,'"')})}else l&&(n[s]=o(t,l,i))}),n.join("\n")},e.parseUrlFromLine=a,e.replaceUrlAndAddUriParams=o;var n=i(58313),r=/URI="([^"]+)"/;function a(t){if("#"!==t[0]&&t.trim().length>0)return t;if(t.indexOf("URI")>-1){var e=t.match(r);if(e&&e[1].indexOf("skd://")<0&&e[1].indexOf("skds://")<0)return e[1]}return null}function o(t,e,i){var r=n.URLHelper.concatBaseUrlWithPartial(t,e);return n.URLHelper.appendQueryParametersToUrl(r,i)}},27530:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.NativeModuleDefinition=void 0;var n=i(62756),r=i(925),a=i(49706);e.NativeModuleDefinition={name:n.ModuleName.EngineNative,module:{NativePlayer:r.NativePlayer,technologyChecker:new a.TechnologyChecker}},e.default=e.NativeModuleDefinition},690:function(t,e,i){var n=this&&this.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.NativeManifestService=void 0;var r,a=i(80813),o=i(3714),s=i(32703),l=i(29669),u=i(88847),h=i(79721),d=i(89927),c=i(88844),p=i(70850),f=i(88052),v=i(62756),m=i(59043),y=i(77374),E=function(t){function e(e){var i=t.call(this)||this;return i.Wab=null,i.Xab=null,i.Yab=null,i.Zab=null,i.bab=[],r=f.ModuleManager.get(v.ModuleName.HLS).PlaylistUtils,i.I9=e,i.J9=e.settings,i.K9=e.config,i.L9=new m.HlsDownloadService(e),i}return n(e,t),e.prototype.resolveMasterManifest=function(t){var e=this;return this.Wab&&this.Yab&&this.eab?Promise.resolve({masterManifest:this.Yab,firstVariantPlaylist:this.eab.playlist,resolvedMasterUrl:this.Zab}):this.L9.downloadPlaylist(t,l.HttpRequestType.MANIFEST_HLS_MASTER).then(function(t){var i,n,r;e.Zab=t.url;var a=e.fab(t,t.url);if(!e.Wab)throw new Error("Manifest parsing failed");e.Yab=a;var o=f.ModuleManager.get(v.ModuleName.HLS).NativeHlsManifestParserUtils.isVideoVariant,s=null!==(n=null===(i=e.Wab.playlists.find(function(t){return o(t,e.Wab)}))||void 0===i?void 0:i.uri)&&void 0!==n?n:null===(r=e.Wab.playlists[0])||void 0===r?void 0:r.uri;return e.aab=s,e.lab(s,!0).then(function(e){return{masterManifest:a,firstVariantPlaylist:e,resolvedMasterUrl:t.url}})})},e.prototype.getParsedManifest=function(){return this.Wab},e.prototype.getManifest=function(){return this.Xab},e.prototype.getVariantUrl=function(){return this.aab},e.prototype.getLastPlaylistData=function(){return this.eab},e.prototype.setOnPlaylistUpdated=function(t){this.dab=t,this.hab()},e.prototype.restore=function(){t.prototype.restore.call(this),this.hab()},e.prototype.dispose=function(){(0,c.clearTimeoutIfDefined)(this.cab),this.cab=void 0,this.L9.dispose(),this.Wab=null,this.Xab=null,this.Yab=null,this.Zab=null,this.aab=void 0,this.bab=[],this.dab=void 0,this.eab=void 0,this.K9=null,t.prototype.dispose.call(this)},e.prototype.fab=function(t,e){var i,n,r=f.ModuleManager.get(v.ModuleName.HLS).NativeHlsManifestParserUtils;this.Xab=null!==(i=t.body)&&void 0!==i?i:null;var a=(0,y.replaceManifestUrls)(e,null!==(n=t.body)&&void 0!==n?n:"",this.J9.QUERY_PARAMETERS);if(this.Wab=r.parsePlaylist(a),r.isValidMasterPlaylist(this.Wab))return a;if(r.isValidVariantPlaylist(this.Wab)){var o="#EXTM3U\n#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=100000\n$VARIANT$\n".replace("$VARIANT$",e);a=(0,y.replaceManifestUrls)(e,o,this.J9.QUERY_PARAMETERS),this.Xab=o,this.Wab=r.parsePlaylist(a)}else this.Wab=null;return a},e.prototype.gab=function(t){var e,i=this,n=f.ModuleManager.get(v.ModuleName.HLS).NativeHlsManifestParserUtils.parseAndPrepareVariantPlaylist(this.Wab,t,this.bab,this.K9),r=n.playlist,a=n.variant,o=n.segments,l=n.discontinuitySequences;this.bab=l;var u=null===(e=o[0])||void 0===e?void 0:e.dateTime;return u&&(r.programDateTime=p.Util.timeInSeconds(u)),(0,s.extractDateRangeMetadata)(r.dateRange,r.endList?r.programDateTime:void 0,function(t){return i.iab(t)}),this.eab={playlist:r,variant:a,segments:o},this.hab(),r},e.prototype.hab=function(){this.eab&&this.dab&&!this.isSuspended()&&this.dab(this.eab)},e.prototype.iab=function(t){var e,i={metadataType:o.MetadataType.DATERANGE,metadata:t.data,data:t.data,start:t.startTime,end:t.endTime};null===(e=this.I9.serviceManager.get(a.ServiceName.MetadataParsedService))||void 0===e||e.addMetadata(h.DEFAULT_PERIOD_ID,i)},e.prototype.jab=function(t,e){var i=this;(0,c.clearTimeoutIfDefined)(this.cab),this.cab=setTimeout(function(){return i.kab(e)},(0,d.toMilliSeconds)(t.targetDuration))},e.prototype.kab=function(t){this.lab(t,!1).catch(function(t){})},e.prototype.lab=function(t,e){var i=this;return this.L9.downloadPlaylist(t,l.HttpRequestType.MANIFEST_HLS_VARIANT,e).then(function(e){var n=i.gab(e);return r.isLive(n)&&i.jab(n,t),n})},e}(u.Suspendable);e.NativeManifestService=E},925:function(t,e,i){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},n.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.NativePlayer=void 0;var r,a=i(4524),o=i(40306),s=i(3336),l=i(25926),u=i(4224),h=i(48143),d=i(80813),c=i(56481),p=i(9768),f=i(3714),v=i(90408),m=i(4129),y=i(44468),E=i(23690),g=i(87827),T=i(21513),b=i(93204),P=i(74853),S=i(34841),k=i(85434),M=i(15487),A=i(89927),I=i(88844),C=i(58313),N=i(70850),_=i(41138),R=i(19274),O=i(88052),w=i(62756),L=i(29669),D=i(32418),U=i(99373),H=i(30712),x=i(81152),F=i(81929),V=i(56678);!function(t){t.None="none",t.Metadata="metadata",t.Auto="auto"}(r||(r={}));var B="not available",W=.75,G=function(){function t(t){var e=this;this.Ik=0,this.Nk=!1,this.Ok=null,this.Pk=!1,this.Qk=!1,this.Rk=!0,this.Sk=-1,this.Tk=!1,this.Uk=!1,this.Vk=!1,this.gl=0,this.jl=-1,this.ml=-1,this.nl=null,this.ol=p.API_ISSUER_NAME,this.pl=p.API_ISSUER_NAME,this.ql=p.API_ISSUER_NAME,this.sl=0,this.ul=-1,this.vl=0,this.wl=-1,this.xl=!1,this.Gl=0,this.Hl=[],this.Jl=new Map,this.Kl=1,this.Ml=!0,this.Nl=!1,this.Ol=!1,this.Ql=[],this.Rl=!1,this.Sl=!1,this.Ul={},this.Xl=!1,this.bl=!1,this.cl=!1,this.dl=function(t){if(e.In()){var i=t.track;e.xm(f.PlayerEvent.AudioAdded,{track:e.Jn(i)}),i.enabled&&e.Nk&&e.Wm(null,i)}},this.el=function(t){var i=t.track;e.In()&&e.xm(f.PlayerEvent.AudioRemoved,{track:e.Jn(i)}),e.Jl.delete(i)},this.fl=function(){var t,i,n=e.Ek.getViewModeFromPresentationMode();n===y.ViewMode.PictureInPicture||n===y.ViewMode.Fullscreen&&(0,T.getCapabilities)().isIOS?null===(t=e.nl)||void 0===t||t.enableNative():null===(i=e.nl)||void 0===i||i.disableNative(),e.Ck.store.dispatch((0,E.setPlayerViewMode)(n))},this.qm=function(){(0,v.maybeFireDurationChangedEvent)(e.Fl,e.getDuration(),e.Gk),e.Fl=e.getDuration(),e.Ol&&e.vm()},this.rm=function(){e.tl.stallExit(),e.xl&&e.Ok&&e.Cm(),e.Pk=!1,e.tl.transitionToPlayState(!0,e.ol)},this.sm=function(){e.tl.isStalled?(e.tl.stallExit(),e.tl.transitionToPlayingState(e.ol)):e.tl.isStopped()?e.Fm():e.tl.isPlaying()||(e.tl.transitionToPlayState(!0,e.ol),e.tl.transitionToPlayingState(e.ol))},this.wm=function(){var t;(0,I.clearTimeoutIfDefined)(e.Dl),null===(t=e.El)||void 0===t||t.dispose(),e.Nl||(0,I.clearTimeoutIfDefined)(e.Cl),e.Nl=!0,e.Xl=!1,e.Ml=!0,e.Ol=!0,e.vm()},this.xm=function(t,i,n,r){void 0===i&&(i={}),void 0===n&&(n=!1),void 0===r&&(r=!1),e.Gk&&(e.Ml||n)&&e.Gk.dispatchEvent(t,i,r)},this.ym=function(t){var i=e.Bm(),n=i.currentTime;(-1!==e.ul||n!==e.ul)&&!e.Uk&&(e.Am(n)?(Promise.resolve(e.Ek.play()).catch(function(t){}),e.Vk=!0,i.currentTime=e.vl):e.zm(i,n),e.Tk=!1,e.Il&&(e.Il.width=e.Ek.videoWidth,e.Il.height=e.Ek.videoHeight))},this.Fm=function(){e.isPlaying()||(e.Pk=!1,e.Ym(),e.tl.transitionToPlayingState(e.ol))},this.Gm=function(){e.Pk=!0},this.getCurrentTime=function(t){void 0===t&&(t=y.TimeMode.AbsoluteTime);var i=e.getStartDate();return t===y.TimeMode.AbsoluteTime&&i?N.Util.timeInSeconds(i)+e.Bm().currentTime:e.Bm().currentTime},this.getAudioQuality=this.getPlaybackAudioData,this.getVideoQuality=this.getPlaybackVideoData,this.Tn=function(){var t,i=e.Bm(),n=Math.abs(i.currentTime-e.vl),r=e.Hk.GLOBAL_DISABLE_SEEKING,a=null!==(t=e.hl)&&void 0!==t?t:i.duration;r&&(n>W||i.currentTime<a-W)?(Promise.resolve(e.Ek.play()).catch(function(t){}),e.Vk=!0,e.Ek.currentTime=e.vl):(e.vl=0,e.tl.isPlaying()&&e.tl.transitionToPausedState(!0,e.pl),e.tl.transitionToStoppedState())},this.Yn=function(){e.Un(),e.gl=0,!e.Hk.GLOBAL_DISABLE_SEEKING||e.Rl||e.Tl?(e.ul=e.Bm().currentTime,e.Tl=!1,e.tl.isSeeking()&&(e.nl&&e.nl.seek(),e.Xn())):e.Uk=!1,e.Zn()},this.an=function(){if(e.wl=-1,e.Hk.GLOBAL_DISABLE_SEEKING&&!e.Tl)e.Uk=!e.Rl,e.gl++,e.gl>1&&(e.Vk=!1);else if(!e.tl.isTimeShifting()){var t=e.Bm().currentTime;e.tl.isSeeking()?(0,T.getCapabilities)().isIOS&&e.cl&&(e.tl.transitionToSeekingIOSState(t,p.INTERNAL_ISSUER_NAME,!0,e.vl),e.ul=t):e.tl.transitionToSeekingIOSState(t,p.INTERNAL_ISSUER_NAME)}},this.en=function(){void 0===e.il&&(e.il=e.Bm().currentTime)},this.fn=function(){e.Ik++,e.Ik<e.Hk.IOS_MIN_TIMEUPDATES_AFTER_AD||(e.Gk.off(f.PlayerEvent.TimeChanged,e.fn),e.Rl=!0,e.Lm({time:e.Jk,issuer:p.API_ISSUER_NAME,force:!0}))},this.Ck=t,this.kl=!1,this.Dk=t.logger,this.Ek=t.videoElement,this.Fk=t.config,this.Gk=t.eventHandler,this.Hk=t.settings,this.Bl=null,this.Mk=this.Ek.volume,this.Yl=this.Ek.getAttribute("crossOrigin"),this.ll=-1/0,(0,D.isAirplaySupported)()&&(this.yl=new D.AppleAirplayService(this.Ek,this.Gk)),this.Zl=new x.HlsLiveNativeTimeTracker(this,t),this.Wl=[{event:R.MediaElementEvent.pause,handler:function(){e.Un(),e.Pk||e.tl.transitionToPausedState(!0,e.pl,!0)}},{event:R.MediaElementEvent.ended,handler:function(){e.Tn()}},{event:R.MediaElementEvent.play,handler:this.rm},{event:R.MediaElementEvent.canplay,handler:function(){e.tl.stallExit()}},{event:R.MediaElementEvent.seeking,handler:function(){e.Tk=!0,e.an(),e.getCurrentTime()>=e.getDuration()&&(e.Yn(),e.Tn())}},{event:R.MediaElementEvent.seeked,handler:function(){e.Yn(),e.xl&&e.Ok&&e.Cm()}},{event:R.MediaElementEvent.durationchange,handler:this.qm},{event:R.MediaElementEvent.loadeddata,handler:this.wm},{event:R.MediaElementEvent.loadedmetadata,handler:function(){e.Dl=window.setTimeout(e.wm,200)}},{event:R.MediaElementEvent.playing,handler:this.sm},{event:R.MediaElementEvent.waiting,handler:function(){e.Un(),e.tl.stallEnter()}},{event:R.MediaElementEvent.timeupdate,handler:this.ym},{event:R.MediaElementEvent.error,handler:function(t){var i;e.Nl||1!==e.Hl.length||e.type!==y.StreamType.Progressive?(e.Pl.reject(),e.Qk?e.Qk=!1:((0,I.clearTimeoutIfDefined)(e.Cl),null===(i=e.Gk)||void 0===i||i.fireError((0,v.createPlayerErrorFromMediaError)(t,e.Ck.sourceContext.sourceIdentifier,!0)))):e.mm(o.ErrorCode.SOURCE_PROGRESSIVE_STREAM_ERROR,e.Ek.getWrappedElement().src,t)}},{event:R.MediaElementEvent.webkitpresentationmodechanged,handler:this.fl},{elementSelector:function(t){return t.audioTracks},event:"addtrack",handler:this.dl},{elementSelector:function(t){return t.audioTracks},event:"removetrack",handler:this.el}]}return t.prototype.tm=function(){var t,e;return!((0,M.isWebOS)()||(0,M.isTizenOs7OrNewer)()||(0,M.isEdgeAndroid)()||(null===(e=null===(t=this.Fk)||void 0===t?void 0:t.tweaks)||void 0===e?void 0:e.prevent_video_element_preloading)||this.getDuration())},t.prototype.um=function(){var t,e;if(!this.On()||(null===(e=null===(t=this.Fk)||void 0===t?void 0:t.tweaks)||void 0===e?void 0:e.prevent_video_element_preloading)||(0,M.isWebOS)()||this.bl)return!1;var i=this.Ek.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA;return!function(t){return t.length>0&&t.end(t.length-1)!==1/0}(this.Bm().seekable)&&!i},t.prototype.vm=function(){this.tm()||this.um()||this.Pl.resolve()},t.prototype.zm=function(t,e){if(this.Vk=!1,this.hl=t.duration,e>this.hl+2)t.currentTime=this.hl-.1;else{this.tl.isSeeking()||(this.vl=e);var i=e>this.wl;this.wl=Math.max(e,this.wl),i&&this.tl.stallExit(),this.tl.isSeeking()||this.tl.isTimeShifting()||!this.isPlaying()||(null!=this.getStartDate()?this.xm(f.PlayerEvent.TimeChanged,{time:this.getCurrentTime(),relativeTime:e}):this.xm(f.PlayerEvent.TimeChanged,{time:this.getCurrentTime()}))}},t.prototype.Am=function(t){if(!this.Hk.GLOBAL_DISABLE_SEEKING||!this.Tk)return!1;var e=-1!==this.ul&&t>this.ul+W,i=Math.abs(t-this.vl);return(!this.Vk||e)&&i>W},t.prototype.Bm=function(){return this.xl&&this.Ok?this.Ok:this.Ek},t.prototype.Cm=function(){var t=Date.now();(0,A.toSeconds)(t-this.Gl)>=1/30&&(this.Ek.currentTime=this.Ok.currentTime,this.Gl=t),this.isPlaying()&&window.requestAnimationFrame(this.Cm)},t.prototype.Dm=function(){if(this.isLive()&&!this.Km()){var t=this.hn();t.end>=0&&this.Im(t.end,p.STARTUP_ISSUER_NAME)}},t.prototype.Em=function(){void 0!==this.al&&(this.Um(),this.seek(this.al,"api-play"))},t.prototype.play=function(t){return this.Rk?(this.ol=t,this.Em(),this.Dm(),this.Bm().play()):Promise.reject("Play control not permitted")},t.prototype.getStartDate=function(){if(!this.isLive())return null;var t=this.Bm().getWrappedElement(),e="function"==typeof t.getStartDate?t.getStartDate():null;return e&&!isNaN(e.getTime())?e:null},t.prototype.preload=function(){this.Bm().preload=this.am()},t.prototype.pause=function(t){this.pl=t;var e=this.Bm();this.Rk&&this.Nk&&(this.tl.transitionToPausedState(!1,this.pl),e.pause())},t.prototype.mute=function(t){this.Bm().muted||(this.Bm().muted=!0,this.xm(f.PlayerEvent.Muted,{issuer:t||p.API_ISSUER_NAME}))},t.prototype.unmute=function(t){this.Bm().muted&&(this.Bm().muted=!1,this.xm(f.PlayerEvent.Unmuted,{issuer:t||p.API_ISSUER_NAME}))},t.prototype.Hm=function(t){var e=this.getStartDate();return e?t-(0,A.toSeconds)(e.getTime()):(this.isLive(),t)},t.prototype.seek=function(t,e){var i=this,n=this.Jm(t),r=this.getCurrentTime();return!(!n||r===t)&&(this.Zl.adjustTargetTime(t,e).then(function(t){i.ql=e,i.Sm(t,e);var n=i.Hm(t);return i.Lm({time:n,issuer:e})}),this.Ol&&this.getDuration()>0)},t.prototype.Im=function(t,e){this.jl=this.getCurrentTime(),this.ql=e,this.Tm(t,e),this.Mm({time:t,issuer:e})},t.prototype.Jm=function(t){this.Tl=this.Sl&&this.Rm(t);var e=!this.Hk.GLOBAL_DISABLE_SEEKING&&this.Qm();return(this.Tl||e)&&this.Rk},t.prototype.Km=function(){var t=!(this.Fk.playback&&this.Fk.playback.hasOwnProperty("timeShift"))||Boolean(this.Fk.playback.timeShift);return this.isLive()&&t},t.prototype.Lm=function(t){return!this.Nm(t)&&(this.tl.transitionToSeekingState(t.time,t.issuer,!1),this.Om(t),!0)},t.prototype.Mm=function(t){this.Nm(t,!0)||(this.tl.transitionToTimeShiftingState(this.getCurrentTime(),t.time,t.issuer,!1),t.time<0&&(t.time=this.hn().end+t.time,this.Un()),this.Om(t))},t.prototype.Nm=function(t,e){return void 0===e&&(e=!1),this.tl.isSeeking()&&"api-play"!==t.issuer?(this.Vm(t,e,[R.MediaElementEvent.seeked]),!0):this.Ol?0===this.getDuration()?(this.Vm(t,e,[R.MediaElementEvent.durationchange]),!0):this.Ek.seekable.length<1&&(this.Vm(t,e,[R.MediaElementEvent.timeupdate,R.MediaElementEvent.canplay]),!0):(this.Vm(t,e,[R.MediaElementEvent.loadeddata]),!0)},t.prototype.Om=function(t){var e=t.issuer===p.ADVERTISING_ISSUER_NAME,i=this.hn(),n=this.Pm(t.time,i,e);this.Sl=!1,this.Vk=this.Vk||this.Tl||t.force;var r=parseFloat(n.toFixed(2));this.ml=r,this.Bm().currentTime=r},t.prototype.Pm=function(t,e,i){void 0===i&&(i=!1);var n=j(t,e);return i?t>=e.end&&(n=e.end-.1):this.isLive()||(n=Math.min(n,e.end-this.Hk.SEEK_TO_END_OFFSET)),n},t.prototype.Qm=function(){var t=this.Fk&&this.Fk.hasOwnProperty("playback")?this.Fk.playback:{};return!t.hasOwnProperty("seeking")||t.seeking},t.prototype.Rm=function(t){var e=this.Ck.sourceContext.source?this.Ck.sourceContext.source:{};return e.hasOwnProperty("options")&&e.options.hasOwnProperty("startTime")&&t===e.options.startTime},t.prototype.Sm=function(t,e){e!==p.STARTUP_ISSUER_NAME&&this.xm(f.PlayerEvent.Seek,{position:this.getCurrentTime(),seekTarget:t,issuer:e||p.API_ISSUER_NAME})},t.prototype.Tm=function(t,e){e!==p.STARTUP_ISSUER_NAME&&this.xm(f.PlayerEvent.TimeShift,{target:t<0?this.jl+t:t,position:this.jl,issuer:e||p.API_ISSUER_NAME})},t.prototype.Um=function(){var t=this;Object.keys(this.Ul).forEach(function(e){t.Bm().removeEventListener(e,t.Ul[e])}),this.Ul={}},t.prototype.Vm=function(t,e,i){var n=this,r=this.Bm();this.Um(),this.al=t.time;var a=function(){var i;if(n.Um(),e&&t.time>=0){var r=n.hn().end;i=r>0?r:t.time}else i=t.time;var a={time:i,issuer:t.issuer,force:t.force};n.al=void 0,e?n.Mm(a):n.Lm(a)};i.forEach(function(t){r.addEventListener(t,a),n.Ul[t]=a})},t.prototype.setAudio=function(t){var e=this,i=P.ArrayHelper.toArray(this.Ek.audioTracks).find(function(i){return e.Kn(i)===t});i&&this.Xm(i)},t.prototype.Wm=function(t,e){this.xm(f.PlayerEvent.AudioChanged,{targetAudio:this.Jn(e),sourceAudio:t,time:this.Ek.currentTime})},t.prototype.Xm=function(t){if(!t.enabled){var e=P.ArrayHelper.toArray(this.Ek.audioTracks).find(function(t){return t.enabled}),i=null;e&&(e.enabled=!1,i=this.Jn(e)),t.enabled=!0,this.Wm(i,t)}},t.prototype.setVolume=function(t,e){var i=this.Bm(),n=this.Mk,r=Math.min(t/100,1);n!==r&&(this.Mk=r,i.volume=r,this.xm(f.PlayerEvent.VolumeChanged,{targetVolume:100*r,sourceVolume:100*n,issuer:e||p.API_ISSUER_NAME}))},t.prototype.Ym=function(){var t=this;(0,I.clearTimeoutIfDefined)(this.Cl),this.Nl||(this.Cl=window.setTimeout(function(){t.Cl=void 0,!t.Nl&&t.Gk&&(t.type===y.StreamType.Hls?t.Gk.fireError(new s.PlayerError(o.ErrorCode.NETWORK_MANIFEST_DOWNLOAD_TIMEOUT,{sourceUrl:t.Ll.url},"Failed to load the HLS playlist: the request timed out.",t.Ck.sourceContext.sourceIdentifier)):t.type===y.StreamType.Progressive&&t.Gk.fireError(new s.PlayerError(o.ErrorCode.NETWORK_PROGRESSIVE_STREAM_DOWNLOAD_TIMEOUT,{sourceUrl:t.Ll.url},"Failed to load the progressive source: the request timed out.",t.Ck.sourceContext.sourceIdentifier)))},(0,A.toMilliSeconds)(this.Hk.XHR_TIMEOUT/2)))},t.getContentDomain=function(t){var e=document.createElement("a");return e.href=t,""===e.host&&(e.href=e.href),e.hostname},t.prototype.Zm=function(t){var e;(0,M.isTizen)()&&(null===(e=this.El)||void 0===e||e.dispose(),this.El=new U.AssetAvailabilityChecker(this.Ck,t,this.Ek))},t.prototype.prepareLoad=function(){return Promise.resolve()},t.prototype.prepareSource=function(t,e){return Promise.resolve()},t.prototype.am=function(){var t,e,i,n;return(null===(e=null===(t=this.Fk)||void 0===t?void 0:t.tweaks)||void 0===e?void 0:e.prevent_video_element_preloading)?r.None:!1===(null===(n=null===(i=this.Fk)||void 0===i?void 0:i.adaptation)||void 0===n?void 0:n.preload)?r.Metadata:r.Auto},t.prototype.load=function(e,i,n){var a,o=this,s=null!==(a=null==i?void 0:i.seeking)&&void 0!==a&&a;this.tl=this.Ck.serviceManager.get(d.ServiceName.PlayerStateService),this.tl.transitionToSeekedState(!1);var l=this.am();l!==r.Auto&&this.Ek.setAttribute("preload",l),this.type=this.Ck.sourceContext.technology.streaming,this.Ll=e,e.type&&(this.type=e.type),!0===this.Nk&&this.unload().catch(function(){}),this.Nl=!1,this.Ol=!1,this.Bm().nativeMediaEventListener.reset(),this.Sl=!0,this.Qk=!1,this.sl=0,this.al=void 0,this.bl=!1,this.Kl=1,this.Jl=new Map,e.hasOwnProperty("vr")&&e.vr&&Boolean(e.vr.restrictedInlinePlayback)?(this.xl=!0,this.Ok=N.Util.getVRAudioElement(),this.bn(this.Ok)):(this.Ok=null,this.xl=!1,this.bn(this.Ek)),this.Gk.on(f.PlayerEvent.TimeChanged,this.en),this.Vl=(0,b.subscribe)(this.Ck.store)(function(t){return(0,g.getIsStopped)((0,g.getPlayerState)(t))},this.Gm,function(t){return!0===t}),this.Hk.GLOBAL_DISABLE_SEEKING=s||!1,this.Sk>-1&&((0,I.clearTimeoutIfDefined)(this.Sk),this.Sk=-1);var u="";e&&e.url&&("string"==typeof e.url?u=e.url:e.url.length>0&&(u=e.url[0].url));var h=window.location.hostname===t.getContentDomain(u);e.hasOwnProperty("vr")&&Boolean(e.vr)&&!h&&(this.Yl=this.Ek.getAttribute("crossOrigin"),this.Ek.setAttribute("crossOrigin","anonymous")),this.Ek.eventHandler.reset(),this.Xl||(this.nl=this.dn()),this.Pl=new S.Deferred;var c=this.cm(e,n);return this.Pl.promise.then(function(){o.Ck.sourceContext.source=e.config}).then(function(){return c}).then(function(){return o.dm(e)})},t.prototype.bm=function(t){var e=this;(0,M.isSafari17orIOS17)()&&fetch(t.url,{method:L.HttpRequestMethod.GET,headers:{Range:"bytes=0-0"}}).then(function(t){t.redirected&&(e.Ol&&e.Pl.resolve(),e.bl=!0)}).catch(function(){})},t.prototype.cm=function(t,e){var i=this;return this.type===y.StreamType.Hls?(this.bm(t),this.jm(t)):this.type===y.StreamType.Progressive?this.km(t,e).then(function(){return i.em()}):Promise.resolve()},t.prototype.dm=function(t){this.rl=t,this.Nk=!0,this.vl=0,this.wl=-1,this.Vk=!1},t.prototype.em=function(){var t,e;(null===(e=null===(t=this.Fk)||void 0===t?void 0:t.tweaks)||void 0===e?void 0:e.prevent_video_element_preloading)?this.vm():this.Ek.load()},t.prototype.fm=function(e,i){var n=this;if(e.config.drm&&e.config.drm.fairplay){var r=O.ModuleManager.get(w.ModuleName.DRM).FairplayHandler;this.zl=new r(this.Ck,this.Ek,e.config.drm.fairplay)}var a=t.createSourceElement(i,null);this.pm(a,"0",e),this.Zm(a);var s={element:a,handler:function(t){return n.mm(o.ErrorCode.SOURCE_HLS_STREAM_ERROR,a.src,t)}};this.Ql.push(s),s.element.addEventListener(R.MediaElementEvent.error,s.handler)},t.prototype.gm=function(t,e){this.fm(t,e),this.em()},t.prototype.hm=function(t,e){var i,n,r=C.URLHelper.appendQueryParametersToUrl(e,{"bitmovin-player-id":this.Ck.internalPlayerID});this.gm(t,r);var a=this.Al.resolveMasterManifest(t.url).then(function(){}).catch(function(t){});return(null===(n=null===(i=this.Fk)||void 0===i?void 0:i.tweaks)||void 0===n?void 0:n.prevent_video_element_preloading)?Promise.resolve():a},t.prototype.im=function(t,e){var i=this;return F.createHlsManifestController(this.Ck).then(function(n){return i.Al=n,i.Hk.NATIVE_HLS_DOWNLOAD_ERROR_HANDLING&&(i.Bl=new H.HlsDownloadErrorHandler(i.Ck,n)),F.shouldUseServiceWorker(i.Ck)?i.hm(t,e):i.Al.resolveMasterManifest(t.url).then(function(e){0!==e.indexOf("data")&&0!==e.indexOf("blob")||i.gm(t,e)}).catch(function(t){})})},t.prototype.jm=function(t){var e;if("string"!=typeof t.url){var i=new s.PlayerError(o.ErrorCode.SOURCE_INVALID,{given:t.url},"Cannot load the HLS playlist: the source URL should be a string.",this.Ck.sourceContext.sourceIdentifier);return null===(e=this.Gk)||void 0===e||e.fireError(i),this.Pl.reject(i),Promise.resolve()}var n=this.adjustToFullUrlWithQueryParams(t.url);return this.Hk.NATIVE_HLS_PARSING?this.im(t,n):(this.gm(t,n),Promise.resolve())},t.prototype.km=function(t,e){if(this.Hl=[],Array.isArray(t.url))this.lm(t.url,e);else{var i={url:t.url,bitrate:0};this.Ek.src=this.adjustToFullUrlWithQueryParams(i.url),this.Bn("0",i),this.Cn("0",i),this.Zm(this.Ek.getWrappedElement())}return Promise.resolve()},t.prototype.lm=function(t,e){var i=this;e=e||function(t){var e=t.findIndex(function(t){return!0===t.preferred});return e>-1?String(e):"0"}(t);var n=this.nm(t,e,!0);if(n){var r={element:n,handler:function(t){return i.mm(o.ErrorCode.SOURCE_PROGRESSIVE_STREAM_ERROR,n.src,t)}};this.Ql.push(r),r.element.addEventListener(R.MediaElementEvent.error,r.handler),this.xl&&this.Ok&&this.Ok.load(),this.Zm(n)}},t.prototype.mm=function(t,e,i){var n,r=this;(0,I.clearTimeoutIfDefined)(this.Cl),null===(n=this.El)||void 0===n||n.dispose(),this.Nk=!0,new m.DefaultContentLoader(this.Ck).load(e).then(function(t){return{status:t.status,statusText:t.statusText,error:void 0}}).catch(function(t){return{error:t,status:(null==t?void 0:t.status)||0,statusText:(null==t?void 0:t.statusText)||""}}).then(function(n){var a,o=n.error,l=n.status,u=n.statusText,h=(null==i?void 0:i.message)||i,d=function(t,e){r.Pl.reject(new s.PlayerError(t,e,"The video element has thrown an error while loading the stream.",r.Ck.sourceContext.sourceIdentifier))};200!==l?d(t,a={event:i,error:o,status:l,statusText:u,src:e,extraMessage:h}):(a={event:i,error:o,src:e,extraMessage:h},r.Ll&&r.sl<r.Hk.MAX_RETRIES?(r.sl++,r.cm(r.Ll).catch(function(){return d(t,a)})):d(t,a))})},t.prototype.nm=function(e,i,n){for(var r,a=[],o=-1,s=null,l=null,u=0;u<e.length;u++){var h=e[u];if(!this.om(h,l,n)){if(r=t.createSourceElement(this.adjustToFullUrlWithQueryParams(h.url),h.type),l=l||h.type,this.Bn(String(u),h),n){if(a.indexOf(h.type)>-1)continue;i===String(u)?(s=r,o=h.bitrate,this.pm(r,String(u),h),a.push(h.type)):o===h.bitrate&&(s=r,this.An(r),a.push(h.type))}else s=r,this.pm(r,String(u),h);this.xl&&this.Ok&&(this.Ok.innerHTML=this.Ek.innerHTML)}}return s},t.prototype.om=function(e,i,n){return!t.isValidProgressiveSourceObject(e)||!!n&&(!this.Dn(e.type)||!!i&&i!==e.type)},t.isValidProgressiveSourceObject=function(t){return"object"==typeof t&&t&&t.url&&""!==t.url},t.prototype.pm=function(t,e,i){this.Ek.appendChild(t),this.Cn(e,i)},t.prototype.An=function(t){this.Ek.appendChild(t)},t.prototype.Bn=function(t,e){var i={id:t};e.bitrate&&(i.bitrate=e.bitrate),i.label=String(e.label||e.bitrate||"unknown"),this.Hl.push(i)},t.prototype.Cn=function(t,e){this.Il={id:t},e.bitrate&&(this.Il.bitrate=e.bitrate),this.Il.label=""+(e.label||e.bitrate||"unknown")},t.prototype.Dn=function(t){return!(this.Ek.canPlayType(t).length<=0)},t.createSourceElement=function(t,e){var i=document.createElement("source");return i.src=t,e&&(e.indexOf("/")<0&&(e="video/"+e),i.type=e),i},t.prototype.unload=function(t,e){var i,n;return void 0===t&&(t=p.API_ISSUER_NAME),void 0===e&&(e=!1),this.Zl.onUnload(t),this.Um(),this.Pl&&!e&&this.Pl.reject(),(0,I.clearTimeoutIfDefined)(this.Dl),(0,I.clearTimeoutIfDefined)(this.Cl),null===(i=this.El)||void 0===i||i.dispose(),this.Pk=!1,this.wl=-1,this.zl=(0,c.dispose)(this.zl),this.Bl=(0,c.dispose)(this.Bl),this.Al=(0,c.dispose)(this.Al),this.En(t),this.Xl||(null===(n=this.nl)||void 0===n||n.signalSourceChange(),this.nl=(0,c.dispose)(this.nl)),this.Hn(),this.Fn(),this.pause(),this.Qk=!0,this.Gn(),this.Jl.clear(),this.Vl&&this.Vl(),this.Ml&&(this.Il=null),this.Nk&&(this.Nk=!1,e||(this.xm(f.PlayerEvent.SourceUnloaded,{oldSource:this.rl}),this.Fl=null)),Promise.resolve()},t.prototype.En=function(t){var e,i,n,r=null===(e=this.Ck.sourceContext)||void 0===e?void 0:e.sourceIdentifier;if(r){var a=this.Ck.serviceManager,o=!(null===(i=this.Ck.sourceContext)||void 0===i?void 0:i.isAd);t===p.ADVERTISING_ISSUER_NAME&&o?null===(n=a.get(d.ServiceName.NativeManifestService,r))||void 0===n||n.suspend():(0,h.disposeService)(a,d.ServiceName.NativeManifestService,r)}},t.prototype.Fn=function(){if(this.xl&&this.Ok){for(this.Ok.removeAttribute("src");this.Ok.firstChild;)this.Ok.removeChild(this.Ok.firstChild);this.Ok.load()}},t.prototype.Gn=function(){this.xl?this.Ok&&this.cn(this.Ok):this.cn(this.Ek),this.Um(),this.Gk.off(f.PlayerEvent.TimeChanged,this.en),this.Gk.off(f.PlayerEvent.TimeChanged,this.fn),this.Ql.forEach(function(t){try{t.element.removeEventListener(R.MediaElementEvent.error,t.handler)}catch(t){}})},t.prototype.Hn=function(){_.VideoElementUtil.removeSource(this.Ek),null!=this.Yl?this.Ek.setAttribute("crossOrigin",this.Yl):this.Ek.removeAttribute("crossOrigin"),this.Ek.load()},t.prototype.In=function(){return this.xl&&this.Ok&&"readyState"in this.Ok?this.Ok.readyState!==HTMLMediaElement.HAVE_NOTHING:!("readyState"in this.Ek)||this.Ek.readyState!==HTMLMediaElement.HAVE_NOTHING},t.prototype.isLive=function(){return this.Bm().duration===1/0},t.prototype.isPlaying=function(){return this.tl.isPlaying()},t.prototype.isPaused=function(){return this.tl.isPaused()},t.prototype.hasEnded=function(){return this.Pk},t.prototype.isMuted=function(){return this.Bm().muted},t.prototype.isStalled=function(){return this.tl.isStalled},t.prototype.getVolume=function(){return 100*this.Bm().volume},t.prototype.getDuration=function(){return this.Bm().duration},t.prototype.Jn=function(t){var e={id:this.Kn(t),label:t.label,lang:t.language,getQualities:null},i=this.Ln(e);return i&&"string"==typeof i&&(e.label=i),e},t.prototype.getAudio=function(){var t=P.ArrayHelper.toArray(this.Ek.audioTracks).findIndex(function(t){return t.enabled});return-1===t?null:this.getAvailableAudio()[t]},t.prototype.getAvailableAudio=function(){var t=this;return P.ArrayHelper.toArray(this.Ek.audioTracks).map(function(e){return t.Jn(e)})},t.prototype.Kn=function(t){return this.Jl.has(t)||this.Jl.set(t,String(this.Kl++)),this.Jl.get(t)},t.prototype.Ln=function(t){var e={id:t.id,lang:t.lang,mimeType:k.MimeType.AudioMp4};return this.Mn()(e)},t.prototype.Mn=function(){var e=this.Ck.sourceContext,i=e&&e.source&&e.source.labeling;return i&&i[this.type]&&i[this.type].tracks?"function"!=typeof i[this.type].tracks?t.getDefaultLabelForAudio:i[this.type].tracks:t.getDefaultLabelForAudio},t.getDefaultLabelForAudio=function(){return null},t.prototype.getDownloadedVideoData=function(){return this.type===y.StreamType.Progressive?this.Il:this.Al?this.Al.getDownloadedVideoData():{id:B,bitrate:0,height:0,width:0,isAuto:!0}},t.prototype.getDownloadedAudioData=function(){return{id:B,bitrate:0,isAuto:this.type===y.StreamType.Progressive}},t.prototype.Nn=function(t){var e={};return e.id=t.id,e.label=t.label,t.width>1?e.width=t.width:this.Il&&this.Il.id===t.id&&(this.Il.width>1?e.width=this.Il.width:!isNaN(this.Ek.videoWidth)&&this.Ek.videoWidth>1&&(e.width=this.Ek.videoWidth)),t.height>1?e.height=t.height:this.Il&&this.Il.id===t.id&&(this.Il.height>1?e.height=this.Il.height:!isNaN(this.Ek.videoHeight)&&this.Ek.videoHeight>1&&(e.height=this.Ek.videoHeight)),void 0!==t.bitrate&&"unknown"!==t.bitrate&&(e.bitrate=t.bitrate),e},t.prototype.getPlaybackVideoData=function(){if(this.Al){var t=this.Al.getPlayingVideoData();if(t)return t}if(this.Il){var e=this.Nn(this.Il);return"progressive"!==this.type&&(e.id=B),e}return{id:B,bitrate:0,height:this.Ek.videoHeight,width:this.Ek.videoWidth}},t.prototype.getPlaybackAudioData=function(){return{id:B,bitrate:0}},t.prototype.getMaxTimeShift=function(){if(!this.Km())return 0;var t=this.hn();return this.On()&&t.start>=0?t.start-t.end:0},t.prototype.On=function(){return this.type===y.StreamType.Hls&&this.isLive()},t.prototype.timeShift=function(t,e){if(this.Km()&&this.Pn(t,e))if(0===t){var i=this.hn();i.end>=0&&this.Im(i.end)}else this.Im(t,e)},t.prototype.Pn=function(t,e){if(e===p.STARTUP_ISSUER_NAME&&!function(t){return null!=(null==t?void 0:t.startTime)||null!=(null==t?void 0:t.startOffset)}(this.Ck.sourceContext.source.options))return!1;var i=Math.abs(Math.abs(t)-Math.abs(this.getTimeShift())),n=this.Vn(t);return i>.25&&!(this.kl&&n)},t.prototype.getTimeShift=function(){if(this.Qn())return 0;var t=this.hn();if(t.start>=0&&this.Sn()){var e=j(this.Bm().currentTime-t.end,this.gn());this.kl=this.Vn(e)&&!this.Rn(),this.ll=this.kl?0:e}return isFinite(this.ll)?this.ll:0},t.prototype.Qn=function(){return!this.isLive()||!this.tl.hasBeenPlaying&&!this.tl.seekedOrTimeshifted||this.kl},t.prototype.Rn=function(){return this.isStalled()||this.isPaused()},t.prototype.Sn=function(){return!isFinite(this.ll)||this.Rn()},t.prototype.getManifest=function(){return this.Al?this.Al.getManifest():null},t.prototype.getSnapshot=function(t,e){if(this.isPlaying()||this.isPaused()){var i=this.Ek.videoWidth,n=this.Ek.videoHeight;if(this.Kk||(this.Kk=document.createElement("canvas"),this.Kk.id="snapshotHiddenCanvas"),!this.Kk||!this.Kk.getContext||!this.Kk.getContext("2d"))return;this.Kk.height=n,this.Kk.width=i,this.Lk=this.Kk.getContext("2d"),this.Lk.drawImage(this.Ek.getWrappedElement(),0,0,i,n);var r=void 0;try{"image/jpeg"===t||"image/webp"===t?(Number(e)===e?(e<0||e>1)&&(e=1):e=1,r=this.Kk.toDataURL(t,e)):r=this.Kk.toDataURL(t,e)}catch(t){return void(t&&t.message)}return{height:n,width:i,data:r}}},t.prototype.setPlaybackSpeed=function(t){this.Bm().playbackRate=t},t.prototype.getPlaybackSpeed=function(){return this.Bm().playbackRate},t.prototype.permitControl=function(t){this.Rk=t},t.prototype.Un=function(){this.ll=-1/0,this.Km()&&(this.kl=!1)},t.prototype.Vn=function(t){return Math.abs(t)<2*this.Hk.SEEK_TO_END_OFFSET},t.prototype.Wn=function(){return this.ml!==this.ul&&this.ql===p.STARTUP_ISSUER_NAME},t.prototype.Xn=function(){this.Wn()&&(this.Sm(this.ml),this.ql=p.API_ISSUER_NAME,this.ml=-1)},t.prototype.Zn=function(){this.tl.isSeeking()&&(this.tl.transitionToSeekedState(this.ql!==p.STARTUP_ISSUER_NAME),this.ql=p.API_ISSUER_NAME),this.tl.isTimeShifting()&&this.tl.transitionToTimeShiftedState(this.ql!==p.STARTUP_ISSUER_NAME)},t.prototype.bn=function(t){for(var e=0;e<this.Wl.length;e++){var i=this.Wl[e].elementSelector?this.Wl[e].elementSelector(t):t;i&&i.addEventListener(this.Wl[e].event,this.Wl[e].handler)}},t.prototype.cn=function(t){for(var e=0;e<this.Wl.length;e++){var i=this.Wl[e].elementSelector?this.Wl[e].elementSelector(t):t;i&&i.removeEventListener&&i.removeEventListener(this.Wl[e].event,this.Wl[e].handler)}},t.prototype.getBufferLevel=function(t){var e={level:null,targetLevel:null,type:t,media:y.MediaType.Video},i=this.Bm();if(!i.buffered||i.buffered.length<1)return e;var n=function(n){for(var r=0;r<i.buffered.length;r++){var a=i.buffered.start(r),o=i.buffered.end(r);a>n||o<=n||(e.level=o-n,t===y.BufferType.BackwardDuration&&(e.level=n-a))}},r=i.currentTime;if(n(r),null==e.level){var a=function(t,e){for(var i=t.buffered.start(0),n=Math.abs(i-e),r=1;r<t.buffered.length;r++){var a=Math.abs(t.buffered.start(r)-e);a<n&&(n=a,i=t.buffered.start(r))}return{distanceToCurrentTime:n,closestBufferStart:i}}(i,r),o=a.distanceToCurrentTime,s=a.closestBufferStart;o<1&&n(s)}return e},t.prototype.dn=function(){if(O.ModuleManager.has(w.ModuleName.SubtitlesNative))return new(0,O.ModuleManager.get(w.ModuleName.SubtitlesNative).TextTrackController)(this.Ck,this.Ek,this.Fk,this.type)},t.prototype.removeSubtitle=function(t){t&&this.nl&&this.nl.removeSubtitle(t)},t.prototype.addSubtitle=function(t){return this.nl?(this.removeSubtitle(t.id),t.kind="subtitles",this.nl.addSubtitle(t)):Promise.reject()},t.prototype.listSubtitles=function(){return this.nl?this.nl.getAvailableSubtitles():[]},t.prototype.enableSubtitle=function(t){return this.nl?this.nl.enableSubtitle(t):Promise.resolve(!1)},t.prototype.disableSubtitle=function(t){return this.nl?Promise.resolve(this.nl.disableSubtitle(t)):Promise.resolve(!1)},t.prototype.adjustToFullUrlWithQueryParams=function(t){var e=C.URLHelper.toFullUrl(t);return C.URLHelper.appendQueryParametersToUrl(e,this.Hk.QUERY_PARAMETERS)},t.prototype.onFullscreenEnter=function(){this.cl=this.Ek.webkitDisplayingFullscreen,this.nl&&this.cl&&this.nl.enableNative()},t.prototype.onFullscreenExit=function(){this.nl&&this.cl&&this.nl.disableNative(),this.cl=!1},t.prototype.getAvailableVideoQualities=function(){var t=this;return"progressive"!==this.type?[]:this.Hl.map(function(e){return t.Nn(e)})},t.prototype.getBufferedRanges=function(){var t=this;return(0,a.getBufferedRanges)(this.Bm()).map(function(e){return(0,a.convertRangeToTimeMode)(e,t.getStartDate(),y.TimeMode.AbsoluteTime)})},t.prototype.setVideoQuality=function(t){var e,i=this,r=this.getPlaybackSpeed(),a=this.Hl.find(function(e){return e.id===t});if("progressive"===this.type&&a&&(!this.Il||this.Il.id!==t)){this.Xl=!0,this.Jk=this.getCurrentTime(),this.Hl=[],this.Ml=!1;var o=this.tl.isPlaying()||this.tl.isPlay();this.tl.stallEnter(),this.unload(p.API_ISSUER_NAME,!0).catch(function(){});var s=this.Nn(a),h={sourceQuality:this.Il,sourceQualityId:this.Il?this.Il.id:null,targetQuality:s,targetQualityId:s.id};this.Gk.one(f.PlayerEvent.StallEnded,function(){i.Ml=!0,(0,T.getCapabilities)().isIOS||(0,T.getCapabilities)().isSafari?(i.Ik=0,i.Gk.on(f.PlayerEvent.TimeChanged,i.fn)):(i.Ik=1/0,i.fn()),o&&(i.play(p.INTERNAL_ISSUER_NAME).catch(function(){i.xm(f.PlayerEvent.Warning,new l.PlayerWarning(u.WarningCode.PLAYBACK_COULD_NOT_BE_STARTED))}),i.tl.transitionToPlayingState(p.INTERNAL_ISSUER_NAME,!1))}),this.xm(f.PlayerEvent.VideoQualityChanged,n({},h),!0),null===(e=this.yl)||void 0===e||e.initAirplay(),this.load(this.Ll,{seeking:this.Hk.GLOBAL_DISABLE_SEEKING},t).then(function(){i.setPlaybackSpeed(r),i.xm(f.PlayerEvent.VideoDownloadQualityChange,n({},h),!0),i.xm(f.PlayerEvent.VideoDownloadQualityChanged,n({},h),!0),i.xm(f.PlayerEvent.VideoPlaybackQualityChanged,{sourceQuality:h.sourceQuality,targetQuality:h.targetQuality},!0)})}},t.prototype.isAirplayAvailable=function(){var t,e;return null!==(e=null===(t=this.yl)||void 0===t?void 0:t.isAirplayAvailable())&&void 0!==e&&e},t.prototype.isAirplayActive=function(){var t,e;return null!==(e=null===(t=this.yl)||void 0===t?void 0:t.isAirplayActive())&&void 0!==e&&e},t.prototype.showAirplayTargetPicker=function(){var t;null===(t=this.yl)||void 0===t||t.showAirplayTargetPicker()},t.prototype.gn=function(){return this.isLive()?{start:this.getMaxTimeShift(),end:0}:{start:-1,end:-1}},t.prototype.hn=function(){var t=this.Ek.seekable;if(t.length>0){var e={start:t.start(0),end:t.end(0)};return e.start=Math.max(0,e.start),e}return{start:-1,end:-1}},t.prototype.getSeekableRange=function(){if(!this.isLive()||this.Hk.ENABLE_SEEK_FOR_LIVE){var t=this.getStartDate(),e=this.hn();return t?(0,a.convertRangeToTimeMode)(e,t,y.TimeMode.AbsoluteTime):e}return{start:-1,end:-1}},t.prototype.createManifestApi=function(){return this.Al?V.NativePlayerManifestApiFactory.create(this.Al):null},t.prototype.release=function(){var t,e=this,i=this.unload(p.API_ISSUER_NAME).catch(function(){});return(0,I.clearTimeoutIfDefined)(this.Cl),i=i.then(function(){e.type=null,e.Fk=null,e.Gk=null,e.Hk=null,e.Jk=null,e.Kk=null,e.Lk=null,e.Ok=null,e.Ek=null,e.ol=null,e.pl=null,e.ql=null,e.rl=null,e.Ll=null,e.Il=null,e.Hl=null,e.Ql=null,e.al=void 0}),null===(t=this.yl)||void 0===t||t.dispose(),this.nl&&this.nl.dispose(),this.nl=null,this.zl&&this.zl.dispose(),this.zl=null,this.Bl&&this.Bl.dispose(),this.Bl=null,this.Al&&this.Al.dispose(),this.Al=null,i},t.prototype.setQueryParameters=function(t){this.Hk.QUERY_PARAMETERS=t},t.prototype.clearQueryParameters=function(){this.Hk.QUERY_PARAMETERS=void 0},t.prototype.setAudioQuality=function(t){},t.prototype.setTargetBufferLevel=function(){},t.prototype.getAvailableAudioQualities=function(){return[]},t.prototype.getDroppedVideoFrames=function(){return 0},t.prototype.getTotalStalledTime=function(){return 0},t.prototype.updateCallback=function(t){},t.prototype.getAvailableSegments=function(){return{}},t.prototype.getLatency=function(){var t=this.Ek.getWrappedElement();if(!t.getStartDate)return 1/0;var e=t.getStartDate().getTime();if(isNaN(e))return 1/0;var i=(new Date).getTime();return(0,A.toSeconds)(i-e)-this.Ek.currentTime},t.prototype.setTargetLatency=function(t){},t.prototype.getTargetLatency=function(){},t.prototype.setCatchupConfig=function(t){},t.prototype.getCatchupConfig=function(){},t.prototype.setFallbackConfig=function(t){},t.prototype.getFallbackConfig=function(){},t}();function j(t,e){return(t<e.start||t>e.end)&&(t=Math.max(t,e.start),t=Math.min(t,e.end)),t}e.NativePlayer=G},56678:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.NativePlayerManifestApiFactory=void 0;var n=i(34047),r=i(21216),a=function(){function t(){}return t.create=function(e){var i=e.getParsedManifest();return e.isValidMasterPlaylist(i)?new(function(){return function(){this.hls=t.createHlsApi(e)}}()):null},t.createHlsApi=function(e){var i=e.getParsedManifest(),n=i.media.filter(function(t){return"AUDIO"===t.attributes.TYPE}),r=i.media.filter(function(t){return"SUBTITLES"===t.attributes.TYPE||"CLOSED-CAPTIONS"===t.attributes.TYPE});return new(function(){function a(){this.properties=e.getParsedManifest().tags}return a.prototype.getVideoTracks=function(){return t.getVideoTracks(i.playlists)},a.prototype.getAudioTracks=function(){return t.getAudioTracks(n,i.playlists)},a.prototype.getTextTracks=function(){return t.getTextTracks(r)},a}())},t.getAudioTracks=function(t,e){var i=t.reduce(function(t,e){return t[e.attributes.LANGUAGE]||(t[e.attributes.LANGUAGE]=e.attributes.NAME),t},{}),r=Object.keys(i).map(function(e,n){return{id:"audio-".concat(n),label:i[e],lang:e,getQualities:function(){return t.filter(function(t){return t.attributes.LANGUAGE===e}).map(function(t,e){return{id:e+"",bitrate:0,label:t.attributes.NAME}})}}}),a=function(t){return t.attributes.CODECS&&n.CodecStringHelper.getMimeTypeForCodecString(t.attributes.CODECS).includes("audio")};return e.some(a)&&r.push({id:"audio-".concat(r.length),label:"und",lang:"",getQualities:function(){return e.filter(a).map(function(t,e){return{id:e+"",bitrate:t.attributes.BANDWIDTH,codec:n.CodecStringHelper.getExtractedCodecStrings(t.attributes.CODECS).audio}})}}),r},t.getVideoTracks=function(e){var i=e.filter(function(t){return!t.attributes.CODECS||n.CodecStringHelper.getMimeTypeForCodecString(t.attributes.CODECS).includes("video")});return[{id:"video-0",label:"und",getQualities:function(){return t.getVideoQualities(i)}}]},t.getTextTracks=function(t){return t.map(function(t,e){return{id:"text-".concat(e),label:t.attributes.NAME,lang:t.attributes.LANGUAGE,isFragmented:!0,kind:"CLOSED-CAPTIONS"===t.attributes.TYPE?"caption":"subtitle",url:t.attributes.URI}})},t.getVideoQualities=function(t){return t.map(function(t){var e=t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width,i=t.attributes.RESOLUTION&&t.attributes.RESOLUTION.height,a=n.CodecStringHelper.getExtractedCodecStrings(t.attributes.CODECS).video,o={id:i?"".concat(i,"_").concat(t.attributes.BANDWIDTH):"".concat(t.attributes.BANDWIDTH),bitrate:t.attributes.BANDWIDTH,width:e||0,height:i||0,colorInfo:{dynamicRange:(0,r.getDynamicRangeForHlsVariant)(t.attributes["VIDEO-RANGE"],a)}};return a&&(o.codec=a),o})},t}();e.NativePlayerManifestApiFactory=a},49706:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.TechnologyChecker=void 0;var n=i(44468),r=function(){function t(){}return t.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}]},t}();e.TechnologyChecker=r}},function(t){return function(){return t(27530)}()}])});
|
|
18
18
|
})();
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
* This software includes open-source components. See THIRD_PARTY_NOTICES
|
|
10
10
|
* in the distribution for details.
|
|
11
11
|
*
|
|
12
|
-
* Bitmovin Player Version 8.
|
|
12
|
+
* Bitmovin Player Version 8.281.0
|
|
13
13
|
*
|
|
14
14
|
****************************************************************************/
|
|
15
15
|
|
|
16
16
|
(function() {
|
|
17
|
-
"use strict";!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["engine-webrtc"]=e():(t.bitmovin=t.bitmovin||{},t.bitmovin.player=t.bitmovin.player||{},t.bitmovin.player["engine-webrtc"]=e())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[497],{69100:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.WhepModuleDefinition=void 0;var i=n(62756),o=n(3392),r=n(75801);e.WhepModuleDefinition={name:i.ModuleName.EngineWebRtc,module:{WebRtcPlayer:r.WebRtcPlayer,technologyChecker:new o.TechnologyChecker}},e.default=e.WhepModuleDefinition},3392:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.TechnologyChecker=void 0;var i=n(44468),o=function(){function t(){}return t.prototype.getSupportedTechnologies=function(){return[{player:i.PlayerType.WebRtc,streaming:i.StreamType.Whep}]},t}();e.TechnologyChecker=o},75801:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.WebRtcPlayer=void 0;var i=n(40306),o=n(3336),r=n(80813),s=n(3714),c=n(44468),a=n(15487),u=n(88844),l=n(19274),h=n(8204),d="not available",p=function(){function t(t){var e=this;if(this.context=t,this.preload=f,this.setAudioQuality=f,this.setVideoQuality=f,this.setTargetBufferLevel=f,this.updateCallback=f,this.setQueryParameters=f,this.clearQueryParameters=f,this.timeShift=f,this.removeSubtitle=f,this.setAudio=f,this.permitControl=f,this.onFullscreenEnter=f,this.onFullscreenExit=f,this.showAirplayTargetPicker=f,this.setTargetLatency=f,this.setCatchupConfig=f,this.setFallbackConfig=f,this.getManifest=v,this.getAudio=v,this.getLatency=v,this.getTargetLatency=v,this.getCatchupConfig=v,this.getFallbackConfig=v,this.createManifestApi=v,this.pause=function(){return e.Jn.pause()},this.seek=function(){return!1},this.isPlaying=function(){return!e.Jn.paused},this.isPaused=function(){return e.Jn.paused},this.hasEnded=function(){return e.Jn.ended},this.isMuted=function(){return e.Jn.muted},this.isStalled=function(){return!1},this.isLive=function(){return!0},this.getVolume=function(){return 100*e.Jn.volume},this.getCurrentTime=function(){return e.Jn.currentTime},this.getDuration=function(){return 1/0},this.getAvailableVideoQualities=function(){return[]},this.getAvailableAudioQualities=function(){return[]},this.getDroppedVideoFrames=function(){return e.Jn.droppedVideoFrames},this.getTotalStalledTime=function(){return 0},this.getBufferedRanges=function(){return[]},this.getMaxTimeShift=function(){return 0},this.getTimeShift=function(){return 0},this.addSubtitle=function(){return Promise.reject()},this.enableSubtitle=function(){return Promise.resolve(!1)},this.disableSubtitle=function(){return Promise.resolve(!1)},this.listSubtitles=function(){return[]},this.getAvailableAudio=function(){return[]},this.getSnapshot=function(){},this.getPlaybackSpeed=function(){var t,n;return null!==(n=null===(t=e.Jn)||void 0===t?void 0:t.playbackRate)&&void 0!==n?n:1},this.isAirplayAvailable=function(){return!1},this.isAirplayActive=function(){return!1},this.getSeekableRange=function(){return{start:-1,end:-1}},this.getAvailableSegments=function(){return{}},this.getDownloadedVideoData=function(){return{id:d,bitrate:0,height:0,width:0,isAuto:!0}},this.getDownloadedAudioData=function(){return{id:d,bitrate:0,isAuto:!0}},this.getPlaybackVideoData=function(){return{id:d,bitrate:0,height:e.Jn.videoHeight,width:e.Jn.videoWidth}},this.getPlaybackAudioData=function(){return{id:d,bitrate:0}},this.getAudioQuality=this.getPlaybackAudioData,this.getVideoQuality=this.getPlaybackVideoData,this.getBufferLevel=function(t,e){return{level:null,targetLevel:null,type:t,media:null!=e?e:c.MediaType.Video}},this.Xn=function(){var t;null===(t=e.Un)||void 0===t||t.transitionToPlayingState("webrtc")},this.Yn=function(){var t;null===(t=e.Un)||void 0===t||t.transitionToPausedState(!0,"webrtc")},this.Zn=function(){e.context.eventHandler.dispatchEvent(s.PlayerEvent.TimeChanged,{time:e.Jn.currentTime})},this.an=function(){var t,n;if("failed"===(null===(t=e.Tn)||void 0===t?void 0:t.connectionState)){if(e.context.logger.debug("WebRTC peer connection failed"),e.Tn.close(),e.Qn<=0)return void e.context.eventHandler.fireError(new o.PlayerError(i.ErrorCode.SOURCE_ERROR,void 0,"WebRTC peer connection failed",e.context.sourceContext.sourceIdentifier));e.context.logger.debug("WebRTC peer connection failed, retrying ".concat(e.Qn," more time(s)")),e.gn().catch(function(t){return e.context.logger.debug("WebRTC peer connection failed:",t)}),e.Qn--}else"connected"===(null===(n=e.Tn)||void 0===n?void 0:n.connectionState)&&(e.context.logger.debug("WebRTC peer connection established"),e.Qn=2)},this.bn=function(){void 0!==e.Tn&&(e.Tn.close(),e.Jn.srcObject=null,e.Tn=e.en(),e.On.resetPeer(e.Tn),e.On.connect().catch(function(t){return e.context.logger.debug("WHEP reconnection failed:",t)}))},this.cn=function(){var t;if(void 0!==e.Tn){var n=0;null===(t=e.Tn)||void 0===t||t.getStats(null).then(function(t){var i=[];t.forEach(function(t){i.push(t),t.type.match("inbound-rtp")&&(n+=t.bytesReceived)}),e.context.logger.debug("WebRTC connection statistics:",i),n<=e.Mn?(e.Sn+=e.In,!1===e.Rn&&e.Sn>=e.Ln&&(e.context.logger.debug("WebRTC media seems to have disconnected..."),e.Rn=!0)):(e.Mn=n,e.Sn=0,!0===e.Rn&&(e.context.logger.debug("WebRTC media reconnected"),e.Rn=!1))}).catch(function(t){return e.context.logger.debug("WebRTC statistics collection failed",t)})}},this.fn=function(t){for(var n=0,i=t.streams;n<i.length;n++){var o=i[n];"feedbackvideomslabel"===o.id||e.Jn.srcObject||(e.context.logger.debug('Set WebRTC video element remote stream to "'.concat(o.id,'" with ').concat(o.getAudioTracks().length," audio tracks and ").concat(o.getVideoTracks().length," video tracks")),e.Jn.srcObject=o)}},void 0===this.context.videoElement)throw new o.PlayerError(i.ErrorCode.SETUP_ERROR);this.Mn=0,this.Sn=0,this.Rn=!1,this.Jn=this.context.videoElement,this.Qn=2,this.In=2e3,this.Ln=3e4,this.Kn=[{urls:"stun:stun.l.google.com:19302"}]}return t.prototype.Vn=function(){this.Jn.addEventListener(l.MediaElementEvent.pause,this.Yn),this.Jn.addEventListener(l.MediaElementEvent.playing,this.Xn),this.Jn.addEventListener(l.MediaElementEvent.timeupdate,this.Zn)},t.prototype.Wn=function(){this.Jn.removeEventListener(l.MediaElementEvent.pause,this.Yn),this.Jn.removeEventListener(l.MediaElementEvent.playing,this.Xn),this.Jn.removeEventListener(l.MediaElementEvent.timeupdate,this.Zn)},t.prototype.load=function(t){return"string"!=typeof t.url?Promise.reject("Invalid source config"):(this.Vn(),this.Qn=2,this.Pn=t.url,this.gn())},t.prototype.dn=function(){var t={iceServers:this.Kn};return(0,a.isTizen2020)()&&(t.sdpSemantics="unified-plan"),t},t.prototype.en=function(){var t=new RTCPeerConnection(this.dn());return t.onconnectionstatechange=this.an,t.ontrack=this.fn,t},t.prototype.gn=function(){return this.Tn=this.en(),void 0===this.Pn?Promise.reject(new o.PlayerError(i.ErrorCode.SOURCE_INVALID,void 0,"WHEP channel URL is undefined",this.context.sourceContext.sourceIdentifier)):(void 0!==this.On&&this.On.dispose(),this.On=new h.WhepAdapter(this.context,this.Tn,this.Pn,this.bn),this.Nn=window.setInterval(this.cn,this.In),this.On.connect())},t.prototype.stop=function(){var t;(0,u.clearIntervalIfDefined)(this.Nn),this.Nn=void 0,this.On.dispose(),null===(t=this.Tn)||void 0===t||t.close(),this.Jn.srcObject=null,this.Jn.load()},t.prototype.play=function(){var t;return null===(t=this.Un)||void 0===t||t.transitionToPlayState(!0,"webrtc"),this.Jn.play()},t.prototype.mute=function(){this.Jn.muted||(this.Jn.muted=!0,this.context.eventHandler.dispatchEvent(s.PlayerEvent.Muted))},t.prototype.unmute=function(){this.Jn.muted&&(this.Jn.muted=!1,this.context.eventHandler.dispatchEvent(s.PlayerEvent.Unmuted))},t.prototype.destroy=function(){this.stop()},t.prototype.setVolume=function(t){var e=this.getVolume();this.Jn.volume=Math.min(t/100,1),this.context.eventHandler.dispatchEvent(s.PlayerEvent.VolumeChanged,{sourceVolume:e,targetVolume:t})},t.prototype.prepareLoad=function(){return this.Un=this.context.serviceManager.get(r.ServiceName.PlayerStateService),Promise.resolve()},t.prototype.prepareSource=function(t,e){return Promise.resolve()},t.prototype.unload=function(){var t=null!==this.Jn.srcObject;return this.Wn(),this.stop(),t&&this.context.eventHandler.dispatchEvent(s.PlayerEvent.SourceUnloaded),Promise.resolve()},t.prototype.setPlaybackSpeed=function(t){this.Jn.playbackRate=t},t.prototype.release=function(){return this.Wn(),this.destroy(),this.unload()},t}();function f(){}function v(){return null}e.WebRtcPlayer=p},8204:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.WhepAdapter=void 0;var i,o=n(40306),r=n(3336),s=n(4129),c=n(29669),a=n(88844),u={"Content-Type":"application/sdp"};!function(t){t[t.Client=0]="Client",t[t.Server=1]="Server"}(i||(i={}));var l=function(){function t(t,e,n,s){var c=this;this.context=t,this.channelUrl=n,this.reconnectCallback=s,this.uP=function(){c.pP=!0,c.qP=window.setTimeout(c.BP,2e3)},this.yP=function(t){if("icecandidate"===t.type){var e=t.candidate;e&&c.context.logger.debug("ICE candidate:",e.candidate)}},this.zP=function(t){c.context.logger.debug("Waiting for ICE candidates failed:",t);var e=t instanceof r.PlayerError?t:new r.PlayerError(o.ErrorCode.SOURCE_INVALID,{error:t},"ICE gathering failed",c.context.sourceContext.sourceIdentifier);c.context.eventHandler.fireError(e)},this.AP=function(){c.context.logger.debug('WHEP ICE gathering state changed to "'.concat(c.oP.iceGatheringState,'"')),"complete"===c.oP.iceGatheringState&&c.pP&&c.CP().catch(c.zP)},this.BP=function(){c.context.logger.debug("IceGatheringTimeout"),c.pP&&c.CP().catch(c.zP)},this.DP=function(t){return Promise.reject(new r.PlayerError(o.ErrorCode.NETWORK_ERROR,{status:t.status,statusText:t.statusText,body:t.body},"WHEP network request failed with status ".concat(t.status),c.context.sourceContext.sourceIdentifier))},this.nP=i.Client,this.oP=e,this.resetPeer(e)}return t.prototype.rP=function(t){t.addEventListener("icecandidate",this.yP),t.addEventListener("icegatheringstatechange",this.AP)},t.prototype.sP=function(t){t.removeEventListener("icecandidate",this.yP),t.removeEventListener("icegatheringstatechange",this.AP)},t.prototype.resetPeer=function(t){this.sP(this.oP),this.rP(t),this.oP=t},t.prototype.connect=function(){return this.xP()},t.prototype.tP=function(){(0,a.clearTimeoutIfDefined)(this.qP),this.qP=void 0},t.prototype.vP=function(){var t=this;return this.FP().then(function(e){return t.oP.setRemoteDescription({type:"offer",sdp:e})}).then(function(){return t.oP.createAnswer()}).then(function(e){return t.oP.setLocalDescription(e)}).then(this.uP)},t.prototype.wP=function(){var t=this;return this.oP.addTransceiver("video",{direction:"recvonly"}),this.oP.addTransceiver("audio",{direction:"recvonly"}),this.oP.createOffer().then(function(e){return t.oP.setLocalDescription(e)}).then(this.uP)},t.prototype.xP=function(){return this.tP(),this.nP===i.Client?this.wP():this.vP()},t.prototype.CP=function(){return this.tP(),this.pP=!1,this.nP===i.Client?this.HP():this.GP()},t.prototype.EP=function(t,e,n){return new s.DefaultContentLoader(this.context,{requestType:n}).load(this.channelUrl,t,c.HttpResponseType.TEXT,e,u)},t.prototype.FP=function(){var t=this;return this.nP!==i.Server?Promise.resolve(""):this.EP(c.HttpRequestMethod.POST,"",c.HttpRequestType.WEBRTC_SDP_REQUEST).then(function(e){var n,i,o,r;return t.mP=null!==(r=null!==(i=null===(n=e.headers)||void 0===n?void 0:n.Location)&&void 0!==i?i:null===(o=e.headers)||void 0===o?void 0:o.location)&&void 0!==r?r:"",t.context.logger.debug("WHEP resource offered:",t.mP),String(e.body)}).catch(this.DP)},t.prototype.GP=function(){var t,e=this;if(this.nP!==i.Server)return Promise.resolve();var n=this.oP.localDescription;return this.EP(c.HttpRequestMethod.PATCH,null!==(t=null==n?void 0:n.sdp)&&void 0!==t?t:"",c.HttpRequestType.WEBRTC_SDP_ANSWER).then(function(t){return e.context.logger.debug("WHEP answer response: ".concat(t.status))}).catch(this.DP)},t.prototype.HP=function(){var t,e=this;if(this.nP!==i.Client)return Promise.resolve();var n=this.oP.localDescription;return this.EP(c.HttpRequestMethod.POST,null!==(t=null==n?void 0:n.sdp)&&void 0!==t?t:"",c.HttpRequestType.WEBRTC_SDP_OFFER).then(function(t){var n,o,r,s;return"string"==typeof t.body?(e.mP=null!==(s=null!==(o=null===(n=t.headers)||void 0===n?void 0:n.Location)&&void 0!==o?o:null===(r=t.headers)||void 0===r?void 0:r.location)&&void 0!==s?s:"",e.context.logger.debug("Received WHEP remote description (location: ".concat(e.mP,")")),e.oP.setRemoteDescription({type:"answer",sdp:t.body})):(400===t.status?(e.context.logger.debug("server does not support WHEP client-offer, reconnecting..."),e.nP=i.Server,e.reconnectCallback()):e.context.logger.debug("WHEP offer response: ".concat(t.status)),Promise.resolve())}).catch(this.DP)},t.prototype.dispose=function(){this.sP(this.oP)},t}();e.WhepAdapter=l}},function(t){return function(){return t(69100)}()}])});
|
|
17
|
+
"use strict";!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["engine-webrtc"]=e():(t.bitmovin=t.bitmovin||{},t.bitmovin.player=t.bitmovin.player||{},t.bitmovin.player["engine-webrtc"]=e())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[497],{69100:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.WhepModuleDefinition=void 0;var n=i(62756),o=i(3392),r=i(75801);e.WhepModuleDefinition={name:n.ModuleName.EngineWebRtc,module:{WebRtcPlayer:r.WebRtcPlayer,technologyChecker:new o.TechnologyChecker}},e.default=e.WhepModuleDefinition},3392:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.TechnologyChecker=void 0;var n=i(44468),o=function(){function t(){}return t.prototype.getSupportedTechnologies=function(){return[{player:n.PlayerType.WebRtc,streaming:n.StreamType.Whep}]},t}();e.TechnologyChecker=o},75801:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.WebRtcPlayer=void 0;var n=i(40306),o=i(3336),r=i(80813),s=i(3714),c=i(44468),a=i(15487),u=i(88844),h=i(19274),l=i(8204),d="not available",p=function(){function t(t){var e=this;if(this.context=t,this.preload=f,this.setAudioQuality=f,this.setVideoQuality=f,this.setTargetBufferLevel=f,this.updateCallback=f,this.setQueryParameters=f,this.clearQueryParameters=f,this.timeShift=f,this.removeSubtitle=f,this.setAudio=f,this.permitControl=f,this.onFullscreenEnter=f,this.onFullscreenExit=f,this.showAirplayTargetPicker=f,this.setTargetLatency=f,this.setCatchupConfig=f,this.setFallbackConfig=f,this.getManifest=v,this.getAudio=v,this.getLatency=v,this.getTargetLatency=v,this.getCatchupConfig=v,this.getFallbackConfig=v,this.createManifestApi=v,this.pause=function(){return e.ij.pause()},this.seek=function(){return!1},this.isPlaying=function(){return!e.ij.paused},this.isPaused=function(){return e.ij.paused},this.hasEnded=function(){return e.ij.ended},this.isMuted=function(){return e.ij.muted},this.isStalled=function(){return!1},this.isLive=function(){return!0},this.getVolume=function(){return 100*e.ij.volume},this.getCurrentTime=function(){return e.ij.currentTime},this.getDuration=function(){return 1/0},this.getAvailableVideoQualities=function(){return[]},this.getAvailableAudioQualities=function(){return[]},this.getDroppedVideoFrames=function(){return e.ij.droppedVideoFrames},this.getTotalStalledTime=function(){return 0},this.getBufferedRanges=function(){return[]},this.getMaxTimeShift=function(){return 0},this.getTimeShift=function(){return 0},this.addSubtitle=function(){return Promise.reject()},this.enableSubtitle=function(){return Promise.resolve(!1)},this.disableSubtitle=function(){return Promise.resolve(!1)},this.listSubtitles=function(){return[]},this.getAvailableAudio=function(){return[]},this.getSnapshot=function(){},this.getPlaybackSpeed=function(){var t,i;return null!==(i=null===(t=e.ij)||void 0===t?void 0:t.playbackRate)&&void 0!==i?i:1},this.isAirplayAvailable=function(){return!1},this.isAirplayActive=function(){return!1},this.getSeekableRange=function(){return{start:-1,end:-1}},this.getAvailableSegments=function(){return{}},this.getDownloadedVideoData=function(){return{id:d,bitrate:0,height:0,width:0,isAuto:!0}},this.getDownloadedAudioData=function(){return{id:d,bitrate:0,isAuto:!0}},this.getPlaybackVideoData=function(){return{id:d,bitrate:0,height:e.ij.videoHeight,width:e.ij.videoWidth}},this.getPlaybackAudioData=function(){return{id:d,bitrate:0}},this.getAudioQuality=this.getPlaybackAudioData,this.getVideoQuality=this.getPlaybackVideoData,this.getBufferLevel=function(t,e){return{level:null,targetLevel:null,type:t,media:null!=e?e:c.MediaType.Video}},this.wj=function(){var t;null===(t=e.tj)||void 0===t||t.transitionToPlayingState("webrtc")},this.xj=function(){var t;null===(t=e.tj)||void 0===t||t.transitionToPausedState(!0,"webrtc")},this.yj=function(){e.context.eventHandler.dispatchEvent(s.PlayerEvent.TimeChanged,{time:e.ij.currentTime})},this.zj=function(){var t,i;if("failed"===(null===(t=e.sj)||void 0===t?void 0:t.connectionState)){if(e.context.logger.debug("WebRTC peer connection failed"),e.sj.close(),e.pj<=0)return void e.context.eventHandler.fireError(new o.PlayerError(n.ErrorCode.SOURCE_ERROR,void 0,"WebRTC peer connection failed",e.context.sourceContext.sourceIdentifier));e.context.logger.debug("WebRTC peer connection failed, retrying ".concat(e.pj," more time(s)")),e.Fj().catch(function(t){return e.context.logger.debug("WebRTC peer connection failed:",t)}),e.pj--}else"connected"===(null===(i=e.sj)||void 0===i?void 0:i.connectionState)&&(e.context.logger.debug("WebRTC peer connection established"),e.pj=2)},this.Aj=function(){void 0!==e.sj&&(e.sj.close(),e.ij.srcObject=null,e.sj=e.Dj(),e.nj.resetPeer(e.sj),e.nj.connect().catch(function(t){return e.context.logger.debug("WHEP reconnection failed:",t)}))},this.Bj=function(){var t;if(void 0!==e.sj){var i=0;null===(t=e.sj)||void 0===t||t.getStats(null).then(function(t){var n=[];t.forEach(function(t){n.push(t),t.type.match("inbound-rtp")&&(i+=t.bytesReceived)}),e.context.logger.debug("WebRTC connection statistics:",n),i<=e.lj?(e.rj+=e.hj,!1===e.qj&&e.rj>=e.kj&&(e.context.logger.debug("WebRTC media seems to have disconnected..."),e.qj=!0)):(e.lj=i,e.rj=0,!0===e.qj&&(e.context.logger.debug("WebRTC media reconnected"),e.qj=!1))}).catch(function(t){return e.context.logger.debug("WebRTC statistics collection failed",t)})}},this.Ej=function(t){for(var i=0,n=t.streams;i<n.length;i++){var o=n[i];"feedbackvideomslabel"===o.id||e.ij.srcObject||(e.context.logger.debug('Set WebRTC video element remote stream to "'.concat(o.id,'" with ').concat(o.getAudioTracks().length," audio tracks and ").concat(o.getVideoTracks().length," video tracks")),e.ij.srcObject=o)}},void 0===this.context.videoElement)throw new o.PlayerError(n.ErrorCode.SETUP_ERROR);this.lj=0,this.rj=0,this.qj=!1,this.ij=this.context.videoElement,this.pj=2,this.hj=2e3,this.kj=3e4,this.jj=[{urls:"stun:stun.l.google.com:19302"}]}return t.prototype.uj=function(){this.ij.addEventListener(h.MediaElementEvent.pause,this.xj),this.ij.addEventListener(h.MediaElementEvent.playing,this.wj),this.ij.addEventListener(h.MediaElementEvent.timeupdate,this.yj)},t.prototype.vj=function(){this.ij.removeEventListener(h.MediaElementEvent.pause,this.xj),this.ij.removeEventListener(h.MediaElementEvent.playing,this.wj),this.ij.removeEventListener(h.MediaElementEvent.timeupdate,this.yj)},t.prototype.load=function(t){return"string"!=typeof t.url?Promise.reject("Invalid source config"):(this.uj(),this.pj=2,this.oj=t.url,this.Fj())},t.prototype.Cj=function(){var t={iceServers:this.jj};return(0,a.isTizen2020)()&&(t.sdpSemantics="unified-plan"),t},t.prototype.Dj=function(){var t=new RTCPeerConnection(this.Cj());return t.onconnectionstatechange=this.zj,t.ontrack=this.Ej,t},t.prototype.Fj=function(){return this.sj=this.Dj(),void 0===this.oj?Promise.reject(new o.PlayerError(n.ErrorCode.SOURCE_INVALID,void 0,"WHEP channel URL is undefined",this.context.sourceContext.sourceIdentifier)):(void 0!==this.nj&&this.nj.dispose(),this.nj=new l.WhepAdapter(this.context,this.sj,this.oj,this.Aj),this.mj=window.setInterval(this.Bj,this.hj),this.nj.connect())},t.prototype.stop=function(){var t;(0,u.clearIntervalIfDefined)(this.mj),this.mj=void 0,this.nj.dispose(),null===(t=this.sj)||void 0===t||t.close(),this.ij.srcObject=null,this.ij.load()},t.prototype.play=function(){var t;return null===(t=this.tj)||void 0===t||t.transitionToPlayState(!0,"webrtc"),this.ij.play()},t.prototype.mute=function(){this.ij.muted||(this.ij.muted=!0,this.context.eventHandler.dispatchEvent(s.PlayerEvent.Muted))},t.prototype.unmute=function(){this.ij.muted&&(this.ij.muted=!1,this.context.eventHandler.dispatchEvent(s.PlayerEvent.Unmuted))},t.prototype.destroy=function(){this.stop()},t.prototype.setVolume=function(t){var e=this.getVolume();this.ij.volume=Math.min(t/100,1),this.context.eventHandler.dispatchEvent(s.PlayerEvent.VolumeChanged,{sourceVolume:e,targetVolume:t})},t.prototype.prepareLoad=function(){return this.tj=this.context.serviceManager.get(r.ServiceName.PlayerStateService),Promise.resolve()},t.prototype.prepareSource=function(t,e){return Promise.resolve()},t.prototype.unload=function(){var t=null!==this.ij.srcObject;return this.vj(),this.stop(),t&&this.context.eventHandler.dispatchEvent(s.PlayerEvent.SourceUnloaded),Promise.resolve()},t.prototype.setPlaybackSpeed=function(t){this.ij.playbackRate=t},t.prototype.release=function(){return this.vj(),this.destroy(),this.unload()},t}();function f(){}function v(){return null}e.WebRtcPlayer=p},8204:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.WhepAdapter=void 0;var n,o=i(40306),r=i(3336),s=i(4129),c=i(29669),a=i(88844),u={"Content-Type":"application/sdp"};!function(t){t[t.Client=0]="Client",t[t.Server=1]="Server"}(n||(n={}));var h=function(){function t(t,e,i,s){var c=this;this.context=t,this.channelUrl=i,this.reconnectCallback=s,this.iN=function(){c.dN=!0,c.eN=window.setTimeout(c.pN,2e3)},this.mN=function(t){if("icecandidate"===t.type){var e=t.candidate;e&&c.context.logger.debug("ICE candidate:",e.candidate)}},this.nN=function(t){c.context.logger.debug("Waiting for ICE candidates failed:",t);var e=t instanceof r.PlayerError?t:new r.PlayerError(o.ErrorCode.SOURCE_INVALID,{error:t},"ICE gathering failed",c.context.sourceContext.sourceIdentifier);c.context.eventHandler.fireError(e)},this.oN=function(){c.context.logger.debug('WHEP ICE gathering state changed to "'.concat(c.cN.iceGatheringState,'"')),"complete"===c.cN.iceGatheringState&&c.dN&&c.qN().catch(c.nN)},this.pN=function(){c.context.logger.debug("IceGatheringTimeout"),c.dN&&c.qN().catch(c.nN)},this.rN=function(t){return Promise.reject(new r.PlayerError(o.ErrorCode.NETWORK_ERROR,{status:t.status,statusText:t.statusText,body:t.body},"WHEP network request failed with status ".concat(t.status),c.context.sourceContext.sourceIdentifier))},this.bN=n.Client,this.cN=e,this.resetPeer(e)}return t.prototype.fN=function(t){t.addEventListener("icecandidate",this.mN),t.addEventListener("icegatheringstatechange",this.oN)},t.prototype.gN=function(t){t.removeEventListener("icecandidate",this.mN),t.removeEventListener("icegatheringstatechange",this.oN)},t.prototype.resetPeer=function(t){this.gN(this.cN),this.fN(t),this.cN=t},t.prototype.connect=function(){return this.lN()},t.prototype.hN=function(){(0,a.clearTimeoutIfDefined)(this.eN),this.eN=void 0},t.prototype.jN=function(){var t=this;return this.tN().then(function(e){return t.cN.setRemoteDescription({type:"offer",sdp:e})}).then(function(){return t.cN.createAnswer()}).then(function(e){return t.cN.setLocalDescription(e)}).then(this.iN)},t.prototype.kN=function(){var t=this;return this.cN.addTransceiver("video",{direction:"recvonly"}),this.cN.addTransceiver("audio",{direction:"recvonly"}),this.cN.createOffer().then(function(e){return t.cN.setLocalDescription(e)}).then(this.iN)},t.prototype.lN=function(){return this.hN(),this.bN===n.Client?this.kN():this.jN()},t.prototype.qN=function(){return this.hN(),this.dN=!1,this.bN===n.Client?this.vN():this.uN()},t.prototype.sN=function(t,e,i){return new s.DefaultContentLoader(this.context,{requestType:i}).load(this.channelUrl,t,c.HttpResponseType.TEXT,e,u)},t.prototype.tN=function(){var t=this;return this.bN!==n.Server?Promise.resolve(""):this.sN(c.HttpRequestMethod.POST,"",c.HttpRequestType.WEBRTC_SDP_REQUEST).then(function(e){var i,n,o,r;return t.aN=null!==(r=null!==(n=null===(i=e.headers)||void 0===i?void 0:i.Location)&&void 0!==n?n:null===(o=e.headers)||void 0===o?void 0:o.location)&&void 0!==r?r:"",t.context.logger.debug("WHEP resource offered:",t.aN),String(e.body)}).catch(this.rN)},t.prototype.uN=function(){var t,e=this;if(this.bN!==n.Server)return Promise.resolve();var i=this.cN.localDescription;return this.sN(c.HttpRequestMethod.PATCH,null!==(t=null==i?void 0:i.sdp)&&void 0!==t?t:"",c.HttpRequestType.WEBRTC_SDP_ANSWER).then(function(t){return e.context.logger.debug("WHEP answer response: ".concat(t.status))}).catch(this.rN)},t.prototype.vN=function(){var t,e=this;if(this.bN!==n.Client)return Promise.resolve();var i=this.cN.localDescription;return this.sN(c.HttpRequestMethod.POST,null!==(t=null==i?void 0:i.sdp)&&void 0!==t?t:"",c.HttpRequestType.WEBRTC_SDP_OFFER).then(function(t){var i,o,r,s;return"string"==typeof t.body?(e.aN=null!==(s=null!==(o=null===(i=t.headers)||void 0===i?void 0:i.Location)&&void 0!==o?o:null===(r=t.headers)||void 0===r?void 0:r.location)&&void 0!==s?s:"",e.context.logger.debug("Received WHEP remote description (location: ".concat(e.aN,")")),e.cN.setRemoteDescription({type:"answer",sdp:t.body})):(400===t.status?(e.context.logger.debug("server does not support WHEP client-offer, reconnecting..."),e.bN=n.Server,e.reconnectCallback()):e.context.logger.debug("WHEP offer response: ".concat(t.status)),Promise.resolve())}).catch(this.rN)},t.prototype.dispose=function(){this.gN(this.cN)},t}();e.WhepAdapter=h}},function(t){return function(){return t(69100)}()}])});
|
|
18
18
|
})();
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
* This software includes open-source components. See THIRD_PARTY_NOTICES
|
|
10
10
|
* in the distribution for details.
|
|
11
11
|
*
|
|
12
|
-
* Bitmovin Player Version 8.
|
|
12
|
+
* Bitmovin Player Version 8.281.0
|
|
13
13
|
*
|
|
14
14
|
****************************************************************************/
|
|
15
15
|
|
|
16
16
|
(function() {
|
|
17
|
-
"use strict";!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["engine-webrtc"]=e():(t.bitmovin=t.bitmovin||{},t.bitmovin.player=t.bitmovin.player||{},t.bitmovin.player["engine-webrtc"]=e())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[497],{69100:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.WhepModuleDefinition=void 0;var n=i(62756),o=i(3392),r=i(75801);e.WhepModuleDefinition={name:n.ModuleName.EngineWebRtc,module:{WebRtcPlayer:r.WebRtcPlayer,technologyChecker:new o.TechnologyChecker}},e.default=e.WhepModuleDefinition},3392:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.TechnologyChecker=void 0;var n=i(44468),o=function(){function t(){}return t.prototype.getSupportedTechnologies=function(){return[{player:n.PlayerType.WebRtc,streaming:n.StreamType.Whep}]},t}();e.TechnologyChecker=o},75801:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.WebRtcPlayer=void 0;var n=i(40306),o=i(3336),r=i(80813),s=i(3714),u=i(44468),a=i(15487),c=i(88844),h=i(19274),l=i(8204),d="not available",p=function(){function t(t){var e=this;if(this.context=t,this.preload=f,this.setAudioQuality=f,this.setVideoQuality=f,this.setTargetBufferLevel=f,this.updateCallback=f,this.setQueryParameters=f,this.clearQueryParameters=f,this.timeShift=f,this.removeSubtitle=f,this.setAudio=f,this.permitControl=f,this.onFullscreenEnter=f,this.onFullscreenExit=f,this.showAirplayTargetPicker=f,this.setTargetLatency=f,this.setCatchupConfig=f,this.setFallbackConfig=f,this.getManifest=v,this.getAudio=v,this.getLatency=v,this.getTargetLatency=v,this.getCatchupConfig=v,this.getFallbackConfig=v,this.createManifestApi=v,this.pause=function(){return e.yi.pause()},this.seek=function(){return!1},this.isPlaying=function(){return!e.yi.paused},this.isPaused=function(){return e.yi.paused},this.hasEnded=function(){return e.yi.ended},this.isMuted=function(){return e.yi.muted},this.isStalled=function(){return!1},this.isLive=function(){return!0},this.getVolume=function(){return 100*e.yi.volume},this.getCurrentTime=function(){return e.yi.currentTime},this.getDuration=function(){return 1/0},this.getAvailableVideoQualities=function(){return[]},this.getAvailableAudioQualities=function(){return[]},this.getDroppedVideoFrames=function(){return e.yi.droppedVideoFrames},this.getTotalStalledTime=function(){return 0},this.getBufferedRanges=function(){return[]},this.getMaxTimeShift=function(){return 0},this.getTimeShift=function(){return 0},this.addSubtitle=function(){return Promise.reject()},this.enableSubtitle=function(){return Promise.resolve(!1)},this.disableSubtitle=function(){return Promise.resolve(!1)},this.listSubtitles=function(){return[]},this.getAvailableAudio=function(){return[]},this.getSnapshot=function(){},this.getPlaybackSpeed=function(){var t,i;return null!==(i=null===(t=e.yi)||void 0===t?void 0:t.playbackRate)&&void 0!==i?i:1},this.isAirplayAvailable=function(){return!1},this.isAirplayActive=function(){return!1},this.getSeekableRange=function(){return{start:-1,end:-1}},this.getAvailableSegments=function(){return{}},this.getDownloadedVideoData=function(){return{id:d,bitrate:0,height:0,width:0,isAuto:!0}},this.getDownloadedAudioData=function(){return{id:d,bitrate:0,isAuto:!0}},this.getPlaybackVideoData=function(){return{id:d,bitrate:0,height:e.yi.videoHeight,width:e.yi.videoWidth}},this.getPlaybackAudioData=function(){return{id:d,bitrate:0}},this.getAudioQuality=this.getPlaybackAudioData,this.getVideoQuality=this.getPlaybackVideoData,this.getBufferLevel=function(t,e){return{level:null,targetLevel:null,type:t,media:null!=e?e:u.MediaType.Video}},this.Wj=function(){var t;null===(t=e.Tj)||void 0===t||t.transitionToPlayingState("webrtc")},this.Xj=function(){var t;null===(t=e.Tj)||void 0===t||t.transitionToPausedState(!0,"webrtc")},this.Yj=function(){e.context.eventHandler.dispatchEvent(s.PlayerEvent.TimeChanged,{time:e.yi.currentTime})},this.Zj=function(){var t,i;if("failed"===(null===(t=e.Sj)||void 0===t?void 0:t.connectionState)){if(e.Sj.close(),e.Pj<=0)return void e.context.eventHandler.fireError(new o.PlayerError(n.ErrorCode.SOURCE_ERROR,void 0,"WebRTC peer connection failed",e.context.sourceContext.sourceIdentifier));e.fj().catch(function(t){}),e.Pj--}else"connected"===(null===(i=e.Sj)||void 0===i?void 0:i.connectionState)&&(e.Pj=2)},this.aj=function(){void 0!==e.Sj&&(e.Sj.close(),e.yi.srcObject=null,e.Sj=e.dj(),e.Nj.resetPeer(e.Sj),e.Nj.connect().catch(function(t){}))},this.bj=function(){var t;if(void 0!==e.Sj){var i=0;null===(t=e.Sj)||void 0===t||t.getStats(null).then(function(t){var n=[];t.forEach(function(t){n.push(t),t.type.match("inbound-rtp")&&(i+=t.bytesReceived)}),i<=e.Bi?(e.Rj+=e.xi,!1===e.Qj&&e.Rj>=e.Ai&&(e.Qj=!0)):(e.Bi=i,e.Rj=0,!0===e.Qj&&(e.Qj=!1))}).catch(function(t){})}},this.ej=function(t){for(var i=0,n=t.streams;i<n.length;i++){var o=n[i];"feedbackvideomslabel"===o.id||e.yi.srcObject||(e.yi.srcObject=o)}},void 0===this.context.videoElement)throw new o.PlayerError(n.ErrorCode.SETUP_ERROR);this.Bi=0,this.Rj=0,this.Qj=!1,this.yi=this.context.videoElement,this.Pj=2,this.xi=2e3,this.Ai=3e4,this.zi=[{urls:"stun:stun.l.google.com:19302"}]}return t.prototype.Uj=function(){this.yi.addEventListener(h.MediaElementEvent.pause,this.Xj),this.yi.addEventListener(h.MediaElementEvent.playing,this.Wj),this.yi.addEventListener(h.MediaElementEvent.timeupdate,this.Yj)},t.prototype.Vj=function(){this.yi.removeEventListener(h.MediaElementEvent.pause,this.Xj),this.yi.removeEventListener(h.MediaElementEvent.playing,this.Wj),this.yi.removeEventListener(h.MediaElementEvent.timeupdate,this.Yj)},t.prototype.load=function(t){return"string"!=typeof t.url?Promise.reject("Invalid source config"):(this.Uj(),this.Pj=2,this.Oj=t.url,this.fj())},t.prototype.cj=function(){var t={iceServers:this.zi};return(0,a.isTizen2020)()&&(t.sdpSemantics="unified-plan"),t},t.prototype.dj=function(){var t=new RTCPeerConnection(this.cj());return t.onconnectionstatechange=this.Zj,t.ontrack=this.ej,t},t.prototype.fj=function(){return this.Sj=this.dj(),void 0===this.Oj?Promise.reject(new o.PlayerError(n.ErrorCode.SOURCE_INVALID,void 0,"WHEP channel URL is undefined",this.context.sourceContext.sourceIdentifier)):(void 0!==this.Nj&&this.Nj.dispose(),this.Nj=new l.WhepAdapter(this.context,this.Sj,this.Oj,this.aj),this.Mj=window.setInterval(this.bj,this.xi),this.Nj.connect())},t.prototype.stop=function(){var t;(0,c.clearIntervalIfDefined)(this.Mj),this.Mj=void 0,this.Nj.dispose(),null===(t=this.Sj)||void 0===t||t.close(),this.yi.srcObject=null,this.yi.load()},t.prototype.play=function(){var t;return null===(t=this.Tj)||void 0===t||t.transitionToPlayState(!0,"webrtc"),this.yi.play()},t.prototype.mute=function(){this.yi.muted||(this.yi.muted=!0,this.context.eventHandler.dispatchEvent(s.PlayerEvent.Muted))},t.prototype.unmute=function(){this.yi.muted&&(this.yi.muted=!1,this.context.eventHandler.dispatchEvent(s.PlayerEvent.Unmuted))},t.prototype.destroy=function(){this.stop()},t.prototype.setVolume=function(t){var e=this.getVolume();this.yi.volume=Math.min(t/100,1),this.context.eventHandler.dispatchEvent(s.PlayerEvent.VolumeChanged,{sourceVolume:e,targetVolume:t})},t.prototype.prepareLoad=function(){return this.Tj=this.context.serviceManager.get(r.ServiceName.PlayerStateService),Promise.resolve()},t.prototype.prepareSource=function(t,e){return Promise.resolve()},t.prototype.unload=function(){var t=null!==this.yi.srcObject;return this.Vj(),this.stop(),t&&this.context.eventHandler.dispatchEvent(s.PlayerEvent.SourceUnloaded),Promise.resolve()},t.prototype.setPlaybackSpeed=function(t){this.yi.playbackRate=t},t.prototype.release=function(){return this.Vj(),this.destroy(),this.unload()},t}();function f(){}function v(){return null}e.WebRtcPlayer=p},8204:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.WhepAdapter=void 0;var n,o=i(40306),r=i(3336),s=i(4129),u=i(29669),a=i(88844),c={"Content-Type":"application/sdp"};!function(t){t[t.Client=0]="Client",t[t.Server=1]="Server"}(n||(n={}));var h=function(){function t(t,e,i,s){var u=this;this.context=t,this.channelUrl=i,this.reconnectCallback=s,this.RO=function(){u.MO=!0,u.NO=window.setTimeout(u.YO,2e3)},this.VO=function(t){"icecandidate"===t.type&&t.candidate},this.WO=function(t){var e=t instanceof r.PlayerError?t:new r.PlayerError(o.ErrorCode.SOURCE_INVALID,{error:t},"ICE gathering failed",u.context.sourceContext.sourceIdentifier);u.context.eventHandler.fireError(e)},this.XO=function(){"complete"===u.LO.iceGatheringState&&u.MO&&u.ZO().catch(u.WO)},this.YO=function(){u.MO&&u.ZO().catch(u.WO)},this.aO=function(t){return Promise.reject(new r.PlayerError(o.ErrorCode.NETWORK_ERROR,{status:t.status,statusText:t.statusText,body:t.body},"WHEP network request failed with status ".concat(t.status),u.context.sourceContext.sourceIdentifier))},this.KO=n.Client,this.LO=e,this.resetPeer(e)}return t.prototype.OO=function(t){t.addEventListener("icecandidate",this.VO),t.addEventListener("icegatheringstatechange",this.XO)},t.prototype.PO=function(t){t.removeEventListener("icecandidate",this.VO),t.removeEventListener("icegatheringstatechange",this.XO)},t.prototype.resetPeer=function(t){this.PO(this.LO),this.OO(t),this.LO=t},t.prototype.connect=function(){return this.UO()},t.prototype.QO=function(){(0,a.clearTimeoutIfDefined)(this.NO),this.NO=void 0},t.prototype.SO=function(){var t=this;return this.cO().then(function(e){return t.LO.setRemoteDescription({type:"offer",sdp:e})}).then(function(){return t.LO.createAnswer()}).then(function(e){return t.LO.setLocalDescription(e)}).then(this.RO)},t.prototype.TO=function(){var t=this;return this.LO.addTransceiver("video",{direction:"recvonly"}),this.LO.addTransceiver("audio",{direction:"recvonly"}),this.LO.createOffer().then(function(e){return t.LO.setLocalDescription(e)}).then(this.RO)},t.prototype.UO=function(){return this.QO(),this.KO===n.Client?this.TO():this.SO()},t.prototype.ZO=function(){return this.QO(),this.MO=!1,this.KO===n.Client?this.eO():this.dO()},t.prototype.bO=function(t,e,i){return new s.DefaultContentLoader(this.context,{requestType:i}).load(this.channelUrl,t,u.HttpResponseType.TEXT,e,c)},t.prototype.cO=function(){var t=this;return this.KO!==n.Server?Promise.resolve(""):this.bO(u.HttpRequestMethod.POST,"",u.HttpRequestType.WEBRTC_SDP_REQUEST).then(function(e){var i,n,o,r;return t.zN=null!==(r=null!==(n=null===(i=e.headers)||void 0===i?void 0:i.Location)&&void 0!==n?n:null===(o=e.headers)||void 0===o?void 0:o.location)&&void 0!==r?r:"",String(e.body)}).catch(this.aO)},t.prototype.dO=function(){var t;if(this.KO!==n.Server)return Promise.resolve();var e=this.LO.localDescription;return this.bO(u.HttpRequestMethod.PATCH,null!==(t=null==e?void 0:e.sdp)&&void 0!==t?t:"",u.HttpRequestType.WEBRTC_SDP_ANSWER).then(function(t){}).catch(this.aO)},t.prototype.eO=function(){var t,e=this;if(this.KO!==n.Client)return Promise.resolve();var i=this.LO.localDescription;return this.bO(u.HttpRequestMethod.POST,null!==(t=null==i?void 0:i.sdp)&&void 0!==t?t:"",u.HttpRequestType.WEBRTC_SDP_OFFER).then(function(t){var i,o,r,s;return"string"==typeof t.body?(e.zN=null!==(s=null!==(o=null===(i=t.headers)||void 0===i?void 0:i.Location)&&void 0!==o?o:null===(r=t.headers)||void 0===r?void 0:r.location)&&void 0!==s?s:"",e.LO.setRemoteDescription({type:"answer",sdp:t.body})):(400===t.status&&(e.KO=n.Server,e.reconnectCallback()),Promise.resolve())}).catch(this.aO)},t.prototype.dispose=function(){this.PO(this.LO)},t}();e.WhepAdapter=h}},function(t){return function(){return t(69100)}()}])});
|
|
17
|
+
"use strict";!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["engine-webrtc"]=e():(t.bitmovin=t.bitmovin||{},t.bitmovin.player=t.bitmovin.player||{},t.bitmovin.player["engine-webrtc"]=e())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[497],{69100:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.WhepModuleDefinition=void 0;var n=i(62756),o=i(3392),r=i(75801);e.WhepModuleDefinition={name:n.ModuleName.EngineWebRtc,module:{WebRtcPlayer:r.WebRtcPlayer,technologyChecker:new o.TechnologyChecker}},e.default=e.WhepModuleDefinition},3392:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.TechnologyChecker=void 0;var n=i(44468),o=function(){function t(){}return t.prototype.getSupportedTechnologies=function(){return[{player:n.PlayerType.WebRtc,streaming:n.StreamType.Whep}]},t}();e.TechnologyChecker=o},75801:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.WebRtcPlayer=void 0;var n=i(40306),o=i(3336),r=i(80813),s=i(3714),u=i(44468),a=i(15487),c=i(88844),h=i(19274),l=i(8204),d="not available",p=function(){function t(t){var e=this;if(this.context=t,this.preload=f,this.setAudioQuality=f,this.setVideoQuality=f,this.setTargetBufferLevel=f,this.updateCallback=f,this.setQueryParameters=f,this.clearQueryParameters=f,this.timeShift=f,this.removeSubtitle=f,this.setAudio=f,this.permitControl=f,this.onFullscreenEnter=f,this.onFullscreenExit=f,this.showAirplayTargetPicker=f,this.setTargetLatency=f,this.setCatchupConfig=f,this.setFallbackConfig=f,this.getManifest=v,this.getAudio=v,this.getLatency=v,this.getTargetLatency=v,this.getCatchupConfig=v,this.getFallbackConfig=v,this.createManifestApi=v,this.pause=function(){return e.ek.pause()},this.seek=function(){return!1},this.isPlaying=function(){return!e.ek.paused},this.isPaused=function(){return e.ek.paused},this.hasEnded=function(){return e.ek.ended},this.isMuted=function(){return e.ek.muted},this.isStalled=function(){return!1},this.isLive=function(){return!0},this.getVolume=function(){return 100*e.ek.volume},this.getCurrentTime=function(){return e.ek.currentTime},this.getDuration=function(){return 1/0},this.getAvailableVideoQualities=function(){return[]},this.getAvailableAudioQualities=function(){return[]},this.getDroppedVideoFrames=function(){return e.ek.droppedVideoFrames},this.getTotalStalledTime=function(){return 0},this.getBufferedRanges=function(){return[]},this.getMaxTimeShift=function(){return 0},this.getTimeShift=function(){return 0},this.addSubtitle=function(){return Promise.reject()},this.enableSubtitle=function(){return Promise.resolve(!1)},this.disableSubtitle=function(){return Promise.resolve(!1)},this.listSubtitles=function(){return[]},this.getAvailableAudio=function(){return[]},this.getSnapshot=function(){},this.getPlaybackSpeed=function(){var t,i;return null!==(i=null===(t=e.ek)||void 0===t?void 0:t.playbackRate)&&void 0!==i?i:1},this.isAirplayAvailable=function(){return!1},this.isAirplayActive=function(){return!1},this.getSeekableRange=function(){return{start:-1,end:-1}},this.getAvailableSegments=function(){return{}},this.getDownloadedVideoData=function(){return{id:d,bitrate:0,height:0,width:0,isAuto:!0}},this.getDownloadedAudioData=function(){return{id:d,bitrate:0,isAuto:!0}},this.getPlaybackVideoData=function(){return{id:d,bitrate:0,height:e.ek.videoHeight,width:e.ek.videoWidth}},this.getPlaybackAudioData=function(){return{id:d,bitrate:0}},this.getAudioQuality=this.getPlaybackAudioData,this.getVideoQuality=this.getPlaybackVideoData,this.getBufferLevel=function(t,e){return{level:null,targetLevel:null,type:t,media:null!=e?e:u.MediaType.Video}},this.sk=function(){var t;null===(t=e.pk)||void 0===t||t.transitionToPlayingState("webrtc")},this.tk=function(){var t;null===(t=e.pk)||void 0===t||t.transitionToPausedState(!0,"webrtc")},this.uk=function(){e.context.eventHandler.dispatchEvent(s.PlayerEvent.TimeChanged,{time:e.ek.currentTime})},this.vk=function(){var t,i;if("failed"===(null===(t=e.ok)||void 0===t?void 0:t.connectionState)){if(e.ok.close(),e.lk<=0)return void e.context.eventHandler.fireError(new o.PlayerError(n.ErrorCode.SOURCE_ERROR,void 0,"WebRTC peer connection failed",e.context.sourceContext.sourceIdentifier));e.Bk().catch(function(t){}),e.lk--}else"connected"===(null===(i=e.ok)||void 0===i?void 0:i.connectionState)&&(e.lk=2)},this.wk=function(){void 0!==e.ok&&(e.ok.close(),e.ek.srcObject=null,e.ok=e.zk(),e.jk.resetPeer(e.ok),e.jk.connect().catch(function(t){}))},this.xk=function(){var t;if(void 0!==e.ok){var i=0;null===(t=e.ok)||void 0===t||t.getStats(null).then(function(t){var n=[];t.forEach(function(t){n.push(t),t.type.match("inbound-rtp")&&(i+=t.bytesReceived)}),i<=e.hk?(e.nk+=e.dk,!1===e.mk&&e.nk>=e.gk&&(e.mk=!0)):(e.hk=i,e.nk=0,!0===e.mk&&(e.mk=!1))}).catch(function(t){})}},this.Ak=function(t){for(var i=0,n=t.streams;i<n.length;i++){var o=n[i];"feedbackvideomslabel"===o.id||e.ek.srcObject||(e.ek.srcObject=o)}},void 0===this.context.videoElement)throw new o.PlayerError(n.ErrorCode.SETUP_ERROR);this.hk=0,this.nk=0,this.mk=!1,this.ek=this.context.videoElement,this.lk=2,this.dk=2e3,this.gk=3e4,this.fk=[{urls:"stun:stun.l.google.com:19302"}]}return t.prototype.qk=function(){this.ek.addEventListener(h.MediaElementEvent.pause,this.tk),this.ek.addEventListener(h.MediaElementEvent.playing,this.sk),this.ek.addEventListener(h.MediaElementEvent.timeupdate,this.uk)},t.prototype.rk=function(){this.ek.removeEventListener(h.MediaElementEvent.pause,this.tk),this.ek.removeEventListener(h.MediaElementEvent.playing,this.sk),this.ek.removeEventListener(h.MediaElementEvent.timeupdate,this.uk)},t.prototype.load=function(t){return"string"!=typeof t.url?Promise.reject("Invalid source config"):(this.qk(),this.lk=2,this.kk=t.url,this.Bk())},t.prototype.yk=function(){var t={iceServers:this.fk};return(0,a.isTizen2020)()&&(t.sdpSemantics="unified-plan"),t},t.prototype.zk=function(){var t=new RTCPeerConnection(this.yk());return t.onconnectionstatechange=this.vk,t.ontrack=this.Ak,t},t.prototype.Bk=function(){return this.ok=this.zk(),void 0===this.kk?Promise.reject(new o.PlayerError(n.ErrorCode.SOURCE_INVALID,void 0,"WHEP channel URL is undefined",this.context.sourceContext.sourceIdentifier)):(void 0!==this.jk&&this.jk.dispose(),this.jk=new l.WhepAdapter(this.context,this.ok,this.kk,this.wk),this.ik=window.setInterval(this.xk,this.dk),this.jk.connect())},t.prototype.stop=function(){var t;(0,c.clearIntervalIfDefined)(this.ik),this.ik=void 0,this.jk.dispose(),null===(t=this.ok)||void 0===t||t.close(),this.ek.srcObject=null,this.ek.load()},t.prototype.play=function(){var t;return null===(t=this.pk)||void 0===t||t.transitionToPlayState(!0,"webrtc"),this.ek.play()},t.prototype.mute=function(){this.ek.muted||(this.ek.muted=!0,this.context.eventHandler.dispatchEvent(s.PlayerEvent.Muted))},t.prototype.unmute=function(){this.ek.muted&&(this.ek.muted=!1,this.context.eventHandler.dispatchEvent(s.PlayerEvent.Unmuted))},t.prototype.destroy=function(){this.stop()},t.prototype.setVolume=function(t){var e=this.getVolume();this.ek.volume=Math.min(t/100,1),this.context.eventHandler.dispatchEvent(s.PlayerEvent.VolumeChanged,{sourceVolume:e,targetVolume:t})},t.prototype.prepareLoad=function(){return this.pk=this.context.serviceManager.get(r.ServiceName.PlayerStateService),Promise.resolve()},t.prototype.prepareSource=function(t,e){return Promise.resolve()},t.prototype.unload=function(){var t=null!==this.ek.srcObject;return this.rk(),this.stop(),t&&this.context.eventHandler.dispatchEvent(s.PlayerEvent.SourceUnloaded),Promise.resolve()},t.prototype.setPlaybackSpeed=function(t){this.ek.playbackRate=t},t.prototype.release=function(){return this.rk(),this.destroy(),this.unload()},t}();function f(){}function v(){return null}e.WebRtcPlayer=p},8204:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.WhepAdapter=void 0;var n,o=i(40306),r=i(3336),s=i(4129),u=i(29669),a=i(88844),c={"Content-Type":"application/sdp"};!function(t){t[t.Client=0]="Client",t[t.Server=1]="Server"}(n||(n={}));var h=function(){function t(t,e,i,s){var u=this;this.context=t,this.channelUrl=i,this.reconnectCallback=s,this.VP=function(){u.GO=!0,u.HO=window.setTimeout(u.cP,2e3)},this.ZP=function(t){"icecandidate"===t.type&&t.candidate},this.aP=function(t){var e=t instanceof r.PlayerError?t:new r.PlayerError(o.ErrorCode.SOURCE_INVALID,{error:t},"ICE gathering failed",u.context.sourceContext.sourceIdentifier);u.context.eventHandler.fireError(e)},this.bP=function(){"complete"===u.FO.iceGatheringState&&u.GO&&u.dP().catch(u.aP)},this.cP=function(){u.GO&&u.dP().catch(u.aP)},this.eP=function(t){return Promise.reject(new r.PlayerError(o.ErrorCode.NETWORK_ERROR,{status:t.status,statusText:t.statusText,body:t.body},"WHEP network request failed with status ".concat(t.status),u.context.sourceContext.sourceIdentifier))},this.EO=n.Client,this.FO=e,this.resetPeer(e)}return t.prototype.IO=function(t){t.addEventListener("icecandidate",this.ZP),t.addEventListener("icegatheringstatechange",this.bP)},t.prototype.JO=function(t){t.removeEventListener("icecandidate",this.ZP),t.removeEventListener("icegatheringstatechange",this.bP)},t.prototype.resetPeer=function(t){this.JO(this.FO),this.IO(t),this.FO=t},t.prototype.connect=function(){return this.YP()},t.prototype.UP=function(){(0,a.clearTimeoutIfDefined)(this.HO),this.HO=void 0},t.prototype.WP=function(){var t=this;return this.gP().then(function(e){return t.FO.setRemoteDescription({type:"offer",sdp:e})}).then(function(){return t.FO.createAnswer()}).then(function(e){return t.FO.setLocalDescription(e)}).then(this.VP)},t.prototype.XP=function(){var t=this;return this.FO.addTransceiver("video",{direction:"recvonly"}),this.FO.addTransceiver("audio",{direction:"recvonly"}),this.FO.createOffer().then(function(e){return t.FO.setLocalDescription(e)}).then(this.VP)},t.prototype.YP=function(){return this.UP(),this.EO===n.Client?this.XP():this.WP()},t.prototype.dP=function(){return this.UP(),this.GO=!1,this.EO===n.Client?this.iP():this.hP()},t.prototype.fP=function(t,e,i){return new s.DefaultContentLoader(this.context,{requestType:i}).load(this.channelUrl,t,u.HttpResponseType.TEXT,e,c)},t.prototype.gP=function(){var t=this;return this.EO!==n.Server?Promise.resolve(""):this.fP(u.HttpRequestMethod.POST,"",u.HttpRequestType.WEBRTC_SDP_REQUEST).then(function(e){var i,n,o,r;return t.DO=null!==(r=null!==(n=null===(i=e.headers)||void 0===i?void 0:i.Location)&&void 0!==n?n:null===(o=e.headers)||void 0===o?void 0:o.location)&&void 0!==r?r:"",String(e.body)}).catch(this.eP)},t.prototype.hP=function(){var t;if(this.EO!==n.Server)return Promise.resolve();var e=this.FO.localDescription;return this.fP(u.HttpRequestMethod.PATCH,null!==(t=null==e?void 0:e.sdp)&&void 0!==t?t:"",u.HttpRequestType.WEBRTC_SDP_ANSWER).then(function(t){}).catch(this.eP)},t.prototype.iP=function(){var t,e=this;if(this.EO!==n.Client)return Promise.resolve();var i=this.FO.localDescription;return this.fP(u.HttpRequestMethod.POST,null!==(t=null==i?void 0:i.sdp)&&void 0!==t?t:"",u.HttpRequestType.WEBRTC_SDP_OFFER).then(function(t){var i,o,r,s;return"string"==typeof t.body?(e.DO=null!==(s=null!==(o=null===(i=t.headers)||void 0===i?void 0:i.Location)&&void 0!==o?o:null===(r=t.headers)||void 0===r?void 0:r.location)&&void 0!==s?s:"",e.FO.setRemoteDescription({type:"answer",sdp:t.body})):(400===t.status&&(e.EO=n.Server,e.reconnectCallback()),Promise.resolve())}).catch(this.eP)},t.prototype.dispose=function(){this.JO(this.FO)},t}();e.WhepAdapter=h}},function(t){return function(){return t(69100)}()}])});
|
|
18
18
|
})();
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* This software includes open-source components. See THIRD_PARTY_NOTICES
|
|
10
10
|
* in the distribution for details.
|
|
11
11
|
*
|
|
12
|
-
* Bitmovin Player Version 8.
|
|
12
|
+
* Bitmovin Player Version 8.281.0
|
|
13
13
|
*
|
|
14
14
|
****************************************************************************/
|
|
15
15
|
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* This software includes open-source components. See THIRD_PARTY_NOTICES
|
|
10
10
|
* in the distribution for details.
|
|
11
11
|
*
|
|
12
|
-
* Bitmovin Player Version 8.
|
|
12
|
+
* Bitmovin Player Version 8.281.0
|
|
13
13
|
*
|
|
14
14
|
****************************************************************************/
|
|
15
15
|
|