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(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.webos=t():(e.bitmovin=e.bitmovin||{},e.bitmovin.player=e.bitmovin.player||{},e.bitmovin.player.webos=t())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[137],{84276:function(e,t,n){var i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseMediaDecodeTimeHandler=t.PtoGapFillingMode=void 0;var r,o=n(4524),a=n(80813),s=n(87827),u=n(68925),c=n(47602),l=n(19483),f=n(34841),d=n(87244),p=n(85434),m=n(15487),g=n(89927),h=n(19274),v=n(88052),y=n(62756),T=n(44885),b=n(73849),M=n(8301),E=n(48558),W=n(21651);!function(e){e.KeepGaps="keep-gaps",e.FillGaps="fill-gaps"}(r||(t.PtoGapFillingMode=r={}));var O=function(){function e(e,t,n,a){var s=this;this.maxSafeBaseMediaDecodeTime=n,this.maxSafePresentationTimeOffset=a,this.vW=function(){s.xW(s.mW.settings.END_OF_BUFFER_TOLERANCE)},this.wW=function(){s.xW(s.mW.settings.END_OF_BUFFER_RECOVERY_TOLERANCE)},this.CW=function(){if(s.mW.videoElement)try{var e=s.BW(),t=s.mW.videoElement.currentTime,n=s.yW(t).mapEach(function(e){return e.playbackRange}).mapAll(function(e){return o.BufferRangeHelper.mergeRanges(e,s.mW.settings.GAP_TOLERANCE)}).getObject(),r=o.BufferRangeHelper.getCommonBufferedRanges(i(i({},n),{bufferedRanges:e})).shift();if(void 0!==r){var a=r.getStart();s.mW.logger.debug("continuing playback at ".concat(a," (from ").concat(t,")")),s.mW.videoElement.currentTime=a,s.zW(),s.mW.videoElement.eventHandler.removeEventListener(h.MediaElementEvent.currenttimenotadvancing,s.wW),s.tW().finally(function(){var e;return null===(e=s.kW())||void 0===e?void 0:e.dispatch((0,u.setTimestampRollingOver)(!1))}).then(function(){s.mW.logger.debug("successfully cleared previous buffers")}).catch(function(e){s.mW.logger.debug("could not clear previous buffers:",e)})}else s.AW()}catch(e){s.mW.logger.debug("could not handle timestamp overflow:",e)}else s.mW.logger.debug("Could not handle timestamp overflow: Video Element is not defined")},this.mW=e,this.sW=r.KeepGaps,this.qW=t,this.nW=void 0,this.pW=new Map,this.oW=new W.SegmentTimeInformationArrayMap,this.mW.videoElement?(this.mW.videoElement.addEventListener(h.MediaElementEvent.waiting,this.wW),this.mW.videoElement.addEventListener(h.MediaElementEvent.stalled,this.wW),this.mW.videoElement.addEventListener(h.MediaElementEvent.timeupdate,this.vW),e.logger.debug("BaseMediaDecodeTime limit is set to ".concat(S(n)," bits")),e.logger.debug("PresentationTimeOffset limit is set to ".concat(S(a)," bits")),e.settings.FORCE_BASE_MEDIA_DECODE_TIME_REWRITE&&e.logger.debug("BaseMediaDecodeTime rewriting is forced!")):e.logger.debug("Could not set up BaseMediaDecodeTime rewriting: Video Element is not defined")}return e.prototype.tW=function(){var e=this,t=[];return this.uW().keys.forEach(function(n){t.push(e.qW(n))}),Promise.all(t).then(function(){})},e.prototype.getEndOfBufferTime=function(){var e=o.BufferRangeHelper.getCommonBufferedRanges(this.uW(!0).getObject()).sort(function(e,t){return e.getStart()-t.getStart()});return e.length>0?e[e.length-1].getEnd():0},e.prototype.setPtoGapFillingMode=function(e){this.sW=e},e.prototype.getEarliestExternalTimeBufferedRangeIndex=function(e){var t=0;try{for(var n=void 0,i=0;i<e.length;i++){var r=this.mapToExternalTime(e.start(i));(void 0===n||r<n)&&(n=r,t=i)}}catch(e){this.mW.logger.debug("Could not determine buffer region offset:",e)}return t},e.prototype.uW=function(e){var t=this;return void 0===e&&(e=!1),this.oW.mapEach(function(t){return e?t.originalPlaybackRange:t.playbackRange}).mapAll(function(e){return o.BufferRangeHelper.mergeRanges(e,t.mW.settings.GAP_TOLERANCE)})},e.prototype.xW=function(e){var t,n,i=this.mW.videoElement;if(i){var r=i.currentTime;if(!(r>=i.duration&&i.duration>0)){var o=i.buffered;if(o.length<2)null===(t=this.kW())||void 0===t||t.dispatch((0,u.setTimestampRollingOver)(!1));else if(0!==this.getEarliestExternalTimeBufferedRangeIndex(o)){var a=o.end(o.length-1);r>=a-Math.max(this.mW.settings.MINIMAL_BACKWARD_BUFFER_CLEARING_INTERVAL,this.mW.settings.END_OF_BUFFER_TOLERANCE,this.mW.settings.END_OF_BUFFER_RECOVERY_TOLERANCE)&&(null===(n=this.kW())||void 0===n||n.dispatch((0,u.setTimestampRollingOver)(!0))),r>=a-e&&this.CW()}}}},e.prototype.yW=function(e){var t=this,n=this.mW.settings.GAP_TOLERANCE,i=new l.ArrayMap;return this.oW.keys.forEach(function(r){var o=!1,a=-1/0,s=t.oW.get(r),u=!1;s.sort(function(e,t){return e.originalPlaybackTime-t.originalPlaybackTime});var c=s.filter(function(t){var i=t.playbackRange,r=i.start-n<=e&&i.end+n>=e;if(u=u||r,!isFinite(a)&&r)a=t.playbackTime;else if(isFinite(a))return o=o||t.playbackTime<a;return!1});0!==c.length||u||(s.sort(function(e,t){return e.originalPlaybackTime-t.originalPlaybackTime}),c=s.filter(function(t){return t.playbackRange.end<e})),i.addAll(r,c)}),i},e.prototype.zW=function(){void 0!==this.nW&&(this.nW(),this.nW=void 0)},e.prototype.AW=function(){var e=this,t=this.kW();void 0!==t&&(this.zW(),this.nW=(0,c.subscribeToRendererBufferChanges)(t,function(){return e.wW()}))},e.prototype.BW=function(){var e,t=[],n=null===(e=this.mW.videoElement)||void 0===e?void 0:e.buffered;if(!function(e){return 0!==(null==e?void 0:e.length)}(n))return[];for(var i=0;i<n.length;i++)t.push({start:n.start(i),end:n.end(i)});return t},e.prototype.DW=function(e){var t,n=e.getMimeType(),i=e.getPlaybackTimeRange();if(void 0!==i){var r=(null!==(t=this.oW.get(n))&&void 0!==t?t:[]).filter(function(e){return e.originalPlaybackRange.end<i.end});return r[r.length-1]}},e.prototype.EW=function(e){var t=this,n=!1,i=!1,o=new W.SegmentTimeInformationArrayMap;return this.oW.keys.forEach(function(e){return(0,T.ensureMimeTypeInMap)(o,e)}),e.forEach(function(e){if(!e.isDirty()){var a=new E.SegmentTimeInformation(e,t.maxSafeBaseMediaDecodeTime),s=a.presentationTimeOffset/a.timescale,u=t.XW(s),c=t.YW(a);(n=n||u||c||t.mW.settings.FORCE_BASE_MEDIA_DECODE_TIME_REWRITE||t.TW(a)||t.UW(a,a.baseMediaDecodeTime,a.presentationTimeOffset))&&(a.isBaseMediaDecodeTimeLimitExceeded=!0,t.mW.logger.debug("BaseMediaDecodeTime (".concat(a.originalBaseMediaDecodeTime,") exceeding limit for ").concat(a.mimeType," segment")));var l=t.DW(e),f=l?l.originalPresentationTimeOffset/l.timescale:s;f===s||t.sW!==r.FillGaps&&!(null==l?void 0:l.isBaseMediaDecodeTimeLimitExceeded)||(t.mW.logger.debug("Detected a presentation time offset change: ".concat(f," -> ").concat(s),{precedingSegmentTimeInfo:null==l?void 0:l.segmentUrl}),i=!0),(0,T.addSegmentTimeInfoToMap)(o,a.mimeType,a)}}),[n,i,o]},e.prototype.FW=function(e){return v.ModuleManager.has(y.ModuleName.ContainerMP4)?e.getTFDTBoxOffsets()||v.ModuleManager.get(y.ModuleName.ContainerMP4).parseTfdtBoxOffsets(e):(this.mW.logger.debug("Can't rewrite BMDT for TS segment as MP4 module is not available"),[])},e.prototype.GW=function(e,t){var n=this.FW(e);e.setTFDTBoxOffsets(n);var i=e.getBaseMediaDecodeTime()-t.truncatedBaseMediaDecodeTime;e.getTFDTBoxOffsets().forEach(function(t){var n=0,r=new DataView(e.getData(),t),o=r.getUint32(n);n+=4;var a=String.fromCharCode(r.getUint8(n++),r.getUint8(n++),r.getUint8(n++),r.getUint8(n++));if(n+=1===o?8:0,"tfdt"===a){var s=r.getUint8(n);n+=4,1===s?function(e,t,n){var i=e.getUint32(t),r=e.getUint32(t+4),o=i*Math.pow(2,32)+r-n;e.setUint32(t,Math.floor(o/Math.pow(2,32))),t+=4,e.setUint32(t,o)}(r,n,i):function(e,t,n){var i=e.getUint32(t)-n;e.setUint32(t,i)}(r,n,i)}}),e.setBaseMediaDecodeTime(t.truncatedBaseMediaDecodeTime),e.setDirty(!0)},e.prototype.HW=function(e,t){var n=this;t.forAll(function(t,i){(0,T.addSegmentTimeInfoToMap)(n.oW,t,i);var r=i.getMatchingSegment(e);r&&n.GW(r,i)})},e.prototype.IW=function(e,t){return e.reduce(function(e,n){var i=t(n),r=Math.floor(i/n.timescale);return!isFinite(e)&&isFinite(r)||r<e?r:e},-1/0)},e.prototype.JW=function(e,t){var n=this;return Math.min.apply(Math,e.transform(function(e){return n.IW(e,t)}))},e.prototype.KW=function(e){return this.JW(e,function(e){return e.truncatedBaseMediaDecodeTime-e.truncatedPresentationTimeOffset})},e.prototype.LW=function(e){return this.JW(e,function(e){return e.originalPresentationTimeOffset})},e.prototype.MW=function(e){var t={},n=this.LW(e);isFinite(n)?(e.forAll(function(e,i){var r=i.timescale,o=i.originalBaseMediaDecodeTime,a=i.originalPresentationTimeOffset,s=Math.floor(a-n*r),u=a-s,c=o-u,l=Math.floor(u/r);i.truncatedBaseMediaDecodeTime=c,i.truncatedPresentationTimeOffset=s,t.hasOwnProperty(e)||(t[e]=l)}),this.NW(t)):this.mW.logger.debug("Could not determine common PresentationTimeOffset divisor")},e.prototype.NW=function(e){var t=this;Object.keys(e).forEach(function(n){var i=t.pW.get(n);i&&i.resolve(e[n]);var r=new f.Deferred;t.pW.set(n,r),r.resolve(e[n])})},e.prototype.OW=function(e,t){var n,i=this,r=this.KW(t);isFinite(r)?(t.forAll(function(t,n){var o=n.getMatchingSegment(e);o&&i.PW(o,n,r),(0,T.addSegmentTimeInfoToMap)(i.oW,t,n)}),null===(n=this.mW.videoElement)||void 0===n||n.addEventListener(h.MediaElementEvent.currenttimenotadvancing,this.wW)):this.mW.logger.debug("Could not determine common BaseMediaDecideTime divisor")},e.prototype.PW=function(e,t,n){t.truncatedBaseMediaDecodeTime=t.truncatedBaseMediaDecodeTime-t.timescale*n,t.truncatedPlaybackTime=(t.truncatedBaseMediaDecodeTime-t.truncatedPresentationTimeOffset)/t.timescale,this.GW(e,t)},e.prototype.QW=function(e){for(var t,n,i=e.keys,o=e.getAll(),a=[],s=1/0,u=0,c=i;u<c.length;u++){var l=c[u],f=(null!==(t=this.oW.get(l))&&void 0!==t?t:[]).filter(function(e){return!o.includes(e)&&!e.isReferenceSegment});f.sort(function(e,t){return e.originalPlaybackTime-t.originalPlaybackTime});var d=f.pop(),p=null!==(n=null==d?void 0:d.playbackRange.end)&&void 0!==n?n:1/0,m=e.get(l)||[];if(0===m.length)return 1/0;var g=Math.min.apply(Math,m.map(function(e){return e.playbackTime})),h=g-p;s=Math.min(s,g),isFinite(h)&&a.push(h)}if(a.length!==i.length)return this.mW.logger.debug("No segments to align with end of buffer"),0;var v=s-this.mW.settings.GAP_TOLERANCE,y=this.sW===r.KeepGaps?Math.min.apply(Math,a):Math.max.apply(Math,a);return Math.min(y,v)},e.prototype.RW=function(e,t){var n=this,i=this.QW(t),r=!0;if(t.forAll(function(e,o){if(r){var a=o.timescale,s=i*a,u=o.truncatedPresentationTimeOffset+s,c=o.truncatedBaseMediaDecodeTime;n.VW(c,u,o,t)||(n.mW.logger.debug("Cannot shift segments to EOB: would exceed timestamp limits for ".concat(e)),r=!1)}}),r){this.mW.logger.debug("Aligning segments with EOB by shifting ".concat(i," seconds"));var o={};t.forAll(function(e,t){var n=t.timescale,r=i*n;t.updateAsContinuous(t.truncatedBaseMediaDecodeTime,t.truncatedPresentationTimeOffset+r);var a=t.originalPresentationTimeOffset-t.truncatedPresentationTimeOffset;o[e]=a/t.timescale}),this.NW(o),e.forEach(function(e){return e.setDirty(!0)})}else this.mW.logger.debug("Cannot align segments with end of buffer: would exceed timestamp limits")},e.prototype.SW=function(e,t,n){return 0===t.length||(t.keys.every(function(e){return(t.get(e)||[]).length>0})?(this.MW(t),this.OW(e,t),n&&this.RW(e,t),!0):(this.mW.logger.debug("Could not handle BaseMediaDecodeTime overflow: at least one buffer is empty"),!1))},e.prototype.TW=function(e){var t;if(e.isBaseMediaDecodeTimeLimitExceeded)return!0;var n=(0,b.getLargestPrecedingSegmentTimeInfo)(null!==(t=this.oW.get(e.mimeType))&&void 0!==t?t:[],e.originalPlaybackTime);return!!n&&isFinite(n.truncatedBaseMediaDecodeTime)&&n.truncatedBaseMediaDecodeTime!==n.originalBaseMediaDecodeTime},e.prototype.UW=function(e,t,n){var i,r=e.duration,o=e.timescale,a=e.mimeType,s=this.oW.keys.find(function(e){return e!==a});if(!s)return!1;var u=null===(i=this.oW.get(s))||void 0===i?void 0:i.slice(-1)[0];if(!u)return!1;var c=(t+n)/o,l={start:c,end:c+r},f=u.playbackTime+u.duration,d={start:f,end:f+u.duration},p=Math.max(l.start,d.start);return!(Math.min(l.end,d.end)-p<=r/2)&&d.end*u.timescale-u.presentationTimeOffset>this.maxSafeBaseMediaDecodeTime},e.prototype.VW=function(e,t,n,i){var r=this,o=n.duration,a=n.timescale;if(e+o*a>this.maxSafeBaseMediaDecodeTime)return this.mW.logger.debug("Detected BMDT overflow for ".concat(n.mimeType," segment")),!1;if(this.UW(n,e,t))return this.mW.logger.debug("Triggering early BMDT overflow for ".concat(n.mimeType," segment")),!1;var s=t/a,u=e/a+o,c=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=[];return e.forEach(function(e){e.forAll(function(e,t){n.includes(t.timescale)||n.push(t.timescale)})}),n}(i,this.oW);return c.every(function(e){return r.WW(s,u,e)})},e.prototype.WW=function(e,t,n){return t*n+e*n<=this.maxSafeBaseMediaDecodeTime},e.prototype.XW=function(e){return Math.abs(e)>this.maxSafePresentationTimeOffset},e.prototype.YW=function(e){if(!(0,m.isTizen2017)())return!1;var t=e.originalPlaybackTime,n=e.duration,i=e.mimeType,r=t+n>(0,g.toSeconds)(this.maxSafeBaseMediaDecodeTime);return p.MimeTypeHelper.isAudio(i)&&r},e.prototype.ZW=function(e,t){if(this.mW.settings.FORCE_BASE_MEDIA_DECODE_TIME_REWRITE)return!0;var n=e/t.timescale;return!!this.XW(n)||this.YW(t)},e.prototype.aW=function(e,t,n){var i=e.baseMediaDecodeTime,r=e.presentationTimeOffset,o=e.foundMatchingPreviousSegment,a=!this.VW(i,r,t,n);return o?a:a||this.ZW(r,t)},e.prototype.bW=function(e){var t=this,n=new l.ArrayMap,i=new l.ArrayMap;return e.keys.forEach(function(r){var o;(0,T.ensureMimeTypeInMap)(n,r),(0,T.ensureMimeTypeInMap)(i,r),(0,T.ensureMimeTypeInMap)(t.oW,r);var a=null!==(o=t.oW.get(r))&&void 0!==o?o:[],s=a.length?a:t.oW.getAllValues();(e.get(r)||[]).forEach(function(r){var o=(0,b.findOverflowDataForSegmentInMap)(r,s,t.mW.settings.GAP_TOLERANCE,t.mW.logger);if(t.aW(o,r,e))t.mW.logger.debug("Segment added to discontinuous time info map.",r.segmentUrl,r.mimeType),r.updateAsDiscontinuous(),(0,T.addSegmentTimeInfoToMap)(i,r.mimeType,r);else{var a=o.baseMediaDecodeTime,u=o.presentationTimeOffset;r.updateAsContinuous(a,u),(0,T.addSegmentTimeInfoToMap)(n,r.mimeType,r)}})}),{discontinuousSegmentTimeInfoMap:i,continuousSegmentTimeInfoMap:n}},e.prototype.cW=function(e,t,n){var i,r=this.bW(t),o=r.discontinuousSegmentTimeInfoMap,a=r.continuousSegmentTimeInfoMap;if(this.HW(e,a),this.SW(e,o,n))return!0;var s=(0,M.maybeSwitchOverASegmentToDiscontinuous)({continuousSegmentTimeInfoMap:a,discontinuousSegmentTimeInfoMap:o});if(!s){var u=this.bW(this.oW);s=(0,M.maybeSwitchOverASegmentToDiscontinuous)({continuousSegmentTimeInfoMap:u.continuousSegmentTimeInfoMap,discontinuousSegmentTimeInfoMap:o}),this.mW.logger.debug("Did not find any matching segment time info in current map, retried with existing ones.",s)}return!!s&&(this.mW.logger.debug("Moved ".concat(s.mimeType," segment from continued to discontinued. Trying to process discontinued infos again."),{switchedSegmentUrl:s.segmentUrl,matchingSegmentUrl:null===(i=s.getMatchingSegment(e))||void 0===i?void 0:i.getUrl()}),this.SW(e,o,n))},e.prototype.dW=function(e){var t=this;e.forAll(function(e,n){var i;(null===(i=t.oW.get(e))||void 0===i?void 0:i.find(n.equals))||(0,T.addSegmentTimeInfoToMap)(t.oW,n.mimeType,n);var r=t.pW.get(n.mimeType);r&&r.resolve(0)})},e.prototype.eW=function(e){return e.every(function(e){return p.MimeTypeHelper.isMP4(e.getMimeType())})},e.prototype.fW=function(){this.maxSafeBaseMediaDecodeTime=1/0,this.maxSafePresentationTimeOffset=1/0},e.prototype.gW=function(){return this.maxSafeBaseMediaDecodeTime!==1/0||this.maxSafePresentationTimeOffset!==1/0},e.prototype.rewriteTimeStampsIfNecessary=function(e){var t;!this.eW(e)&&this.gW()&&(this.mW.logger.debug("Disabling BMDT rewriting due to unsupported container format"),this.fW());var n=this.hW(),i=e.map(E.getSectionId).reduce(D,[]).some(function(e){return!n.includes(e)}),r=function(e){return e.reduce(function(e,t){return e.includes(t.getMimeType())||e.push(t.getMimeType()),e},[])}(e),o=this.oW.keys.every(function(e){return r.includes(e)});if(i&&!o)return this.mW.logger.debug("Cannot check for rewriting necessity - not all buffers have data yet"),!1;var a=this.EW(e),s=a[0],u=a[1],c=a[2];if(s)return this.cW(e,c,u);if(i&&u)return this.iW(e,c),!0;for(var l=0,f=c.getAllValues();l<f.length;l++){var d=f[l],p=d.mimeType,m=null!==(t=this.oW.get(p))&&void 0!==t?t:[],g=(0,b.findPrecedingSegmentTimeInfo)(m,d,this.mW.settings.GAP_TOLERANCE);(null==g?void 0:g.isBaseMediaDecodeTimeLimitExceeded)&&!d.isBaseMediaDecodeTimeLimitExceeded&&(d.updateAsDiscontinuous(),d.updateAsContinuous(d.originalBaseMediaDecodeTime,g.truncatedPresentationTimeOffset))}return this.dW(c),!0},e.prototype.hW=function(){return this.oW.transform(function(e){return e.map(function(e){return e.sectionId})}).flatMap(function(e){return e}).reduce(D,[])},e.prototype.iW=function(e,t){var n={},i=this.QW(t);this.mW.logger.debug("Trying to handle PTO change, required shift: ".concat(i,"s")),t.forAll(function(e,t){var r=-i*t.timescale,o=r/t.timescale;t.isBaseMediaDecodeTimeLimitExceeded=!0,t.updateAsContinuous(t.originalBaseMediaDecodeTime,t.originalPresentationTimeOffset-r),n[t.mimeType]=o}),this.NW(n),this.dW(t),e.forEach(function(e){return e.setDirty(!0)})},e.prototype.signalBufferRemoval=function(e,t,n){var i;if(this.oW.has(e)){var r=o.BufferRangeHelper.mergeRanges(t,this.mW.settings.GAP_TOLERANCE),a=this.oW.get(e)||[],s=a.filter(function(e){return e.isPlaybackRangeOverlapping(r)});if(0===s.length&&this.NW(((i={})[e]=0,i)),this.jW(a,r,n)){var u=a[0];this.mW.logger.debug("Keeping reference BMDT segment info for mime type ".concat(e," after buffer clearing"),{segmentUrl:u.segmentUrl,sectionId:u.sectionId}),u.markAsReferenceSegment(),s.push(u)}this.oW.set(e,s)}},e.prototype.jW=function(e,t,n){var i=this.kW();if((0,d.isSwitchingBufferBlocks)(i)||0!==t.length||0===e.length)return!1;var r=this.mW.store.getState(),o=!!(null==r?void 0:r.player)&&(0,s.getIsSeekingOrTimeshifting)(r.player),u=this.mW.serviceManager.get(a.ServiceName.ManifestService,this.mW.sourceContext.sourceIdentifier),c=this.mapToExternalTime(n),l=null==u?void 0:u.getPeriodIdForTime(c);return!o&&e[0].periodId===l},e.prototype.mapToExternalTime=function(e,t){var n=this;void 0===t&&(t=!1);var i=this.oW.getAllValues(),r=i.find(function(t){var i=t.playbackRange.start-n.mW.settings.GAP_TOLERANCE,r=t.playbackRange.end+n.mW.settings.GAP_TOLERANCE;return!t.isReferenceSegment&&e>=i&&e<=r})||(t?i[0]:void 0);return r&&(this.rW=r.originalPlaybackTime-r.playbackTime),this.mapToCachedExternalTime(e)},e.prototype.mapToCachedExternalTime=function(e){return void 0!==this.rW?Math.max(this.rW+e,0):(this.mW.logger.debug("Couldn't map internal time ".concat(e," to external time")),e)},e.prototype.mapToInternalTime=function(e,t,n){var i=this;void 0===t&&(t=!1);var r=this.oW.getAllValues().filter(function(e){return void 0===n||n===e.mimeType}),o=r.find(function(t){var n=t.originalPlaybackRange.start-i.mW.settings.GAP_TOLERANCE,r=t.originalPlaybackRange.end+i.mW.settings.GAP_TOLERANCE;return e>=n&&e<=r})||(t?r[0]:void 0);return o?Math.max(o.playbackTime+(e-o.originalPlaybackTime),0):e},e.prototype.mapToExternalTimeRange=function(e){if(null!=e)return{start:this.mapToExternalTime(e.start),end:this.mapToExternalTime(e.end)}},e.prototype.mapToExternalTimeRanges=function(e){var t=this;return e.map(function(e){return t.mapToExternalTimeRange(e)}).filter(function(e){return void 0!==e})},e.prototype.mapToExternalTimeRangesMap=function(e){var t=this;return null==e?null:Object.keys(e).reduce(function(n,i){return n[i]=t.mapToExternalTimeRanges(e[i]),n},{})},e.prototype.getSegmentTimeRanges=function(e,t){var n=this,i=[];return e.forEach(function(e){var r=n.oW.get(t).find(function(t){return t.isSegmentMatching(e)});r&&i.push(r.playbackRange)}),i},e.prototype.getCorrectTimeStampOffset=function(e,t){var n=this.pW.get(e);return n||(n=new f.Deferred,this.pW.set(e,n)),n.promise.then(function(e){return t+e})},e.prototype.dispose=function(){var e,t,n,i;this.oW.clear(),this.zW(),null===(e=this.mW.videoElement)||void 0===e||e.removeEventListener(h.MediaElementEvent.currenttimenotadvancing,this.wW),null===(t=this.mW.videoElement)||void 0===t||t.removeEventListener(h.MediaElementEvent.waiting,this.wW),null===(n=this.mW.videoElement)||void 0===n||n.removeEventListener(h.MediaElementEvent.stalled,this.wW),null===(i=this.mW.videoElement)||void 0===i||i.removeEventListener(h.MediaElementEvent.timeupdate,this.vW)},e.prototype.kW=function(){return this.mW.serviceManager.get(a.ServiceName.SourceStoreService,this.mW.sourceContext.sourceIdentifier)},e}();t.BaseMediaDecodeTimeHandler=O;var _=Math.log(2);function S(e){return Math.ceil(Math.log(e+1)/_)}function D(e,t){return e.includes(t)||e.push(t),e}},44885:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.addSegmentTimeInfoToMap=void 0,t.ensureMimeTypeInMap=function(e,t){e.get(t)||e.addAll(t,[])},t.addSegmentTimeInfoToMap=function(e,t,n){(function(e,t,n){var i;return null===(i=e.get(t))||void 0===i?void 0:i.find(function(e){return e.segmentUrl===(null==n?void 0:n.segmentUrl)&&e.equals(n)})})(e,t,n)||e.add(t,n)}},73849:function(e,t){function n(e){return Math.floor(e.originalBaseMediaDecodeTime-e.baseMediaDecodeTime)}function i(e){return Math.floor(e.originalPresentationTimeOffset-e.presentationTimeOffset)}function r(e,t,n){return e.find(function(e){var i=e.originalPlaybackRange.end;return t.originalPlaybackRange.start>=i-n&&t.originalPlaybackRange.start<=i+n})}function o(e,t){return e.reduce(function(e,n){var i=n.originalPlaybackTime,r=e?e.originalPlaybackTime:-1/0;return i<t&&i>r?n:e},void 0)}Object.defineProperty(t,"__esModule",{value:!0}),t.findOverflowDataForSegmentInMap=function(e,t,a,s){var u=1/0,c=1/0,l=r(t,e,a)||o(t,e.originalPlaybackTime),f=l?e.timescale/l.timescale:1;1!==f&&s.debug("Detected a timescale change: ".concat(null==l?void 0:l.timescale," -> ").concat(e.timescale));var d=l&&e.originalPresentationTimeOffset===l.originalPresentationTimeOffset*f;return d&&(u=e.originalBaseMediaDecodeTime-Math.round(n(l)*f),c=e.originalPresentationTimeOffset-Math.round(i(l)*f)),{baseMediaDecodeTime:u,presentationTimeOffset:c,foundMatchingPreviousSegment:Boolean(d)}},t.getBmdtOffset=n,t.getPtoOffset=i,t.findPrecedingSegmentTimeInfo=r,t.getLargestPrecedingSegmentTimeInfo=o},8301:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.findContinuousSegmentToMove=t.maybeSwitchOverASegmentToDiscontinuous=void 0;var i=n(44885);t.maybeSwitchOverASegmentToDiscontinuous=function(e){var n=(0,t.findContinuousSegmentToMove)(e);return n&&(e.continuousSegmentTimeInfoMap.deleteValue(n.mimeType,n),n.updateAsDiscontinuous(),(0,i.addSegmentTimeInfoToMap)(e.discontinuousSegmentTimeInfoMap,n.mimeType,n)),n},t.findContinuousSegmentToMove=function(e){var t=e.continuousSegmentTimeInfoMap.keys;if(2!==t.length)return null;if(t.every(function(t){return e.continuousSegmentTimeInfoMap.get(t).length>0}))return null;for(var n=0,i=t;n<i.length;n++){var r=i[n];if(e.discontinuousSegmentTimeInfoMap.has(r)&&!((e.discontinuousSegmentTimeInfoMap.get(r)||[]).length>0)){var o=e.continuousSegmentTimeInfoMap.get(r)||[];if(o.length)return o[0]}}return null}},48558:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentTimeInformation=void 0,t.getSectionId=o;var i=n(4524),r=function(){function e(e,t){var n,i,r=this;this.equals=function(e){if(e){var t=r.mimeType===e.mimeType,n=r.duration===e.duration,i=r.originalBaseMediaDecodeTime===e.originalBaseMediaDecodeTime,o=r.sectionId===e.sectionId;return t&&n&&i&&o}return!1},this.segmentUrl=e.getUrl(),this.duration=e.getDuration(),this.mimeType=e.getMimeType(),this.timescale=null!==(n=e.getTimescale())&&void 0!==n?n:1,this.originalPlaybackTime=e.getPlaybackTime(),this.Bcb=null===(i=e.getSegmentInfo())||void 0===i?void 0:i.byteRange,this.originalBaseMediaDecodeTime=e.getBaseMediaDecodeTime(),this.originalPresentationTimeOffset=e.getPresentationTimeOffset()*this.timescale,this.isBaseMediaDecodeTimeLimitExceeded=this.originalBaseMediaDecodeTime+this.duration*this.timescale>t,this.periodId=e.getPeriodId(),this.Acb=!1,this.sectionId=o(e),this.truncatedBaseMediaDecodeTime=1/0,this.truncatedPresentationTimeOffset=1/0,this.truncatedPlaybackTime=1/0}return Object.defineProperty(e.prototype,"isReferenceSegment",{get:function(){return this.Acb},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"playbackTime",{get:function(){return this.isBaseMediaDecodeTimeLimitExceeded&&this.truncatedPlaybackTime!==1/0?this.truncatedPlaybackTime:this.originalPlaybackTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseMediaDecodeTime",{get:function(){return this.isBaseMediaDecodeTimeLimitExceeded&&this.truncatedBaseMediaDecodeTime!==1/0?this.truncatedBaseMediaDecodeTime:this.originalBaseMediaDecodeTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"presentationTimeOffset",{get:function(){return this.isBaseMediaDecodeTimeLimitExceeded&&this.truncatedPresentationTimeOffset!==1/0?this.truncatedPresentationTimeOffset:this.originalPresentationTimeOffset},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"playbackRange",{get:function(){return{start:this.playbackTime,end:this.playbackTime+this.duration}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"originalPlaybackRange",{get:function(){return{start:this.originalPlaybackTime,end:this.originalPlaybackTime+this.duration}},enumerable:!1,configurable:!0}),e.prototype.getMatchingSegment=function(e){var t=this;return e.find(function(e){return t.isSegmentMatching(e)})},e.prototype.isSegmentMatching=function(e){var t,n,i,r=e.getUrl()===this.segmentUrl,o=e.getPlaybackTime()===this.originalPlaybackTime,a=null===(t=e.getSegmentInfo())||void 0===t?void 0:t.byteRange,s=(null==a?void 0:a.start)===(null===(n=this.Bcb)||void 0===n?void 0:n.start),u=(null==a?void 0:a.end)===(null===(i=this.Bcb)||void 0===i?void 0:i.end),c=s&&u,l=e.getMimeType()===this.mimeType;return r&&o&&c&&l},e.prototype.updateAsDiscontinuous=function(){this.isBaseMediaDecodeTimeLimitExceeded=!0},e.prototype.updateAsContinuous=function(e,t){this.truncatedBaseMediaDecodeTime=e,this.truncatedPresentationTimeOffset=t,this.truncatedPlaybackTime=(e-t)/this.timescale},e.prototype.markAsReferenceSegment=function(){this.Acb=!0},e.prototype.isPlaybackRangeOverlapping=function(e){var t=this.playbackRange,n={buffered:e},r=i.BufferRangeHelper.isInBufferedRange(n,t.start),o=i.BufferRangeHelper.isInBufferedRange(n,t.end),a=i.BufferRangeHelper.getCommonBufferedRanges({buffered:e,inSegment:[t]}).length>0;return r||o||a},e}();function o(e){var t,n,i;return null!==(i=null===(n=null===(t=e.getSegmentInfo())||void 0===t?void 0:t.discontinuitySequenceNumber)||void 0===n?void 0:n.toString())&&void 0!==i?i:e.getPeriodId()}t.SegmentTimeInformation=r},21651:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentTimeInformationArrayMap=void 0;var r=function(e){function t(){return e.call(this,function(e,t){return e.originalPlaybackTime-t.originalPlaybackTime})||this}return i(t,e),t.prototype.find=function(e){if(e)return this.get(e.getMimeType()).find(function(t){return t.isSegmentMatching(e)})},t}(n(61252).SortedArrayMap);t.SegmentTimeInformationArrayMap=r},61252:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.SortedArrayMap=void 0;var r=function(e){function t(t){var n=e.call(this)||this;return n.Jdb=t,n.Kdb=[],n}return i(t,e),t.prototype.getAllValues=function(){return this.Kdb},t.prototype.Ldb=function(e){return e?e.sort(this.Jdb):[]},t.prototype.set=function(t,n){var i=this.Ldb(n);return this.Mdb(t,i),e.prototype.set.call(this,t,i)},t.prototype.add=function(e,t){var n=t?[t]:[];return this.addAll(e,n),this},t.prototype.addAll=function(e,t){this.ensure(e),this.set(e,[].concat(t||[],this.get(e)))},t.prototype.delete=function(t){return this.Ndb(this.get(t)),e.prototype.delete.call(this,t)},t.prototype.deleteValue=function(t,n){return this.Ndb([n]),e.prototype.deleteValue.call(this,t,n)},t.prototype.clear=function(){this.Kdb=[],e.prototype.clear.call(this)},t.prototype.Mdb=function(e,t){void 0===t&&(t=[]);var n=this.get(e);this.Ndb(n),this.Kdb=this.Ldb(this.Kdb.concat(t))},t.prototype.Ndb=function(e){var t=this;void 0===e&&(e=[]),e.forEach(function(e){var n=t.Kdb.indexOf(e);n>-1&&t.Kdb.splice(n,1)})},t}(n(19483).ArrayMap);t.SortedArrayMap=r},1124:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.getTvMseWrapperConstructor=function(){return void 0===r&&(r=l()),r};var r,o=n(3714),a=n(20213),s=n(70850),u=n(88052),c=n(24281),l=function(){return function(e){function t(t,n){var i=e.call(this,t)||this;return i.xcb={},i.wcb=n,i}return i(t,e),t.prototype.printDetailedBufferRange=function(e,t){var n;try{n=e.buffered}catch(e){return void this.logger.debug("".concat(t," buffer range: Error accessing buffered ranges"))}if(0!==n.length)for(var i=0;i<n.length;i++){var r=n.start(i),o=n.end(i);this.logger.debug("".concat(t," buffer range [").concat(i,"]: ").concat(this.wcb.mapToExternalTime(r,!0)," - ").concat(this.wcb.mapToExternalTime(o,!0)," (").concat(r," - ").concat(o,")"))}else this.logger.debug("".concat(t," buffer range: empty"))},t.prototype.getBufferStartTime=function(){var e=this,t=Object.keys(this.sourceBuffers).map(function(t){return 0===e.sourceBuffers[t].bufferedRanges.length?0:e.wcb.mapToExternalTime(e.sourceBuffers[t].bufferedRanges[0].start)});return Math.max.apply(null,t)},t.prototype.updateTimestampOffset=function(t,n){try{e.prototype.updateTimestampOffset.call(this,t,n)}catch(e){this.logger.error("Unable to update timestampOffset",e),e.code===DOMException.INVALID_STATE_ERR&&this.context.eventHandler.dispatchEvent(o.PlayerEvent.Warning,new a.PlayerWarning(a.WarningCode.PLAYBACK_WARNING,"Unable to update timestampOffset (Invalid State error)",e))}},t.prototype.ycb=function(e,t){this.xcb[e]||(this.xcb[e]={currentOffset:this.sourceBuffers[e].buffer.timestampOffset,pendingOffset:t})},t.prototype.queueTimestampOffsetUpdate=function(t,n){var i=this;return this.ycb(t,n),this.wcb.getCorrectTimeStampOffset(t,n).then(function(e){return i.xcb[t].pendingOffset=e}).then(function(){var n=i.xcb[t].pendingOffset,r=i.xcb[t].currentOffset;return s.Util.roundValue(r,6)===s.Util.roundValue(n,6)&&i.isMediaSourceOpen()?Promise.resolve():(i.logger.debug("Updating timestamp offset for ".concat(t," to ").concat(n," (uncorrected offset: ").concat(r,")")),i.xcb[t].currentOffset=n,e.prototype.queueTimestampOffsetUpdate.call(i,t,n).finally(function(){var e,n,r=null===(n=null===(e=i.sourceBuffers[t])||void 0===e?void 0:e.buffer)||void 0===n?void 0:n.timestampOffset;i.xcb[t].currentOffset=r}))})},t.prototype.getBufferRangeStart=function(e,t){void 0===t&&(t=0);var n=this.wcb.getEarliestExternalTimeBufferedRangeIndex(e);return Math.max(t,e.start(n))},t.prototype.preBufferRemoval=function(e,t,n){this.logger.debug("removing buffer for ".concat(e," (from ").concat(this.wcb.mapToExternalTime(t)," to ").concat(this.wcb.mapToExternalTime(n),") (").concat(t," to ").concat(n,")"))},t.prototype.getRangePendingRemoval=function(e){return this.sourceBuffers.hasOwnProperty(e)&&this.wcb.mapToExternalTimeRange(this.sourceBuffers[e].rangePendingRemoval)||void 0},t.prototype.addToBuffer=function(t){var n=this;return(0,c.rewriteUnsupportedBoxes)(t),this.zcb(t).then(function(){return e.prototype.addToBuffer.call(n,t)})},t.prototype.zcb=function(e){var t=e.getMimeType(),n=-e.getPresentationTimeOffset();return e.isDirty()&&!e.isInit()?this.setTimestampOffset(t,n):Promise.resolve()},t}(u.ModuleManager.get(a.ModuleName.RendererMse).MSEWrapper)}},35501:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),r=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var i,r=0,o=t.length;r<o;r++)!i&&r in t||(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.getTvRendererConstructor=function(){return void 0===o&&(o=m()),o};var o,a=n(4524),s=n(66790),u=n(34841),c=n(88052),l=n(62756),f=n(84276),d=n(48558),p=n(1124),m=function(){return function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.postBufferRemoval=function(e,n,i){t.video&&(t.baseMediaDecodeTimeHandler.signalBufferRemoval(e,t.VV(e),t.video.currentTime),t.logger.debug("successfully removed buffer for ".concat(e," (from ").concat(t.baseMediaDecodeTimeHandler.mapToExternalTime(n)," to ").concat(t.baseMediaDecodeTimeHandler.mapToExternalTime(i),") (").concat(n," to ").concat(i,")")))},t}return i(t,e),t.prototype.init=function(t){this.baseMediaDecodeTimeHandler=new f.BaseMediaDecodeTimeHandler(this.context,this.UV.bind(this),this.getMaxSafeBaseMediaDecodeTime(),this.getMaxSafePresentationTimeOffset()),e.prototype.init.call(this,t),this.TV||(this.TV=new u.Deferred),this.TV.resolve(this.baseMediaDecodeTimeHandler)},t.prototype.getMaxSafeBaseMediaDecodeTime=function(){return 1/0},t.prototype.getMaxSafePresentationTimeOffset=function(){return 1/0},t.prototype.createMSEWrapper=function(){return new((0,p.getTvMseWrapperConstructor)())(this.context,this.baseMediaDecodeTimeHandler)},t.prototype.getCurrentVideoTime=function(){return this.baseMediaDecodeTimeHandler.mapToExternalTime(e.prototype.getCurrentVideoTime.call(this))},t.prototype.getRangesInSourceBuffers=function(){return this.baseMediaDecodeTimeHandler.mapToExternalTimeRangesMap(e.prototype.getRangesInSourceBuffers.call(this))},t.prototype.getBufferedRanges=function(t){return this.baseMediaDecodeTimeHandler.mapToExternalTimeRanges(e.prototype.getBufferedRanges.call(this,t))},t.prototype.getVideoElementBufferedRanges=function(){var t=e.prototype.getVideoElementBufferedRanges.call(this);return this.baseMediaDecodeTimeHandler.mapToExternalTimeRanges(t)},t.prototype.UV=function(e){var t,n,i=this;if(!this.mse)return Promise.reject();var r=null===(t=this.mse)||void 0===t?void 0:t.getBufferedRanges(e),o=null!==(n=null==r?void 0:r.slice(1))&&void 0!==n?n:[];return Promise.all(o.map(function(t){var n;return i.logger.debug("Clearing buffer on rollover for ".concat(e," from ").concat(t.start," to ").concat(t.end)),null===(n=i.mse)||void 0===n?void 0:n.removeFromBuffer(e,t.start-i.settings.GAP_TOLERANCE,t.end+i.settings.GAP_TOLERANCE,i.postBufferRemoval)})).then(function(){})},t.prototype.removeData=function(e,t,n,i){if(void 0===i&&(i=!1),!this.mse)return Promise.reject();void 0===t&&void 0===n&&!i&&this.saveCurrentTime(),this.removeDataFromSegmentQueues(e,t,n);var r=void 0!==t?this.baseMediaDecodeTimeHandler.mapToInternalTime(t,!0,e):void 0,o=void 0!==n?this.baseMediaDecodeTimeHandler.mapToInternalTime(n,!0,e):void 0;return this.mse.removeFromBuffer(e,r,o,this.postBufferRemoval)},t.prototype.addSegmentFromQueueToMse=function(t){var n=this,i=this.WV(function(e){return!e.isInit()}),r=Object.keys(this.segmentQueues).every(function(e){var t=n.mse&&n.mse.getBufferedRanges(e).length>0,r=i.some(function(t){return t.getMimeType()===e});return t||r});if(0===i.length||!r)return Promise.reject(s.SOURCE_BUFFER_APPEND_STATUS.SUSPENDED);var o=i.reduce(function(e,t){return t.getPlaybackTime()<e.getPlaybackTime()?t:e},i[0]),a=(0,d.getSectionId)(o),u=this.WV(function(e){return!e.isInit()&&(0,d.getSectionId)(e)===a});return this.baseMediaDecodeTimeHandler.rewriteTimeStampsIfNecessary(u)?e.prototype.addSegmentFromQueueToMse.call(this,t):Promise.reject(s.SOURCE_BUFFER_APPEND_STATUS.SUSPENDED)},t.prototype.VV=function(e){var t,n;if(null===this.mse||!this.segmentQueues.hasOwnProperty(e))return[];var i=this.WV(function(e){return!e.isInit()}),o=this.baseMediaDecodeTimeHandler.getSegmentTimeRanges(i,e),s=null!==(n=null===(t=this.mse)||void 0===t?void 0:t.getBufferedRanges(e))&&void 0!==n?n:[];return a.BufferRangeHelper.mergeRanges(r(r([],o,!0),s,!0),this.settings.GAP_TOLERANCE)},t.prototype.adjustTimeToNextCommonBufferStart=function(t){var n=e.prototype.adjustTimeToNextCommonBufferStart.call(this,t);return isNaN(n)?NaN:Math.ceil(100*this.baseMediaDecodeTimeHandler.mapToInternalTime(n))/100},t.prototype.seekOnVideoElement=function(e){var t=this;return this.waitingForSeekedPromise=new Promise(function(n,i){if(t.video){t.video.currentTime=e;var r=t.video.currentTime;n(t.getBaseMediaDecodeTimeHandler().then(function(e){return e.mapToExternalTime(r)}))}else i("No video reference")}),this.waitingForSeekedPromise},t.prototype.getBaseMediaDecodeTimeHandler=function(){return this.TV.promise},t.prototype.WV=function(e){var t=this;return void 0===e&&(e=function(){return!0}),Object.keys(this.segmentQueues).flatMap(function(e){return t.segmentQueues[e]}).filter(e)},t.prototype.getEndOfBufferTime=function(){if(this.video&&this.video.buffered&&this.video.buffered.length>0&&this.baseMediaDecodeTimeHandler)return this.baseMediaDecodeTimeHandler.getEndOfBufferTime()},t.prototype.shutdown=function(t){var n=this;return e.prototype.shutdown.call(this,t).then(function(){n.XV()})},t.prototype.XV=function(){this.TV=new u.Deferred,this.baseMediaDecodeTimeHandler.dispose()},t.prototype.release=function(){return this.XV(),e.prototype.release.call(this)},t}(c.ModuleManager.get(l.ModuleName.RendererMse).MSERenderer)}},24281:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.rewriteUnsupportedBoxes=function(e,t){void 0===t&&(t=o),t.forEach(function(t){var n,i=null===(n=e.getParsedData())||void 0===n?void 0:n.get(t);i&&(0,r.rewriteMp4BoxType)(i,"free")})};var i=n(15487),r=n(2992),o=function(){var e=["skip"];return((0,i.isTizen2016)()||(0,i.isTizen2017)())&&e.push("moov.trak.edts"),e}()},85537:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.withDrmLicenseWaiting=function(e,t){return function(e){function n(){for(var n,i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];var a=e.apply(this,i)||this;return a.YV=[],a.encryptedEventHandler=function(e){var n;a.onEncryptedEvent(e);var i=a.drmService;if(i)for(var r=0,o=null!==(n=null==t?void 0:t(e.initData))&&void 0!==n?n:[];r<o.length;r++){var s=o[r];if(s.systemName===a.bV()){var u=btoa(i.preprocessInitDataStr(s));a.initializeLicense(s.systemName,u)}}},null===(n=a.video)||void 0===n||n.addEventListener(s.MediaElementEvent.encrypted,a.encryptedEventHandler),a.ZV=(0,o.subscribe)(a.context.store)(function(e){return null==e?void 0:e.drmLicenses},function(e){return e&&a.resolveAvailableLicenses(e.drmData)}),a}return i(n,e),n.prototype.setCurrentTime=function(t){var n=this;return this.waitForDrmLicenseResolving().then(function(){return e.prototype.setCurrentTime.call(n,t)})},n.prototype.onEncryptedEvent=function(e){},Object.defineProperty(n.prototype,"aV",{get:function(){var e=this;return this.YV.filter(function(t){return t.systemName===e.bV()})},enumerable:!1,configurable:!0}),n.prototype.waitForDrmLicenseResolving=function(){var e,t,n,i=this,r=null===(n=null===(t=null===(e=this.context.store)||void 0===e?void 0:e.getState())||void 0===t?void 0:t.drmLicenses)||void 0===n?void 0:n.drmData;r&&this.resolveAvailableLicenses(r);var o=this.aV;return o.length>0&&this.logger.debug("setCurrentTime: waiting for ".concat(o.length," DRM license(s) before seeking")),Promise.all(o.map(function(e){return e.licenseReady.promise})).then(function(){o.length>0&&i.logger.debug("setCurrentTime: DRM license(s) ready, proceeding with seek")})},n.prototype.resolveAvailableLicenses=function(e){var t=this;this.aV.filter(function(t){return Boolean(e[t.systemName])}).forEach(function(n){var i=e[n.systemName],r=Object.keys(i).find(function(e){var t=i[e];return btoa(t.initDataStr)===n.licenseInfoKey});r&&e[n.systemName][r].hasLicense&&(t.logger.debug("DRM license ready for key system: ".concat(n.systemName," — unblocking seek")),n.licenseReady.resolve())})},n.prototype.initializeLicense=function(e,t){this.YV.some(function(n){return n.systemName===e&&n.licenseInfoKey===t})||(this.logger.debug("DRM encrypted event — tracking license for key system: ".concat(e)),this.YV.push({systemName:e,licenseInfoKey:t,licenseReady:new a.Deferred}))},n.prototype.bV=function(){var e,t;return this.context.serviceManager.has(r.ServiceName.DrmService)&&null!==(t=null===(e=this.context.serviceManager.get(r.ServiceName.DrmService))||void 0===e?void 0:e.getUsedKeySystemKind())&&void 0!==t?t:null},n.prototype.shutdown=function(t){var n;return t||(this.YV=[],this.ZV(),null===(n=this.video)||void 0===n||n.removeEventListener(s.MediaElementEvent.encrypted,this.encryptedEventHandler)),e.prototype.shutdown.call(this,t)},n}(e)};var r=n(80813),o=n(93204),a=n(34841),s=n(19274)},69507:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.WebosModuleDefinition=void 0;var i=n(70962),r=n(15487),o=n(62756),a=n(41503),s=n(18616),u=n(99959),c=n(98745),l=n(42350),f=n(13492);t.WebosModuleDefinition={name:o.ModuleName.Webos,module:function(){return{getWebosRendererConstructor:u.getWebosRendererConstructor,getWebosDrmManagerConstructor:s.getWebosDrmManagerConstructor,WebosVideoElementWrapper:l.WebosVideoElementWrapper,getWebosUnprefixedEmeHandlerConstructor:c.getWebosUnprefixedEmeHandlerConstructor,getWebos2017UnprefixedEmeHandlerConstructor:a.getWebos2017UnprefixedEmeHandlerConstructor,getWebosWebkitPrefixedEmeHandlerConstructor:f.getWebosWebkitPrefixedEmeHandlerConstructor}},dependencies:[o.ModuleName.RendererMse],hooks:{add:function(){i.DefaultSettings.END_OF_BUFFER_RECOVERY_TOLERANCE=1,(0,r.isWebOs2019OrOlder)()&&(i.DefaultSettings.WEBOS_MAX_SAFE_BMDT=274877906943,i.DefaultSettings.WEBOS_MAX_SAFE_PTO=4194303),(0,r.isWebOs2019OrOlder)()?i.DefaultSettings.MAX_STARTUP_BUFFER=6:(0,r.isWebOs2020)()?i.DefaultSettings.MAX_STARTUP_BUFFER=4:i.DefaultSettings.MAX_STARTUP_BUFFER=2.5,(0,r.isWebOs2016)()&&(i.DefaultSettings.HLS_CLEAR_BUFFERS_ON_DISCONTINUITY_SWITCHES=!0)}}},t.default=t.WebosModuleDefinition},41503:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.getWebos2017UnprefixedEmeHandlerConstructor=function(){return void 0===r&&(r=function(){return function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.load=function(t,n,i,r){return e.prototype.load.call(this,t,n,i,r),Promise.resolve()},t.prototype.setupKeySystem=function(t){var n=this;return this.ww=new o.Deferred,this.ww.promise.then(function(){return e.prototype.setupKeySystem.call(n,t)}).catch(function(e){throw e})},t.prototype.addInitData=function(e){var t,n,i;e&&(null===(n=null===(t=this.context.sourceContext)||void 0===t?void 0:t.source.drm)||void 0===n?void 0:n.immediateLicenseRequest)&&(null===(i=this.ww)||void 0===i||i.resolve())},t.prototype.processMediaEncryptedEvent=function(t){var n;return null===(n=this.ww)||void 0===n||n.resolve(),e.prototype.processMediaEncryptedEvent.call(this,t)},t.prototype.unload=function(){var t;return null===(t=this.ww)||void 0===t||t.reject("Unloaded the WebosEmeHandler"),e.prototype.unload.call(this)},t}((0,a.getWebosUnprefixedEmeHandlerConstructor)())}()),r};var r,o=n(34841),a=n(98745)},18616:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.getWebosDrmManagerConstructor=function(){if(null===s&&r.ModuleManager.has(o.ModuleName.DRM)){var e=r.ModuleManager.get(o.ModuleName.DRM).DRMManager;s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.setConfig=function(t,n){var i=this;return e.prototype.setConfig.call(this,t,n).then(function(e){return function(e){return e instanceof(0,a.getWebosWebkitPrefixedEmeHandlerConstructor)()}(i.emeHandler)&&i.emeHandler.setWebosDrmManager(i),e})},t.prototype.addInitData=function(t){var n,i;null===(i=null===(n=this.emeHandler)||void 0===n?void 0:n.addInitData)||void 0===i||i.call(n,t),e.prototype.addInitData.call(this,t)},t.prototype.getRequestedLicenses=function(){var e=this.getUsedKeySystemKind();return this.licenseStorage.getAllLicensesForKeySystem(e).filter(function(e){return e.hasLicense})},t.prototype.resetLicense=function(e,t){this.licenseStorage.resetLicense(t,e)},t}(e)}return s};var r=n(88052),o=n(62756),a=n(13492),s=null},70007:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.WebosOnPlayListener=void 0;var i=n(89927),r=n(19274),o=function(){function e(e){this.eventHandler=e}return e.prototype.listenToPlay=function(){var e=this;return new Promise(function(t,n){e.wX(),e.lW=function(){e.wX(),setTimeout(function(){n(new Error("Play promise rejected because the source was unloaded"))},(0,i.toSeconds)(1))},e.eventHandler.addEventListener(r.MediaElementEvent.emptied,e.lW)})},e.prototype.wX=function(){this.lW&&(this.eventHandler.removeEventListener(r.MediaElementEvent.emptied,this.lW),this.lW=void 0)},e.prototype.dispose=function(){this.wX()},e}();t.WebosOnPlayListener=o},99959:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.getWebosRendererConstructor=function(){var e;return null===f&&(f=d(null===(e=a.ModuleManager.get(s.ModuleName.DRM,!1))||void 0===e?void 0:e.parseInitData)),f};var r=n(77753),o=n(19274),a=n(88052),s=n(62756),u=n(84276),c=n(35501),l=n(85537),f=null,d=function(e){var t=(0,c.getTvRendererConstructor)();return function(e){function t(t){var n=e.call(this,t)||this;return n.xw=new Map,n.yw=!1,n.zw=!1,n.baseMediaDecodeTimeHandler.setPtoGapFillingMode(u.PtoGapFillingMode.FillGaps),n}return i(t,e),t.prototype.onEncryptedEvent=function(e){this.yw=!0},t.prototype.getMaxSafeBaseMediaDecodeTime=function(){return this.context.settings.WEBOS_MAX_SAFE_BMDT},t.prototype.getMaxSafePresentationTimeOffset=function(){return this.context.settings.WEBOS_MAX_SAFE_PTO},t.prototype.Aw=function(e){return!!function(e){var t=e.isInit(),n=e.isEncrypted(),i=e.hasDrmInitData();return!t&&n&&!i}(e)&&!this.zw&&!this.yw},t.prototype.Bw=function(){var e,t=this;if(0!==this.xw.size){this.xw.forEach(function(e){var n,i={type:o.MediaElementEvent.encrypted,initData:e};null===(n=t.context.videoElement)||void 0===n||n.eventHandler.triggerEvent(o.MediaElementEvent.encrypted,i)});var n=this.context.store.getState();(0,r.isInstanceState)(n)&&this.resolveAvailableLicenses(null===(e=a.ModuleManager.get(s.ModuleName.DRM).getLicenseState(n))||void 0===e?void 0:e.drmData)}else this.context.videoElement.eventHandler.triggerEvent(o.MediaElementEvent.encrypted)},t.prototype.Cw=function(e){this.mse&&(this.zw=this.zw||e.hasDrmInitData(),this.Aw(e)&&(this.context.logger.debug("Triggering encrypted event as segments don't contain any DRM init data"),this.Bw()))},t.prototype.addDrmInitData=function(t){var n=this;e.prototype.addDrmInitData.call(this,t),t.forEach(function(e){n.xw.has(e.initDataStr)||n.xw.set(e.initDataStr,e.initData)})},t.prototype.appendData=function(t){var n=this;return e.prototype.appendData.call(this,t).then(function(){return n.Cw(t)})},t.prototype.shutdown=function(t){var n,i,r=this;this.xw.clear(),this.yw=!1,this.zw=!1;var o=function(){return e.prototype.shutdown.call(r,t).then(function(){var e;return null===(e=r.drmService)||void 0===e?void 0:e.suspend()})};return(null!==(i=null===(n=this.drmService)||void 0===n?void 0:n.prepareForMseShutdown())&&void 0!==i?i:Promise.resolve()).then(o,o)},t}((0,l.withDrmLicenseWaiting)(t,e))}},98745:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.getWebosUnprefixedEmeHandlerConstructor=function(){return void 0===r&&(r=s()),r},t.getWebosUnprefixedEmeHandlerClass=s;var r,o=n(88052),a=n(62756);function s(){return function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.Dw=null,t.Ew=null,t}return i(t,e),t.prototype.load=function(t,n,i,r){return e.prototype.load.call(this,t,n,i,r)},t.prototype.Fw=function(){var t=this;this.Dw&&e.prototype.setMediaKeys.call(this,this.Dw).catch(function(e){t.context.logger.debug("Could not reset media keys on Webos",e)}).finally(function(){t.Dw=null})},t.prototype.setMediaKeys=function(t){return this.Ew=t,e.prototype.setMediaKeys.call(this,t)},t.prototype.onServerCertificateSetFailed=function(t,n,i){var r=t!==this.Ew,o=n instanceof DOMException&&n.message.includes("Operation aborted");r&&o?this.context.logger.debug("[WebosUnprefixedEmeHandler] ignoring aborted setServerCertificate after MediaKeys change"):e.prototype.onServerCertificateSetFailed.call(this,t,n,i)},t.prototype.processMediaEncryptedEvent=function(t){e.prototype.processMediaEncryptedEvent.call(this,t),this.Fw()},t.prototype.closeSession=function(e){try{return e.close()}catch(e){return this.context.logger.debug("couldn't close session on unload",e),Promise.resolve()}},t.prototype.prepareForMseShutdown=function(){var e,t;return null!==(t=null===(e=this.video)||void 0===e?void 0:e.mediaKeysPromise)&&void 0!==t?t:Promise.resolve()},t.prototype.suspend=function(){var e,t;return this.Dw=null!==(t=null===(e=this.video)||void 0===e?void 0:e.mediaKeysObject)&&void 0!==t?t:null,this.setMediaKeys(null)},t.prototype.unload=function(){return this.Dw=null,this.Ew=null,e.prototype.unload.call(this)},t}(o.ModuleManager.get(a.ModuleName.DRM).UnprefixedEMEHandler)}},42350:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.WebosVideoElementWrapper=void 0;var r=n(21513),o=n(15487),a=n(79186),s=n(70007),u=function(e){function t(t,n){var i=e.call(this,t,n)||this;return i.Gw=new s.WebosOnPlayListener(i.eventHandler),i}return i(t,e),t.prototype.play=function(){return(0,r.getCapabilities)().chromiumVersion<=o.WEBOS_2018_2019_CHROMIUM_VERSION?Promise.race([e.prototype.play.call(this),this.Gw.listenToPlay()]):e.prototype.play.call(this)},t.prototype.dispose=function(){this.Gw.dispose(),e.prototype.dispose.call(this)},t}(a.VideoElementWrapper);t.WebosVideoElementWrapper=u},13492:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.getWebosWebkitPrefixedEmeHandlerConstructor=function(){if(null===s&&o.ModuleManager.has(a.ModuleName.DRM)){var e=o.ModuleManager.get(a.ModuleName.DRM);s=function(e){function t(t){var n=e.call(this,t)||this;return n.Iw=[],n}return i(t,e),t.prototype.invokeEncryptedListener=function(t,n){var i=this;if(this.Hw){var r=this.Hw.getUsedKeySystemKind();n.forEach(function(e){var t,n;if(e.systemName===r){var o=null!==(n=null===(t=i.keySystem)||void 0===t?void 0:t.getIdentifierFromInitData(e.initDataStr))&&void 0!==n?n:e.initDataStr,a=i.Iw.findIndex(function(e){return e.initDataStr===o});a>-1&&(i.Iw.splice(a,1),i.Hw.resetLicense(o,r))}})}e.prototype.invokeEncryptedListener.call(this,t,n)},t.prototype.prepareForMseShutdown=function(){var e,t=null===(e=this.context.serviceManager)||void 0===e?void 0:e.get(r.ServiceName.DrmService),n=null==t?void 0:t.getUsedKeySystemKind();return t&&n?t.waitForPendingLicenseRequests(n):Promise.resolve()},t.prototype.suspend=function(){return this.Hw&&(this.Iw=this.Hw.getRequestedLicenses()),e.prototype.suspend.call(this)},t.prototype.unload=function(){return this.Hw=null,e.prototype.unload.call(this)},t.prototype.setWebosDrmManager=function(e){this.Hw=e},t}(e.WebKitPrefixedEMEHandler)}return s};var r=n(80813),o=n(88052),a=n(62756),s=null}},function(e){return function(){return e(69507)}()}])});
|
|
17
|
+
"use strict";!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.webos=t():(e.bitmovin=e.bitmovin||{},e.bitmovin.player=e.bitmovin.player||{},e.bitmovin.player.webos=t())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[137],{84276:function(e,t,n){var i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseMediaDecodeTimeHandler=t.PtoGapFillingMode=void 0;var r,o=n(4524),a=n(80813),s=n(87827),u=n(68925),c=n(47602),l=n(19483),f=n(34841),d=n(87244),p=n(85434),m=n(15487),g=n(89927),h=n(19274),v=n(88052),y=n(62756),T=n(44885),b=n(73849),M=n(8301),E=n(48558),D=n(21651);!function(e){e.KeepGaps="keep-gaps",e.FillGaps="fill-gaps"}(r||(t.PtoGapFillingMode=r={}));var O=function(){function e(e,t,n,a){var s=this;this.maxSafeBaseMediaDecodeTime=n,this.maxSafePresentationTimeOffset=a,this.KV=function(){s.MV(s.BV.settings.END_OF_BUFFER_TOLERANCE)},this.LV=function(){s.MV(s.BV.settings.END_OF_BUFFER_RECOVERY_TOLERANCE)},this.RV=function(){if(s.BV.videoElement)try{var e=s.QV(),t=s.BV.videoElement.currentTime,n=s.NV(t).mapEach(function(e){return e.playbackRange}).mapAll(function(e){return o.BufferRangeHelper.mergeRanges(e,s.BV.settings.GAP_TOLERANCE)}).getObject(),r=o.BufferRangeHelper.getCommonBufferedRanges(i(i({},n),{bufferedRanges:e})).shift();if(void 0!==r){var a=r.getStart();s.BV.logger.debug("continuing playback at ".concat(a," (from ").concat(t,")")),s.BV.videoElement.currentTime=a,s.OV(),s.BV.videoElement.eventHandler.removeEventListener(h.MediaElementEvent.currenttimenotadvancing,s.LV),s.IV().finally(function(){var e;return null===(e=s.JW())||void 0===e?void 0:e.dispatch((0,u.setTimestampRollingOver)(!1))}).then(function(){s.BV.logger.debug("successfully cleared previous buffers")}).catch(function(e){s.BV.logger.debug("could not clear previous buffers:",e)})}else s.PV()}catch(e){s.BV.logger.debug("could not handle timestamp overflow:",e)}else s.BV.logger.debug("Could not handle timestamp overflow: Video Element is not defined")},this.BV=e,this.HV=r.KeepGaps,this.FV=t,this.CV=void 0,this.EV=new Map,this.DV=new D.SegmentTimeInformationArrayMap,this.BV.videoElement?(this.BV.videoElement.addEventListener(h.MediaElementEvent.waiting,this.LV),this.BV.videoElement.addEventListener(h.MediaElementEvent.stalled,this.LV),this.BV.videoElement.addEventListener(h.MediaElementEvent.timeupdate,this.KV),e.logger.debug("BaseMediaDecodeTime limit is set to ".concat(B(n)," bits")),e.logger.debug("PresentationTimeOffset limit is set to ".concat(B(a)," bits")),e.settings.FORCE_BASE_MEDIA_DECODE_TIME_REWRITE&&e.logger.debug("BaseMediaDecodeTime rewriting is forced!")):e.logger.debug("Could not set up BaseMediaDecodeTime rewriting: Video Element is not defined")}return e.prototype.IV=function(){var e=this,t=[];return this.JV().keys.forEach(function(n){t.push(e.FV(n))}),Promise.all(t).then(function(){})},e.prototype.getEndOfBufferTime=function(){var e=o.BufferRangeHelper.getCommonBufferedRanges(this.JV(!0).getObject()).sort(function(e,t){return e.getStart()-t.getStart()});return e.length>0?e[e.length-1].getEnd():0},e.prototype.setPtoGapFillingMode=function(e){this.HV=e},e.prototype.getEarliestExternalTimeBufferedRangeIndex=function(e){var t=0;try{for(var n=void 0,i=0;i<e.length;i++){var r=this.mapToExternalTime(e.start(i));(void 0===n||r<n)&&(n=r,t=i)}}catch(e){this.BV.logger.debug("Could not determine buffer region offset:",e)}return t},e.prototype.JV=function(e){var t=this;return void 0===e&&(e=!1),this.DV.mapEach(function(t){return e?t.originalPlaybackRange:t.playbackRange}).mapAll(function(e){return o.BufferRangeHelper.mergeRanges(e,t.BV.settings.GAP_TOLERANCE)})},e.prototype.MV=function(e){var t,n,i=this.BV.videoElement;if(i){var r=i.currentTime;if(!(r>=i.duration&&i.duration>0)){var o=i.buffered;if(o.length<2)null===(t=this.JW())||void 0===t||t.dispatch((0,u.setTimestampRollingOver)(!1));else if(0!==this.getEarliestExternalTimeBufferedRangeIndex(o)){var a=o.end(o.length-1);r>=a-Math.max(this.BV.settings.MINIMAL_BACKWARD_BUFFER_CLEARING_INTERVAL,this.BV.settings.END_OF_BUFFER_TOLERANCE,this.BV.settings.END_OF_BUFFER_RECOVERY_TOLERANCE)&&(null===(n=this.JW())||void 0===n||n.dispatch((0,u.setTimestampRollingOver)(!0))),r>=a-e&&this.RV()}}}},e.prototype.NV=function(e){var t=this,n=this.BV.settings.GAP_TOLERANCE,i=new l.ArrayMap;return this.DV.keys.forEach(function(r){var o=!1,a=-1/0,s=t.DV.get(r),u=!1;s.sort(function(e,t){return e.originalPlaybackTime-t.originalPlaybackTime});var c=s.filter(function(t){var i=t.playbackRange,r=i.start-n<=e&&i.end+n>=e;if(u=u||r,!isFinite(a)&&r)a=t.playbackTime;else if(isFinite(a))return o=o||t.playbackTime<a;return!1});0!==c.length||u||(s.sort(function(e,t){return e.originalPlaybackTime-t.originalPlaybackTime}),c=s.filter(function(t){return t.playbackRange.end<e})),i.addAll(r,c)}),i},e.prototype.OV=function(){void 0!==this.CV&&(this.CV(),this.CV=void 0)},e.prototype.PV=function(){var e=this,t=this.JW();void 0!==t&&(this.OV(),this.CV=(0,c.subscribeToRendererBufferChanges)(t,function(){return e.LV()}))},e.prototype.QV=function(){var e,t=[],n=null===(e=this.BV.videoElement)||void 0===e?void 0:e.buffered;if(!function(e){return 0!==(null==e?void 0:e.length)}(n))return[];for(var i=0;i<n.length;i++)t.push({start:n.start(i),end:n.end(i)});return t},e.prototype.SV=function(e){var t,n=e.getMimeType(),i=e.getPlaybackTimeRange();if(void 0!==i){var r=(null!==(t=this.DV.get(n))&&void 0!==t?t:[]).filter(function(e){return e.originalPlaybackRange.end<i.end});return r[r.length-1]}},e.prototype.TV=function(e){var t=this,n=!1,i=!1,o=new D.SegmentTimeInformationArrayMap;return this.DV.keys.forEach(function(e){return(0,T.ensureMimeTypeInMap)(o,e)}),e.forEach(function(e){if(!e.isDirty()){var a=new E.SegmentTimeInformation(e,t.maxSafeBaseMediaDecodeTime),s=a.presentationTimeOffset/a.timescale,u=t.wW(s),c=t.xW(a);(n=n||u||c||t.BV.settings.FORCE_BASE_MEDIA_DECODE_TIME_REWRITE||t.sW(a)||t.tW(a,a.baseMediaDecodeTime,a.presentationTimeOffset))&&(a.isBaseMediaDecodeTimeLimitExceeded=!0,t.BV.logger.debug("BaseMediaDecodeTime (".concat(a.originalBaseMediaDecodeTime,") exceeding limit for ").concat(a.mimeType," segment")));var l=t.SV(e),f=l?l.originalPresentationTimeOffset/l.timescale:s;f===s||t.HV!==r.FillGaps&&!(null==l?void 0:l.isBaseMediaDecodeTimeLimitExceeded)||(t.BV.logger.debug("Detected a presentation time offset change: ".concat(f," -> ").concat(s),{precedingSegmentTimeInfo:null==l?void 0:l.segmentUrl}),i=!0),(0,T.addSegmentTimeInfoToMap)(o,a.mimeType,a)}}),[n,i,o]},e.prototype.UV=function(e){return v.ModuleManager.has(y.ModuleName.ContainerMP4)?e.getTFDTBoxOffsets()||v.ModuleManager.get(y.ModuleName.ContainerMP4).parseTfdtBoxOffsets(e):(this.BV.logger.debug("Can't rewrite BMDT for TS segment as MP4 module is not available"),[])},e.prototype.VV=function(e,t){var n=this.UV(e);e.setTFDTBoxOffsets(n);var i=e.getBaseMediaDecodeTime()-t.truncatedBaseMediaDecodeTime;e.getTFDTBoxOffsets().forEach(function(t){var n=0,r=new DataView(e.getData(),t),o=r.getUint32(n);n+=4;var a=String.fromCharCode(r.getUint8(n++),r.getUint8(n++),r.getUint8(n++),r.getUint8(n++));if(n+=1===o?8:0,"tfdt"===a){var s=r.getUint8(n);n+=4,1===s?function(e,t,n){var i=e.getUint32(t),r=e.getUint32(t+4),o=i*Math.pow(2,32)+r-n;e.setUint32(t,Math.floor(o/Math.pow(2,32))),t+=4,e.setUint32(t,o)}(r,n,i):function(e,t,n){var i=e.getUint32(t)-n;e.setUint32(t,i)}(r,n,i)}}),e.setBaseMediaDecodeTime(t.truncatedBaseMediaDecodeTime),e.setDirty(!0)},e.prototype.WV=function(e,t){var n=this;t.forAll(function(t,i){(0,T.addSegmentTimeInfoToMap)(n.DV,t,i);var r=i.getMatchingSegment(e);r&&n.VV(r,i)})},e.prototype.XV=function(e,t){return e.reduce(function(e,n){var i=t(n),r=Math.floor(i/n.timescale);return!isFinite(e)&&isFinite(r)||r<e?r:e},-1/0)},e.prototype.YV=function(e,t){var n=this;return Math.min.apply(Math,e.transform(function(e){return n.XV(e,t)}))},e.prototype.ZV=function(e){return this.YV(e,function(e){return e.truncatedBaseMediaDecodeTime-e.truncatedPresentationTimeOffset})},e.prototype.aV=function(e){return this.YV(e,function(e){return e.originalPresentationTimeOffset})},e.prototype.bV=function(e){var t={},n=this.aV(e);isFinite(n)?(e.forAll(function(e,i){var r=i.timescale,o=i.originalBaseMediaDecodeTime,a=i.originalPresentationTimeOffset,s=Math.floor(a-n*r),u=a-s,c=o-u,l=Math.floor(u/r);i.truncatedBaseMediaDecodeTime=c,i.truncatedPresentationTimeOffset=s,t.hasOwnProperty(e)||(t[e]=l)}),this.mW(t)):this.BV.logger.debug("Could not determine common PresentationTimeOffset divisor")},e.prototype.mW=function(e){var t=this;Object.keys(e).forEach(function(n){var i=t.EV.get(n);i&&i.resolve(e[n]);var r=new f.Deferred;t.EV.set(n,r),r.resolve(e[n])})},e.prototype.nW=function(e,t){var n,i=this,r=this.ZV(t);isFinite(r)?(t.forAll(function(t,n){var o=n.getMatchingSegment(e);o&&i.oW(o,n,r),(0,T.addSegmentTimeInfoToMap)(i.DV,t,n)}),null===(n=this.BV.videoElement)||void 0===n||n.addEventListener(h.MediaElementEvent.currenttimenotadvancing,this.LV)):this.BV.logger.debug("Could not determine common BaseMediaDecideTime divisor")},e.prototype.oW=function(e,t,n){t.truncatedBaseMediaDecodeTime=t.truncatedBaseMediaDecodeTime-t.timescale*n,t.truncatedPlaybackTime=(t.truncatedBaseMediaDecodeTime-t.truncatedPresentationTimeOffset)/t.timescale,this.VV(e,t)},e.prototype.pW=function(e){for(var t,n,i=e.keys,o=e.getAll(),a=[],s=1/0,u=0,c=i;u<c.length;u++){var l=c[u],f=(null!==(t=this.DV.get(l))&&void 0!==t?t:[]).filter(function(e){return!o.includes(e)&&!e.isReferenceSegment});f.sort(function(e,t){return e.originalPlaybackTime-t.originalPlaybackTime});var d=f.pop(),p=null!==(n=null==d?void 0:d.playbackRange.end)&&void 0!==n?n:1/0,m=e.get(l)||[];if(0===m.length)return 1/0;var g=Math.min.apply(Math,m.map(function(e){return e.playbackTime})),h=g-p;s=Math.min(s,g),isFinite(h)&&a.push(h)}if(a.length!==i.length)return this.BV.logger.debug("No segments to align with end of buffer"),0;var v=s-this.BV.settings.GAP_TOLERANCE,y=this.HV===r.KeepGaps?Math.min.apply(Math,a):Math.max.apply(Math,a);return Math.min(y,v)},e.prototype.qW=function(e,t){var n=this,i=this.pW(t),r=!0;if(t.forAll(function(e,o){if(r){var a=o.timescale,s=i*a,u=o.truncatedPresentationTimeOffset+s,c=o.truncatedBaseMediaDecodeTime;n.uW(c,u,o,t)||(n.BV.logger.debug("Cannot shift segments to EOB: would exceed timestamp limits for ".concat(e)),r=!1)}}),r){this.BV.logger.debug("Aligning segments with EOB by shifting ".concat(i," seconds"));var o={};t.forAll(function(e,t){var n=t.timescale,r=i*n;t.updateAsContinuous(t.truncatedBaseMediaDecodeTime,t.truncatedPresentationTimeOffset+r);var a=t.originalPresentationTimeOffset-t.truncatedPresentationTimeOffset;o[e]=a/t.timescale}),this.mW(o),e.forEach(function(e){return e.setDirty(!0)})}else this.BV.logger.debug("Cannot align segments with end of buffer: would exceed timestamp limits")},e.prototype.rW=function(e,t,n){return 0===t.length||(t.keys.every(function(e){return(t.get(e)||[]).length>0})?(this.bV(t),this.nW(e,t),n&&this.qW(e,t),!0):(this.BV.logger.debug("Could not handle BaseMediaDecodeTime overflow: at least one buffer is empty"),!1))},e.prototype.sW=function(e){var t;if(e.isBaseMediaDecodeTimeLimitExceeded)return!0;var n=(0,b.getLargestPrecedingSegmentTimeInfo)(null!==(t=this.DV.get(e.mimeType))&&void 0!==t?t:[],e.originalPlaybackTime);return!!n&&isFinite(n.truncatedBaseMediaDecodeTime)&&n.truncatedBaseMediaDecodeTime!==n.originalBaseMediaDecodeTime},e.prototype.tW=function(e,t,n){var i,r=e.duration,o=e.timescale,a=e.mimeType,s=this.DV.keys.find(function(e){return e!==a});if(!s)return!1;var u=null===(i=this.DV.get(s))||void 0===i?void 0:i.slice(-1)[0];if(!u)return!1;var c=(t+n)/o,l={start:c,end:c+r},f=u.playbackTime+u.duration,d={start:f,end:f+u.duration},p=Math.max(l.start,d.start);return!(Math.min(l.end,d.end)-p<=r/2)&&d.end*u.timescale-u.presentationTimeOffset>this.maxSafeBaseMediaDecodeTime},e.prototype.uW=function(e,t,n,i){var r=this,o=n.duration,a=n.timescale;if(e+o*a>this.maxSafeBaseMediaDecodeTime)return this.BV.logger.debug("Detected BMDT overflow for ".concat(n.mimeType," segment")),!1;if(this.tW(n,e,t))return this.BV.logger.debug("Triggering early BMDT overflow for ".concat(n.mimeType," segment")),!1;var s=t/a,u=e/a+o,c=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=[];return e.forEach(function(e){e.forAll(function(e,t){n.includes(t.timescale)||n.push(t.timescale)})}),n}(i,this.DV);return c.every(function(e){return r.vW(s,u,e)})},e.prototype.vW=function(e,t,n){return t*n+e*n<=this.maxSafeBaseMediaDecodeTime},e.prototype.wW=function(e){return Math.abs(e)>this.maxSafePresentationTimeOffset},e.prototype.xW=function(e){if(!(0,m.isTizen2017)())return!1;var t=e.originalPlaybackTime,n=e.duration,i=e.mimeType,r=t+n>(0,g.toSeconds)(this.maxSafeBaseMediaDecodeTime);return p.MimeTypeHelper.isAudio(i)&&r},e.prototype.yW=function(e,t){if(this.BV.settings.FORCE_BASE_MEDIA_DECODE_TIME_REWRITE)return!0;var n=e/t.timescale;return!!this.wW(n)||this.xW(t)},e.prototype.zW=function(e,t,n){var i=e.baseMediaDecodeTime,r=e.presentationTimeOffset,o=e.foundMatchingPreviousSegment,a=!this.uW(i,r,t,n);return o?a:a||this.yW(r,t)},e.prototype.AW=function(e){var t=this,n=new l.ArrayMap,i=new l.ArrayMap;return e.keys.forEach(function(r){var o;(0,T.ensureMimeTypeInMap)(n,r),(0,T.ensureMimeTypeInMap)(i,r),(0,T.ensureMimeTypeInMap)(t.DV,r);var a=null!==(o=t.DV.get(r))&&void 0!==o?o:[],s=a.length?a:t.DV.getAllValues();(e.get(r)||[]).forEach(function(r){var o=(0,b.findOverflowDataForSegmentInMap)(r,s,t.BV.settings.GAP_TOLERANCE,t.BV.logger);if(t.zW(o,r,e))t.BV.logger.debug("Segment added to discontinuous time info map.",r.segmentUrl,r.mimeType),r.updateAsDiscontinuous(),(0,T.addSegmentTimeInfoToMap)(i,r.mimeType,r);else{var a=o.baseMediaDecodeTime,u=o.presentationTimeOffset;r.updateAsContinuous(a,u),(0,T.addSegmentTimeInfoToMap)(n,r.mimeType,r)}})}),{discontinuousSegmentTimeInfoMap:i,continuousSegmentTimeInfoMap:n}},e.prototype.BW=function(e,t,n){var i,r=this.AW(t),o=r.discontinuousSegmentTimeInfoMap,a=r.continuousSegmentTimeInfoMap;if(this.WV(e,a),this.rW(e,o,n))return!0;var s=(0,M.maybeSwitchOverASegmentToDiscontinuous)({continuousSegmentTimeInfoMap:a,discontinuousSegmentTimeInfoMap:o});if(!s){var u=this.AW(this.DV);s=(0,M.maybeSwitchOverASegmentToDiscontinuous)({continuousSegmentTimeInfoMap:u.continuousSegmentTimeInfoMap,discontinuousSegmentTimeInfoMap:o}),this.BV.logger.debug("Did not find any matching segment time info in current map, retried with existing ones.",s)}return!!s&&(this.BV.logger.debug("Moved ".concat(s.mimeType," segment from continued to discontinued. Trying to process discontinued infos again."),{switchedSegmentUrl:s.segmentUrl,matchingSegmentUrl:null===(i=s.getMatchingSegment(e))||void 0===i?void 0:i.getUrl()}),this.rW(e,o,n))},e.prototype.CW=function(e){var t=this;e.forAll(function(e,n){var i;(null===(i=t.DV.get(e))||void 0===i?void 0:i.find(n.equals))||(0,T.addSegmentTimeInfoToMap)(t.DV,n.mimeType,n);var r=t.EV.get(n.mimeType);r&&r.resolve(0)})},e.prototype.DW=function(e){return e.every(function(e){return p.MimeTypeHelper.isMP4(e.getMimeType())})},e.prototype.EW=function(){this.maxSafeBaseMediaDecodeTime=1/0,this.maxSafePresentationTimeOffset=1/0},e.prototype.FW=function(){return this.maxSafeBaseMediaDecodeTime!==1/0||this.maxSafePresentationTimeOffset!==1/0},e.prototype.rewriteTimeStampsIfNecessary=function(e){var t;!this.DW(e)&&this.FW()&&(this.BV.logger.debug("Disabling BMDT rewriting due to unsupported container format"),this.EW());var n=this.GW(),i=e.map(E.getSectionId).reduce(S,[]).some(function(e){return!n.includes(e)}),r=function(e){return e.reduce(function(e,t){return e.includes(t.getMimeType())||e.push(t.getMimeType()),e},[])}(e),o=this.DV.keys.every(function(e){return r.includes(e)});if(i&&!o)return this.BV.logger.debug("Cannot check for rewriting necessity - not all buffers have data yet"),!1;var a=this.TV(e),s=a[0],u=a[1],c=a[2];if(s)return this.BW(e,c,u);if(i&&u)return this.HW(e,c),!0;for(var l=0,f=c.getAllValues();l<f.length;l++){var d=f[l],p=d.mimeType,m=null!==(t=this.DV.get(p))&&void 0!==t?t:[],g=(0,b.findPrecedingSegmentTimeInfo)(m,d,this.BV.settings.GAP_TOLERANCE);(null==g?void 0:g.isBaseMediaDecodeTimeLimitExceeded)&&!d.isBaseMediaDecodeTimeLimitExceeded&&(d.updateAsDiscontinuous(),d.updateAsContinuous(d.originalBaseMediaDecodeTime,g.truncatedPresentationTimeOffset))}return this.CW(c),!0},e.prototype.GW=function(){return this.DV.transform(function(e){return e.map(function(e){return e.sectionId})}).flatMap(function(e){return e}).reduce(S,[])},e.prototype.HW=function(e,t){var n={},i=this.pW(t);this.BV.logger.debug("Trying to handle PTO change, required shift: ".concat(i,"s")),t.forAll(function(e,t){var r=-i*t.timescale,o=r/t.timescale;t.isBaseMediaDecodeTimeLimitExceeded=!0,t.updateAsContinuous(t.originalBaseMediaDecodeTime,t.originalPresentationTimeOffset-r),n[t.mimeType]=o}),this.mW(n),this.CW(t),e.forEach(function(e){return e.setDirty(!0)})},e.prototype.signalBufferRemoval=function(e,t,n){var i;if(this.DV.has(e)){var r=o.BufferRangeHelper.mergeRanges(t,this.BV.settings.GAP_TOLERANCE),a=this.DV.get(e)||[],s=a.filter(function(e){return e.isPlaybackRangeOverlapping(r)});if(0===s.length&&this.mW(((i={})[e]=0,i)),this.IW(a,r,n)){var u=a[0];this.BV.logger.debug("Keeping reference BMDT segment info for mime type ".concat(e," after buffer clearing"),{segmentUrl:u.segmentUrl,sectionId:u.sectionId}),u.markAsReferenceSegment(),s.push(u)}this.DV.set(e,s)}},e.prototype.IW=function(e,t,n){var i=this.JW();if((0,d.isSwitchingBufferBlocks)(i)||0!==t.length||0===e.length)return!1;var r=this.BV.store.getState(),o=!!(null==r?void 0:r.player)&&(0,s.getIsSeekingOrTimeshifting)(r.player),u=this.BV.serviceManager.get(a.ServiceName.ManifestService,this.BV.sourceContext.sourceIdentifier),c=this.mapToExternalTime(n),l=null==u?void 0:u.getPeriodIdForTime(c);return!o&&e[0].periodId===l},e.prototype.mapToExternalTime=function(e,t){var n=this;void 0===t&&(t=!1);var i=this.DV.getAllValues(),r=i.find(function(t){var i=t.playbackRange.start-n.BV.settings.GAP_TOLERANCE,r=t.playbackRange.end+n.BV.settings.GAP_TOLERANCE;return!t.isReferenceSegment&&e>=i&&e<=r})||(t?i[0]:void 0);return r&&(this.GV=r.originalPlaybackTime-r.playbackTime),this.mapToCachedExternalTime(e)},e.prototype.mapToCachedExternalTime=function(e){return void 0!==this.GV?Math.max(this.GV+e,0):(this.BV.logger.debug("Couldn't map internal time ".concat(e," to external time")),e)},e.prototype.mapToInternalTime=function(e,t,n){var i=this;void 0===t&&(t=!1);var r=this.DV.getAllValues().filter(function(e){return void 0===n||n===e.mimeType}),o=r.find(function(t){var n=t.originalPlaybackRange.start-i.BV.settings.GAP_TOLERANCE,r=t.originalPlaybackRange.end+i.BV.settings.GAP_TOLERANCE;return e>=n&&e<=r})||(t?r[0]:void 0);return o?Math.max(o.playbackTime+(e-o.originalPlaybackTime),0):e},e.prototype.mapToExternalTimeRange=function(e){if(null!=e)return{start:this.mapToExternalTime(e.start),end:this.mapToExternalTime(e.end)}},e.prototype.mapToExternalTimeRanges=function(e){var t=this;return e.map(function(e){return t.mapToExternalTimeRange(e)}).filter(function(e){return void 0!==e})},e.prototype.mapToExternalTimeRangesMap=function(e){var t=this;return null==e?null:Object.keys(e).reduce(function(n,i){return n[i]=t.mapToExternalTimeRanges(e[i]),n},{})},e.prototype.getSegmentTimeRanges=function(e,t){var n=this,i=[];return e.forEach(function(e){var r=n.DV.get(t).find(function(t){return t.isSegmentMatching(e)});r&&i.push(r.playbackRange)}),i},e.prototype.getCorrectTimeStampOffset=function(e,t){var n=this.EV.get(e);return n||(n=new f.Deferred,this.EV.set(e,n)),n.promise.then(function(e){return t+e})},e.prototype.dispose=function(){var e,t,n,i;this.DV.clear(),this.OV(),null===(e=this.BV.videoElement)||void 0===e||e.removeEventListener(h.MediaElementEvent.currenttimenotadvancing,this.LV),null===(t=this.BV.videoElement)||void 0===t||t.removeEventListener(h.MediaElementEvent.waiting,this.LV),null===(n=this.BV.videoElement)||void 0===n||n.removeEventListener(h.MediaElementEvent.stalled,this.LV),null===(i=this.BV.videoElement)||void 0===i||i.removeEventListener(h.MediaElementEvent.timeupdate,this.KV)},e.prototype.JW=function(){return this.BV.serviceManager.get(a.ServiceName.SourceStoreService,this.BV.sourceContext.sourceIdentifier)},e}();t.BaseMediaDecodeTimeHandler=O;var _=Math.log(2);function B(e){return Math.ceil(Math.log(e+1)/_)}function S(e,t){return e.includes(t)||e.push(t),e}},44885:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.addSegmentTimeInfoToMap=void 0,t.ensureMimeTypeInMap=function(e,t){e.get(t)||e.addAll(t,[])},t.addSegmentTimeInfoToMap=function(e,t,n){(function(e,t,n){var i;return null===(i=e.get(t))||void 0===i?void 0:i.find(function(e){return e.segmentUrl===(null==n?void 0:n.segmentUrl)&&e.equals(n)})})(e,t,n)||e.add(t,n)}},73849:function(e,t){function n(e){return Math.floor(e.originalBaseMediaDecodeTime-e.baseMediaDecodeTime)}function i(e){return Math.floor(e.originalPresentationTimeOffset-e.presentationTimeOffset)}function r(e,t,n){return e.find(function(e){var i=e.originalPlaybackRange.end;return t.originalPlaybackRange.start>=i-n&&t.originalPlaybackRange.start<=i+n})}function o(e,t){return e.reduce(function(e,n){var i=n.originalPlaybackTime,r=e?e.originalPlaybackTime:-1/0;return i<t&&i>r?n:e},void 0)}Object.defineProperty(t,"__esModule",{value:!0}),t.findOverflowDataForSegmentInMap=function(e,t,a,s){var u=1/0,c=1/0,l=r(t,e,a)||o(t,e.originalPlaybackTime),f=l?e.timescale/l.timescale:1;1!==f&&s.debug("Detected a timescale change: ".concat(null==l?void 0:l.timescale," -> ").concat(e.timescale));var d=l&&e.originalPresentationTimeOffset===l.originalPresentationTimeOffset*f;return d&&(u=e.originalBaseMediaDecodeTime-Math.round(n(l)*f),c=e.originalPresentationTimeOffset-Math.round(i(l)*f)),{baseMediaDecodeTime:u,presentationTimeOffset:c,foundMatchingPreviousSegment:Boolean(d)}},t.getBmdtOffset=n,t.getPtoOffset=i,t.findPrecedingSegmentTimeInfo=r,t.getLargestPrecedingSegmentTimeInfo=o},8301:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.findContinuousSegmentToMove=t.maybeSwitchOverASegmentToDiscontinuous=void 0;var i=n(44885);t.maybeSwitchOverASegmentToDiscontinuous=function(e){var n=(0,t.findContinuousSegmentToMove)(e);return n&&(e.continuousSegmentTimeInfoMap.deleteValue(n.mimeType,n),n.updateAsDiscontinuous(),(0,i.addSegmentTimeInfoToMap)(e.discontinuousSegmentTimeInfoMap,n.mimeType,n)),n},t.findContinuousSegmentToMove=function(e){var t=e.continuousSegmentTimeInfoMap.keys;if(2!==t.length)return null;if(t.every(function(t){return e.continuousSegmentTimeInfoMap.get(t).length>0}))return null;for(var n=0,i=t;n<i.length;n++){var r=i[n];if(e.discontinuousSegmentTimeInfoMap.has(r)&&!((e.discontinuousSegmentTimeInfoMap.get(r)||[]).length>0)){var o=e.continuousSegmentTimeInfoMap.get(r)||[];if(o.length)return o[0]}}return null}},48558:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentTimeInformation=void 0,t.getSectionId=o;var i=n(4524),r=function(){function e(e,t){var n,i,r=this;this.equals=function(e){if(e){var t=r.mimeType===e.mimeType,n=r.duration===e.duration,i=r.originalBaseMediaDecodeTime===e.originalBaseMediaDecodeTime,o=r.sectionId===e.sectionId;return t&&n&&i&&o}return!1},this.segmentUrl=e.getUrl(),this.duration=e.getDuration(),this.mimeType=e.getMimeType(),this.timescale=null!==(n=e.getTimescale())&&void 0!==n?n:1,this.originalPlaybackTime=e.getPlaybackTime(),this.vcb=null===(i=e.getSegmentInfo())||void 0===i?void 0:i.byteRange,this.originalBaseMediaDecodeTime=e.getBaseMediaDecodeTime(),this.originalPresentationTimeOffset=e.getPresentationTimeOffset()*this.timescale,this.isBaseMediaDecodeTimeLimitExceeded=this.originalBaseMediaDecodeTime+this.duration*this.timescale>t,this.periodId=e.getPeriodId(),this.ucb=!1,this.sectionId=o(e),this.truncatedBaseMediaDecodeTime=1/0,this.truncatedPresentationTimeOffset=1/0,this.truncatedPlaybackTime=1/0}return Object.defineProperty(e.prototype,"isReferenceSegment",{get:function(){return this.ucb},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"playbackTime",{get:function(){return this.isBaseMediaDecodeTimeLimitExceeded&&this.truncatedPlaybackTime!==1/0?this.truncatedPlaybackTime:this.originalPlaybackTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseMediaDecodeTime",{get:function(){return this.isBaseMediaDecodeTimeLimitExceeded&&this.truncatedBaseMediaDecodeTime!==1/0?this.truncatedBaseMediaDecodeTime:this.originalBaseMediaDecodeTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"presentationTimeOffset",{get:function(){return this.isBaseMediaDecodeTimeLimitExceeded&&this.truncatedPresentationTimeOffset!==1/0?this.truncatedPresentationTimeOffset:this.originalPresentationTimeOffset},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"playbackRange",{get:function(){return{start:this.playbackTime,end:this.playbackTime+this.duration}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"originalPlaybackRange",{get:function(){return{start:this.originalPlaybackTime,end:this.originalPlaybackTime+this.duration}},enumerable:!1,configurable:!0}),e.prototype.getMatchingSegment=function(e){var t=this;return e.find(function(e){return t.isSegmentMatching(e)})},e.prototype.isSegmentMatching=function(e){var t,n,i,r=e.getUrl()===this.segmentUrl,o=e.getPlaybackTime()===this.originalPlaybackTime,a=null===(t=e.getSegmentInfo())||void 0===t?void 0:t.byteRange,s=(null==a?void 0:a.start)===(null===(n=this.vcb)||void 0===n?void 0:n.start),u=(null==a?void 0:a.end)===(null===(i=this.vcb)||void 0===i?void 0:i.end),c=s&&u,l=e.getMimeType()===this.mimeType;return r&&o&&c&&l},e.prototype.updateAsDiscontinuous=function(){this.isBaseMediaDecodeTimeLimitExceeded=!0},e.prototype.updateAsContinuous=function(e,t){this.truncatedBaseMediaDecodeTime=e,this.truncatedPresentationTimeOffset=t,this.truncatedPlaybackTime=(e-t)/this.timescale},e.prototype.markAsReferenceSegment=function(){this.ucb=!0},e.prototype.isPlaybackRangeOverlapping=function(e){var t=this.playbackRange,n={buffered:e},r=i.BufferRangeHelper.isInBufferedRange(n,t.start),o=i.BufferRangeHelper.isInBufferedRange(n,t.end),a=i.BufferRangeHelper.getCommonBufferedRanges({buffered:e,inSegment:[t]}).length>0;return r||o||a},e}();function o(e){var t,n,i;return null!==(i=null===(n=null===(t=e.getSegmentInfo())||void 0===t?void 0:t.discontinuitySequenceNumber)||void 0===n?void 0:n.toString())&&void 0!==i?i:e.getPeriodId()}t.SegmentTimeInformation=r},21651:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentTimeInformationArrayMap=void 0;var r=function(e){function t(){return e.call(this,function(e,t){return e.originalPlaybackTime-t.originalPlaybackTime})||this}return i(t,e),t.prototype.find=function(e){if(e)return this.get(e.getMimeType()).find(function(t){return t.isSegmentMatching(e)})},t}(n(61252).SortedArrayMap);t.SegmentTimeInformationArrayMap=r},61252:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.SortedArrayMap=void 0;var r=function(e){function t(t){var n=e.call(this)||this;return n.Cdb=t,n.Ddb=[],n}return i(t,e),t.prototype.getAllValues=function(){return this.Ddb},t.prototype.Edb=function(e){return e?e.sort(this.Cdb):[]},t.prototype.set=function(t,n){var i=this.Edb(n);return this.Fdb(t,i),e.prototype.set.call(this,t,i)},t.prototype.add=function(e,t){var n=t?[t]:[];return this.addAll(e,n),this},t.prototype.addAll=function(e,t){this.ensure(e),this.set(e,[].concat(t||[],this.get(e)))},t.prototype.delete=function(t){return this.Gdb(this.get(t)),e.prototype.delete.call(this,t)},t.prototype.deleteValue=function(t,n){return this.Gdb([n]),e.prototype.deleteValue.call(this,t,n)},t.prototype.clear=function(){this.Ddb=[],e.prototype.clear.call(this)},t.prototype.Fdb=function(e,t){void 0===t&&(t=[]);var n=this.get(e);this.Gdb(n),this.Ddb=this.Edb(this.Ddb.concat(t))},t.prototype.Gdb=function(e){var t=this;void 0===e&&(e=[]),e.forEach(function(e){var n=t.Ddb.indexOf(e);n>-1&&t.Ddb.splice(n,1)})},t}(n(19483).ArrayMap);t.SortedArrayMap=r},1124:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.getTvMseWrapperConstructor=function(){return void 0===r&&(r=l()),r};var r,o=n(3714),a=n(20213),s=n(70850),u=n(88052),c=n(24281),l=function(){return function(e){function t(t,n){var i=e.call(this,t)||this;return i.xcb={},i.wcb=n,i}return i(t,e),t.prototype.printDetailedBufferRange=function(e,t){var n;try{n=e.buffered}catch(e){return void this.logger.debug("".concat(t," buffer range: Error accessing buffered ranges"))}if(0!==n.length)for(var i=0;i<n.length;i++){var r=n.start(i),o=n.end(i);this.logger.debug("".concat(t," buffer range [").concat(i,"]: ").concat(this.wcb.mapToExternalTime(r,!0)," - ").concat(this.wcb.mapToExternalTime(o,!0)," (").concat(r," - ").concat(o,")"))}else this.logger.debug("".concat(t," buffer range: empty"))},t.prototype.getBufferStartTime=function(){var e=this,t=Object.keys(this.sourceBuffers).map(function(t){return 0===e.sourceBuffers[t].bufferedRanges.length?0:e.wcb.mapToExternalTime(e.sourceBuffers[t].bufferedRanges[0].start)});return Math.max.apply(null,t)},t.prototype.updateTimestampOffset=function(t,n){try{e.prototype.updateTimestampOffset.call(this,t,n)}catch(e){this.logger.error("Unable to update timestampOffset",e),e.code===DOMException.INVALID_STATE_ERR&&this.context.eventHandler.dispatchEvent(o.PlayerEvent.Warning,new a.PlayerWarning(a.WarningCode.PLAYBACK_WARNING,"Unable to update timestampOffset (Invalid State error)",e))}},t.prototype.ycb=function(e,t){this.xcb[e]||(this.xcb[e]={currentOffset:this.sourceBuffers[e].buffer.timestampOffset,pendingOffset:t})},t.prototype.queueTimestampOffsetUpdate=function(t,n){var i=this;return this.ycb(t,n),this.wcb.getCorrectTimeStampOffset(t,n).then(function(e){return i.xcb[t].pendingOffset=e}).then(function(){var n=i.xcb[t].pendingOffset,r=i.xcb[t].currentOffset;return s.Util.roundValue(r,6)===s.Util.roundValue(n,6)&&i.isMediaSourceOpen()?Promise.resolve():(i.logger.debug("Updating timestamp offset for ".concat(t," to ").concat(n," (uncorrected offset: ").concat(r,")")),i.xcb[t].currentOffset=n,e.prototype.queueTimestampOffsetUpdate.call(i,t,n).finally(function(){var e,n,r=null===(n=null===(e=i.sourceBuffers[t])||void 0===e?void 0:e.buffer)||void 0===n?void 0:n.timestampOffset;i.xcb[t].currentOffset=r}))})},t.prototype.getBufferRangeStart=function(e,t){void 0===t&&(t=0);var n=this.wcb.getEarliestExternalTimeBufferedRangeIndex(e);return Math.max(t,e.start(n))},t.prototype.preBufferRemoval=function(e,t,n){this.logger.debug("removing buffer for ".concat(e," (from ").concat(this.wcb.mapToExternalTime(t)," to ").concat(this.wcb.mapToExternalTime(n),") (").concat(t," to ").concat(n,")"))},t.prototype.getRangePendingRemoval=function(e){return this.sourceBuffers.hasOwnProperty(e)&&this.wcb.mapToExternalTimeRange(this.sourceBuffers[e].rangePendingRemoval)||void 0},t.prototype.addToBuffer=function(t){var n=this;return(0,c.rewriteUnsupportedBoxes)(t),this.zcb(t).then(function(){return e.prototype.addToBuffer.call(n,t)})},t.prototype.zcb=function(e){var t=e.getMimeType(),n=-e.getPresentationTimeOffset();return e.isDirty()&&!e.isInit()?this.setTimestampOffset(t,n):Promise.resolve()},t}(u.ModuleManager.get(a.ModuleName.RendererMse).MSEWrapper)}},35501:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),r=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var i,r=0,o=t.length;r<o;r++)!i&&r in t||(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.getTvRendererConstructor=function(){return void 0===o&&(o=m()),o};var o,a=n(4524),s=n(66790),u=n(34841),c=n(88052),l=n(62756),f=n(84276),d=n(48558),p=n(1124),m=function(){return function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.postBufferRemoval=function(e,n,i){t.video&&(t.baseMediaDecodeTimeHandler.signalBufferRemoval(e,t.vV(e),t.video.currentTime),t.logger.debug("successfully removed buffer for ".concat(e," (from ").concat(t.baseMediaDecodeTimeHandler.mapToExternalTime(n)," to ").concat(t.baseMediaDecodeTimeHandler.mapToExternalTime(i),") (").concat(n," to ").concat(i,")")))},t}return i(t,e),t.prototype.init=function(t){this.baseMediaDecodeTimeHandler=new f.BaseMediaDecodeTimeHandler(this.context,this.uV.bind(this),this.getMaxSafeBaseMediaDecodeTime(),this.getMaxSafePresentationTimeOffset()),e.prototype.init.call(this,t),this.tV||(this.tV=new u.Deferred),this.tV.resolve(this.baseMediaDecodeTimeHandler)},t.prototype.getMaxSafeBaseMediaDecodeTime=function(){return 1/0},t.prototype.getMaxSafePresentationTimeOffset=function(){return 1/0},t.prototype.createMSEWrapper=function(){return new((0,p.getTvMseWrapperConstructor)())(this.context,this.baseMediaDecodeTimeHandler)},t.prototype.getCurrentVideoTime=function(){return this.baseMediaDecodeTimeHandler.mapToExternalTime(e.prototype.getCurrentVideoTime.call(this))},t.prototype.getRangesInSourceBuffers=function(){return this.baseMediaDecodeTimeHandler.mapToExternalTimeRangesMap(e.prototype.getRangesInSourceBuffers.call(this))},t.prototype.getBufferedRanges=function(t){return this.baseMediaDecodeTimeHandler.mapToExternalTimeRanges(e.prototype.getBufferedRanges.call(this,t))},t.prototype.getVideoElementBufferedRanges=function(){var t=e.prototype.getVideoElementBufferedRanges.call(this);return this.baseMediaDecodeTimeHandler.mapToExternalTimeRanges(t)},t.prototype.uV=function(e){var t,n,i=this;if(!this.mse)return Promise.reject();var r=null===(t=this.mse)||void 0===t?void 0:t.getBufferedRanges(e),o=null!==(n=null==r?void 0:r.slice(1))&&void 0!==n?n:[];return Promise.all(o.map(function(t){var n;return i.logger.debug("Clearing buffer on rollover for ".concat(e," from ").concat(t.start," to ").concat(t.end)),null===(n=i.mse)||void 0===n?void 0:n.removeFromBuffer(e,t.start-i.settings.GAP_TOLERANCE,t.end+i.settings.GAP_TOLERANCE,i.postBufferRemoval)})).then(function(){})},t.prototype.removeData=function(e,t,n,i){if(void 0===i&&(i=!1),!this.mse)return Promise.reject();void 0===t&&void 0===n&&!i&&this.saveCurrentTime(),this.removeDataFromSegmentQueues(e,t,n);var r=void 0!==t?this.baseMediaDecodeTimeHandler.mapToInternalTime(t,!0,e):void 0,o=void 0!==n?this.baseMediaDecodeTimeHandler.mapToInternalTime(n,!0,e):void 0;return this.mse.removeFromBuffer(e,r,o,this.postBufferRemoval)},t.prototype.addSegmentFromQueueToMse=function(t){var n=this,i=this.wV(function(e){return!e.isInit()}),r=Object.keys(this.segmentQueues).every(function(e){var t=n.mse&&n.mse.getBufferedRanges(e).length>0,r=i.some(function(t){return t.getMimeType()===e});return t||r});if(0===i.length||!r)return Promise.reject(s.SOURCE_BUFFER_APPEND_STATUS.SUSPENDED);var o=i.reduce(function(e,t){return t.getPlaybackTime()<e.getPlaybackTime()?t:e},i[0]),a=(0,d.getSectionId)(o),u=this.wV(function(e){return!e.isInit()&&(0,d.getSectionId)(e)===a});return this.baseMediaDecodeTimeHandler.rewriteTimeStampsIfNecessary(u)?e.prototype.addSegmentFromQueueToMse.call(this,t):Promise.reject(s.SOURCE_BUFFER_APPEND_STATUS.SUSPENDED)},t.prototype.vV=function(e){var t,n;if(null===this.mse||!this.segmentQueues.hasOwnProperty(e))return[];var i=this.wV(function(e){return!e.isInit()}),o=this.baseMediaDecodeTimeHandler.getSegmentTimeRanges(i,e),s=null!==(n=null===(t=this.mse)||void 0===t?void 0:t.getBufferedRanges(e))&&void 0!==n?n:[];return a.BufferRangeHelper.mergeRanges(r(r([],o,!0),s,!0),this.settings.GAP_TOLERANCE)},t.prototype.adjustTimeToNextCommonBufferStart=function(t){var n=e.prototype.adjustTimeToNextCommonBufferStart.call(this,t);return isNaN(n)?NaN:Math.ceil(100*this.baseMediaDecodeTimeHandler.mapToInternalTime(n))/100},t.prototype.seekOnVideoElement=function(e){var t=this;return this.waitingForSeekedPromise=new Promise(function(n,i){if(t.video){t.video.currentTime=e;var r=t.video.currentTime;n(t.getBaseMediaDecodeTimeHandler().then(function(e){return e.mapToExternalTime(r)}))}else i("No video reference")}),this.waitingForSeekedPromise},t.prototype.getBaseMediaDecodeTimeHandler=function(){return this.tV.promise},t.prototype.wV=function(e){var t=this;return void 0===e&&(e=function(){return!0}),Object.keys(this.segmentQueues).flatMap(function(e){return t.segmentQueues[e]}).filter(e)},t.prototype.getEndOfBufferTime=function(){if(this.video&&this.video.buffered&&this.video.buffered.length>0&&this.baseMediaDecodeTimeHandler)return this.baseMediaDecodeTimeHandler.getEndOfBufferTime()},t.prototype.shutdown=function(t){var n=this;return e.prototype.shutdown.call(this,t).then(function(){n.xV()})},t.prototype.xV=function(){this.tV=new u.Deferred,this.baseMediaDecodeTimeHandler.dispose()},t.prototype.release=function(){return this.xV(),e.prototype.release.call(this)},t}(c.ModuleManager.get(l.ModuleName.RendererMse).MSERenderer)}},24281:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.rewriteUnsupportedBoxes=function(e,t){void 0===t&&(t=o),t.forEach(function(t){var n,i=null===(n=e.getParsedData())||void 0===n?void 0:n.get(t);i&&(0,r.rewriteMp4BoxType)(i,"free")})};var i=n(15487),r=n(2992),o=function(){var e=["skip"];return((0,i.isTizen2016)()||(0,i.isTizen2017)())&&e.push("moov.trak.edts"),e}()},85537:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.withDrmLicenseWaiting=function(e,t){return function(e){function n(){for(var n,i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];var a=e.apply(this,i)||this;return a.KW=[],a.encryptedEventHandler=function(e){var n;a.onEncryptedEvent(e);var i=a.drmService;if(i)for(var r=0,o=null!==(n=null==t?void 0:t(e.initData))&&void 0!==n?n:[];r<o.length;r++){var s=o[r];if(s.systemName===a.NW()){var u=btoa(i.preprocessInitDataStr(s));a.initializeLicense(s.systemName,u)}}},null===(n=a.video)||void 0===n||n.addEventListener(s.MediaElementEvent.encrypted,a.encryptedEventHandler),a.LW=(0,o.subscribe)(a.context.store)(function(e){return null==e?void 0:e.drmLicenses},function(e){return e&&a.resolveAvailableLicenses(e.drmData)}),a}return i(n,e),n.prototype.setCurrentTime=function(t){var n=this;return this.waitForDrmLicenseResolving().then(function(){return e.prototype.setCurrentTime.call(n,t)})},n.prototype.onEncryptedEvent=function(e){},Object.defineProperty(n.prototype,"MW",{get:function(){var e=this;return this.KW.filter(function(t){return t.systemName===e.NW()})},enumerable:!1,configurable:!0}),n.prototype.waitForDrmLicenseResolving=function(){var e,t,n,i=this,r=null===(n=null===(t=null===(e=this.context.store)||void 0===e?void 0:e.getState())||void 0===t?void 0:t.drmLicenses)||void 0===n?void 0:n.drmData;r&&this.resolveAvailableLicenses(r);var o=this.MW;return o.length>0&&this.logger.debug("setCurrentTime: waiting for ".concat(o.length," DRM license(s) before seeking")),Promise.all(o.map(function(e){return e.licenseReady.promise})).then(function(){o.length>0&&i.logger.debug("setCurrentTime: DRM license(s) ready, proceeding with seek")})},n.prototype.resolveAvailableLicenses=function(e){var t=this;this.MW.filter(function(t){return Boolean(e[t.systemName])}).forEach(function(n){var i=e[n.systemName],r=Object.keys(i).find(function(e){var t=i[e];return btoa(t.initDataStr)===n.licenseInfoKey});r&&e[n.systemName][r].hasLicense&&(t.logger.debug("DRM license ready for key system: ".concat(n.systemName," — unblocking seek")),n.licenseReady.resolve())})},n.prototype.initializeLicense=function(e,t){this.KW.some(function(n){return n.systemName===e&&n.licenseInfoKey===t})||(this.logger.debug("DRM encrypted event — tracking license for key system: ".concat(e)),this.KW.push({systemName:e,licenseInfoKey:t,licenseReady:new a.Deferred}))},n.prototype.NW=function(){var e,t;return this.context.serviceManager.has(r.ServiceName.DrmService)&&null!==(t=null===(e=this.context.serviceManager.get(r.ServiceName.DrmService))||void 0===e?void 0:e.getUsedKeySystemKind())&&void 0!==t?t:null},n.prototype.shutdown=function(t){var n;return t||(this.KW=[],this.LW(),null===(n=this.video)||void 0===n||n.removeEventListener(s.MediaElementEvent.encrypted,this.encryptedEventHandler)),e.prototype.shutdown.call(this,t)},n}(e)};var r=n(80813),o=n(93204),a=n(34841),s=n(19274)},69507:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.WebosModuleDefinition=void 0;var i=n(70962),r=n(15487),o=n(62756),a=n(41503),s=n(18616),u=n(99959),c=n(98745),l=n(42350),f=n(13492);t.WebosModuleDefinition={name:o.ModuleName.Webos,module:function(){return{getWebosRendererConstructor:u.getWebosRendererConstructor,getWebosDrmManagerConstructor:s.getWebosDrmManagerConstructor,WebosVideoElementWrapper:l.WebosVideoElementWrapper,getWebosUnprefixedEmeHandlerConstructor:c.getWebosUnprefixedEmeHandlerConstructor,getWebos2017UnprefixedEmeHandlerConstructor:a.getWebos2017UnprefixedEmeHandlerConstructor,getWebosWebkitPrefixedEmeHandlerConstructor:f.getWebosWebkitPrefixedEmeHandlerConstructor}},dependencies:[o.ModuleName.RendererMse],hooks:{add:function(){i.DefaultSettings.END_OF_BUFFER_RECOVERY_TOLERANCE=1,(0,r.isWebOs2019OrOlder)()&&(i.DefaultSettings.WEBOS_MAX_SAFE_BMDT=274877906943,i.DefaultSettings.WEBOS_MAX_SAFE_PTO=4194303),(0,r.isWebOs2019OrOlder)()?i.DefaultSettings.MAX_STARTUP_BUFFER=6:(0,r.isWebOs2020)()?i.DefaultSettings.MAX_STARTUP_BUFFER=4:i.DefaultSettings.MAX_STARTUP_BUFFER=2.5,(0,r.isWebOs2016)()&&(i.DefaultSettings.HLS_CLEAR_BUFFERS_ON_DISCONTINUITY_SWITCHES=!0)}}},t.default=t.WebosModuleDefinition},41503:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.getWebos2017UnprefixedEmeHandlerConstructor=function(){return void 0===r&&(r=function(){return function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.load=function(t,n,i,r){return e.prototype.load.call(this,t,n,i,r),Promise.resolve()},t.prototype.setupKeySystem=function(t){var n=this;return this.Bv=new o.Deferred,this.Bv.promise.then(function(){return e.prototype.setupKeySystem.call(n,t)}).catch(function(e){throw e})},t.prototype.addInitData=function(e){var t,n,i;e&&(null===(n=null===(t=this.context.sourceContext)||void 0===t?void 0:t.source.drm)||void 0===n?void 0:n.immediateLicenseRequest)&&(null===(i=this.Bv)||void 0===i||i.resolve())},t.prototype.processMediaEncryptedEvent=function(t){var n;return null===(n=this.Bv)||void 0===n||n.resolve(),e.prototype.processMediaEncryptedEvent.call(this,t)},t.prototype.unload=function(){var t;return null===(t=this.Bv)||void 0===t||t.reject("Unloaded the WebosEmeHandler"),e.prototype.unload.call(this)},t}((0,a.getWebosUnprefixedEmeHandlerConstructor)())}()),r};var r,o=n(34841),a=n(98745)},18616:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.getWebosDrmManagerConstructor=function(){if(null===s&&r.ModuleManager.has(o.ModuleName.DRM)){var e=r.ModuleManager.get(o.ModuleName.DRM).DRMManager;s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.setConfig=function(t,n){var i=this;return e.prototype.setConfig.call(this,t,n).then(function(e){return function(e){return e instanceof(0,a.getWebosWebkitPrefixedEmeHandlerConstructor)()}(i.emeHandler)&&i.emeHandler.setWebosDrmManager(i),e})},t.prototype.addInitData=function(t){var n,i;null===(i=null===(n=this.emeHandler)||void 0===n?void 0:n.addInitData)||void 0===i||i.call(n,t),e.prototype.addInitData.call(this,t)},t.prototype.getRequestedLicenses=function(){var e=this.getUsedKeySystemKind();return this.licenseStorage.getAllLicensesForKeySystem(e).filter(function(e){return e.hasLicense})},t.prototype.resetLicense=function(e,t){this.licenseStorage.resetLicense(t,e)},t}(e)}return s};var r=n(88052),o=n(62756),a=n(13492),s=null},70007:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.WebosOnPlayListener=void 0;var i=n(89927),r=n(19274),o=function(){function e(e){this.eventHandler=e}return e.prototype.listenToPlay=function(){var e=this;return new Promise(function(t,n){e.WW(),e.VW=function(){e.WW(),setTimeout(function(){n(new Error("Play promise rejected because the source was unloaded"))},(0,i.toSeconds)(1))},e.eventHandler.addEventListener(r.MediaElementEvent.emptied,e.VW)})},e.prototype.WW=function(){this.VW&&(this.eventHandler.removeEventListener(r.MediaElementEvent.emptied,this.VW),this.VW=void 0)},e.prototype.dispose=function(){this.WW()},e}();t.WebosOnPlayListener=o},99959:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.getWebosRendererConstructor=function(){var e;return null===f&&(f=d(null===(e=a.ModuleManager.get(s.ModuleName.DRM,!1))||void 0===e?void 0:e.parseInitData)),f};var r=n(77753),o=n(19274),a=n(88052),s=n(62756),u=n(84276),c=n(35501),l=n(85537),f=null,d=function(e){var t=(0,c.getTvRendererConstructor)();return function(e){function t(t){var n=e.call(this,t)||this;return n.Cv=new Map,n.Dv=!1,n.Ev=!1,n.baseMediaDecodeTimeHandler.setPtoGapFillingMode(u.PtoGapFillingMode.FillGaps),n}return i(t,e),t.prototype.onEncryptedEvent=function(e){this.Dv=!0},t.prototype.getMaxSafeBaseMediaDecodeTime=function(){return this.context.settings.WEBOS_MAX_SAFE_BMDT},t.prototype.getMaxSafePresentationTimeOffset=function(){return this.context.settings.WEBOS_MAX_SAFE_PTO},t.prototype.Fv=function(e){return!!function(e){var t=e.isInit(),n=e.isEncrypted(),i=e.hasDrmInitData();return!t&&n&&!i}(e)&&!this.Ev&&!this.Dv},t.prototype.Gv=function(){var e,t=this;if(0!==this.Cv.size){this.Cv.forEach(function(e){var n,i={type:o.MediaElementEvent.encrypted,initData:e};null===(n=t.context.videoElement)||void 0===n||n.eventHandler.triggerEvent(o.MediaElementEvent.encrypted,i)});var n=this.context.store.getState();(0,r.isInstanceState)(n)&&this.resolveAvailableLicenses(null===(e=a.ModuleManager.get(s.ModuleName.DRM).getLicenseState(n))||void 0===e?void 0:e.drmData)}else this.context.videoElement.eventHandler.triggerEvent(o.MediaElementEvent.encrypted)},t.prototype.Hv=function(e){this.mse&&(this.Ev=this.Ev||e.hasDrmInitData(),this.Fv(e)&&(this.context.logger.debug("Triggering encrypted event as segments don't contain any DRM init data"),this.Gv()))},t.prototype.addDrmInitData=function(t){var n=this;e.prototype.addDrmInitData.call(this,t),t.forEach(function(e){n.Cv.has(e.initDataStr)||n.Cv.set(e.initDataStr,e.initData)})},t.prototype.appendData=function(t){var n=this;return e.prototype.appendData.call(this,t).then(function(){return n.Hv(t)})},t.prototype.shutdown=function(t){var n,i,r=this;this.Cv.clear(),this.Dv=!1,this.Ev=!1;var o=function(){return e.prototype.shutdown.call(r,t).then(function(){var e;return null===(e=r.drmService)||void 0===e?void 0:e.suspend()})};return(null!==(i=null===(n=this.drmService)||void 0===n?void 0:n.prepareForMseShutdown())&&void 0!==i?i:Promise.resolve()).then(o,o)},t}((0,l.withDrmLicenseWaiting)(t,e))}},98745:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.getWebosUnprefixedEmeHandlerConstructor=function(){return void 0===r&&(r=s()),r},t.getWebosUnprefixedEmeHandlerClass=s;var r,o=n(88052),a=n(62756);function s(){return function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.Iv=null,t.Jv=null,t}return i(t,e),t.prototype.load=function(t,n,i,r){return e.prototype.load.call(this,t,n,i,r)},t.prototype.Kv=function(){var t=this;this.Iv&&e.prototype.setMediaKeys.call(this,this.Iv).catch(function(e){t.context.logger.debug("Could not reset media keys on Webos",e)}).finally(function(){t.Iv=null})},t.prototype.setMediaKeys=function(t){return this.Jv=t,e.prototype.setMediaKeys.call(this,t)},t.prototype.onServerCertificateSetFailed=function(t,n,i){var r=t!==this.Jv,o=n instanceof DOMException&&n.message.includes("Operation aborted");r&&o?this.context.logger.debug("[WebosUnprefixedEmeHandler] ignoring aborted setServerCertificate after MediaKeys change"):e.prototype.onServerCertificateSetFailed.call(this,t,n,i)},t.prototype.processMediaEncryptedEvent=function(t){e.prototype.processMediaEncryptedEvent.call(this,t),this.Kv()},t.prototype.closeSession=function(e){try{return e.close()}catch(e){return this.context.logger.debug("couldn't close session on unload",e),Promise.resolve()}},t.prototype.prepareForMseShutdown=function(){var e,t;return null!==(t=null===(e=this.video)||void 0===e?void 0:e.mediaKeysPromise)&&void 0!==t?t:Promise.resolve()},t.prototype.suspend=function(){var e,t;return this.Iv=null!==(t=null===(e=this.video)||void 0===e?void 0:e.mediaKeysObject)&&void 0!==t?t:null,this.setMediaKeys(null)},t.prototype.unload=function(){return this.Iv=null,this.Jv=null,e.prototype.unload.call(this)},t}(o.ModuleManager.get(a.ModuleName.DRM).UnprefixedEMEHandler)}},42350:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.WebosVideoElementWrapper=void 0;var r=n(21513),o=n(15487),a=n(79186),s=n(70007),u=function(e){function t(t,n){var i=e.call(this,t,n)||this;return i.Vv=new s.WebosOnPlayListener(i.eventHandler),i}return i(t,e),t.prototype.play=function(){return(0,r.getCapabilities)().chromiumVersion<=o.WEBOS_2018_2019_CHROMIUM_VERSION?Promise.race([e.prototype.play.call(this),this.Vv.listenToPlay()]):e.prototype.play.call(this)},t.prototype.dispose=function(){this.Vv.dispose(),e.prototype.dispose.call(this)},t}(a.VideoElementWrapper);t.WebosVideoElementWrapper=u},13492:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.getWebosWebkitPrefixedEmeHandlerConstructor=function(){if(null===s&&o.ModuleManager.has(a.ModuleName.DRM)){var e=o.ModuleManager.get(a.ModuleName.DRM);s=function(e){function t(t){var n=e.call(this,t)||this;return n.Uv=[],n}return i(t,e),t.prototype.invokeEncryptedListener=function(t,n){var i=this;if(this.Tv){var r=this.Tv.getUsedKeySystemKind();n.forEach(function(e){var t,n;if(e.systemName===r){var o=null!==(n=null===(t=i.keySystem)||void 0===t?void 0:t.getIdentifierFromInitData(e.initDataStr))&&void 0!==n?n:e.initDataStr,a=i.Uv.findIndex(function(e){return e.initDataStr===o});a>-1&&(i.Uv.splice(a,1),i.Tv.resetLicense(o,r))}})}e.prototype.invokeEncryptedListener.call(this,t,n)},t.prototype.prepareForMseShutdown=function(){var e,t=null===(e=this.context.serviceManager)||void 0===e?void 0:e.get(r.ServiceName.DrmService),n=null==t?void 0:t.getUsedKeySystemKind();return t&&n?t.waitForPendingLicenseRequests(n):Promise.resolve()},t.prototype.suspend=function(){return this.Tv&&(this.Uv=this.Tv.getRequestedLicenses()),e.prototype.suspend.call(this)},t.prototype.unload=function(){return this.Tv=null,e.prototype.unload.call(this)},t.prototype.setWebosDrmManager=function(e){this.Tv=e},t}(e.WebKitPrefixedEMEHandler)}return s};var r=n(80813),o=n(88052),a=n(62756),s=null}},function(e){return function(){return e(69507)}()}])});
|
|
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(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.webos=t():(e.bitmovin=e.bitmovin||{},e.bitmovin.player=e.bitmovin.player||{},e.bitmovin.player.webos=t())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[137],{84276:function(e,t,n){var i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseMediaDecodeTimeHandler=t.PtoGapFillingMode=void 0;var r,o=n(4524),a=n(80813),s=n(87827),u=n(68925),c=n(47602),f=n(19483),l=n(34841),d=n(87244),p=n(85434),m=n(15487),h=n(89927),v=n(19274),g=n(88052),y=n(62756),T=n(44885),M=n(73849),E=n(8301),b=n(48558),U=n(21651);!function(e){e.KeepGaps="keep-gaps",e.FillGaps="fill-gaps"}(r||(t.PtoGapFillingMode=r={}));var O=function(){function e(e,t,n,a){var s=this;this.maxSafeBaseMediaDecodeTime=n,this.maxSafePresentationTimeOffset=a,this.mU=function(){s.oU(s.dU.settings.END_OF_BUFFER_TOLERANCE)},this.nU=function(){s.oU(s.dU.settings.END_OF_BUFFER_RECOVERY_TOLERANCE)},this.tU=function(){if(s.dU.videoElement)try{var e=s.sU(),t=s.dU.videoElement.currentTime,n=s.pU(t).mapEach(function(e){return e.playbackRange}).mapAll(function(e){return o.BufferRangeHelper.mergeRanges(e,s.dU.settings.GAP_TOLERANCE)}).getObject(),r=o.BufferRangeHelper.getCommonBufferedRanges(i(i({},n),{bufferedRanges:e})).shift();if(void 0!==r){var a=r.getStart();s.dU.videoElement.currentTime=a,s.qU(),s.dU.videoElement.eventHandler.removeEventListener(v.MediaElementEvent.currenttimenotadvancing,s.nU),s.kU().finally(function(){var e;return null===(e=s.lV())||void 0===e?void 0:e.dispatch((0,u.setTimestampRollingOver)(!1))}).then(function(){}).catch(function(e){})}else s.rU()}catch(e){}},this.dU=e,this.jU=r.KeepGaps,this.hU=t,this.eU=void 0,this.gU=new Map,this.fU=new U.SegmentTimeInformationArrayMap,this.dU.videoElement&&(this.dU.videoElement.addEventListener(v.MediaElementEvent.waiting,this.nU),this.dU.videoElement.addEventListener(v.MediaElementEvent.stalled,this.nU),this.dU.videoElement.addEventListener(v.MediaElementEvent.timeupdate,this.mU),e.settings.FORCE_BASE_MEDIA_DECODE_TIME_REWRITE)}return e.prototype.kU=function(){var e=this,t=[];return this.lU().keys.forEach(function(n){t.push(e.hU(n))}),Promise.all(t).then(function(){})},e.prototype.getEndOfBufferTime=function(){var e=o.BufferRangeHelper.getCommonBufferedRanges(this.lU(!0).getObject()).sort(function(e,t){return e.getStart()-t.getStart()});return e.length>0?e[e.length-1].getEnd():0},e.prototype.setPtoGapFillingMode=function(e){this.jU=e},e.prototype.getEarliestExternalTimeBufferedRangeIndex=function(e){var t=0;try{for(var n=void 0,i=0;i<e.length;i++){var r=this.mapToExternalTime(e.start(i));(void 0===n||r<n)&&(n=r,t=i)}}catch(e){}return t},e.prototype.lU=function(e){var t=this;return void 0===e&&(e=!1),this.fU.mapEach(function(t){return e?t.originalPlaybackRange:t.playbackRange}).mapAll(function(e){return o.BufferRangeHelper.mergeRanges(e,t.dU.settings.GAP_TOLERANCE)})},e.prototype.oU=function(e){var t,n,i=this.dU.videoElement;if(i){var r=i.currentTime;if(!(r>=i.duration&&i.duration>0)){var o=i.buffered;if(o.length<2)null===(t=this.lV())||void 0===t||t.dispatch((0,u.setTimestampRollingOver)(!1));else if(0!==this.getEarliestExternalTimeBufferedRangeIndex(o)){var a=o.end(o.length-1);r>=a-Math.max(this.dU.settings.MINIMAL_BACKWARD_BUFFER_CLEARING_INTERVAL,this.dU.settings.END_OF_BUFFER_TOLERANCE,this.dU.settings.END_OF_BUFFER_RECOVERY_TOLERANCE)&&(null===(n=this.lV())||void 0===n||n.dispatch((0,u.setTimestampRollingOver)(!0))),r>=a-e&&this.tU()}}}},e.prototype.pU=function(e){var t=this,n=this.dU.settings.GAP_TOLERANCE,i=new f.ArrayMap;return this.fU.keys.forEach(function(r){var o=!1,a=-1/0,s=t.fU.get(r),u=!1;s.sort(function(e,t){return e.originalPlaybackTime-t.originalPlaybackTime});var c=s.filter(function(t){var i=t.playbackRange,r=i.start-n<=e&&i.end+n>=e;if(u=u||r,!isFinite(a)&&r)a=t.playbackTime;else if(isFinite(a))return o=o||t.playbackTime<a;return!1});0!==c.length||u||(s.sort(function(e,t){return e.originalPlaybackTime-t.originalPlaybackTime}),c=s.filter(function(t){return t.playbackRange.end<e})),i.addAll(r,c)}),i},e.prototype.qU=function(){void 0!==this.eU&&(this.eU(),this.eU=void 0)},e.prototype.rU=function(){var e=this,t=this.lV();void 0!==t&&(this.qU(),this.eU=(0,c.subscribeToRendererBufferChanges)(t,function(){return e.nU()}))},e.prototype.sU=function(){var e,t=[],n=null===(e=this.dU.videoElement)||void 0===e?void 0:e.buffered;if(!function(e){return 0!==(null==e?void 0:e.length)}(n))return[];for(var i=0;i<n.length;i++)t.push({start:n.start(i),end:n.end(i)});return t},e.prototype.uU=function(e){var t,n=e.getMimeType(),i=e.getPlaybackTimeRange();if(void 0!==i){var r=(null!==(t=this.fU.get(n))&&void 0!==t?t:[]).filter(function(e){return e.originalPlaybackRange.end<i.end});return r[r.length-1]}},e.prototype.vU=function(e){var t=this,n=!1,i=!1,o=new U.SegmentTimeInformationArrayMap;return this.fU.keys.forEach(function(e){return(0,T.ensureMimeTypeInMap)(o,e)}),e.forEach(function(e){if(!e.isDirty()){var a=new b.SegmentTimeInformation(e,t.maxSafeBaseMediaDecodeTime),s=a.presentationTimeOffset/a.timescale,u=t.OU(s),c=t.PU(a);(n=n||u||c||t.dU.settings.FORCE_BASE_MEDIA_DECODE_TIME_REWRITE||t.KU(a)||t.LU(a,a.baseMediaDecodeTime,a.presentationTimeOffset))&&(a.isBaseMediaDecodeTimeLimitExceeded=!0);var f=t.uU(e);(f?f.originalPresentationTimeOffset/f.timescale:s)===s||t.jU!==r.FillGaps&&!(null==f?void 0:f.isBaseMediaDecodeTimeLimitExceeded)||(i=!0),(0,T.addSegmentTimeInfoToMap)(o,a.mimeType,a)}}),[n,i,o]},e.prototype.wU=function(e){return g.ModuleManager.has(y.ModuleName.ContainerMP4)?e.getTFDTBoxOffsets()||g.ModuleManager.get(y.ModuleName.ContainerMP4).parseTfdtBoxOffsets(e):[]},e.prototype.xU=function(e,t){var n=this.wU(e);e.setTFDTBoxOffsets(n);var i=e.getBaseMediaDecodeTime()-t.truncatedBaseMediaDecodeTime;e.getTFDTBoxOffsets().forEach(function(t){var n=0,r=new DataView(e.getData(),t),o=r.getUint32(n);n+=4;var a=String.fromCharCode(r.getUint8(n++),r.getUint8(n++),r.getUint8(n++),r.getUint8(n++));if(n+=1===o?8:0,"tfdt"===a){var s=r.getUint8(n);n+=4,1===s?function(e,t,n){var i=e.getUint32(t),r=e.getUint32(t+4),o=i*Math.pow(2,32)+r-n;e.setUint32(t,Math.floor(o/Math.pow(2,32))),t+=4,e.setUint32(t,o)}(r,n,i):function(e,t,n){var i=e.getUint32(t)-n;e.setUint32(t,i)}(r,n,i)}}),e.setBaseMediaDecodeTime(t.truncatedBaseMediaDecodeTime),e.setDirty(!0)},e.prototype.yU=function(e,t){var n=this;t.forAll(function(t,i){(0,T.addSegmentTimeInfoToMap)(n.fU,t,i);var r=i.getMatchingSegment(e);r&&n.xU(r,i)})},e.prototype.zU=function(e,t){return e.reduce(function(e,n){var i=t(n),r=Math.floor(i/n.timescale);return!isFinite(e)&&isFinite(r)||r<e?r:e},-1/0)},e.prototype.AU=function(e,t){var n=this;return Math.min.apply(Math,e.transform(function(e){return n.zU(e,t)}))},e.prototype.BU=function(e){return this.AU(e,function(e){return e.truncatedBaseMediaDecodeTime-e.truncatedPresentationTimeOffset})},e.prototype.CU=function(e){return this.AU(e,function(e){return e.originalPresentationTimeOffset})},e.prototype.DU=function(e){var t={},n=this.CU(e);isFinite(n)&&(e.forAll(function(e,i){var r=i.timescale,o=i.originalBaseMediaDecodeTime,a=i.originalPresentationTimeOffset,s=Math.floor(a-n*r),u=a-s,c=o-u,f=Math.floor(u/r);i.truncatedBaseMediaDecodeTime=c,i.truncatedPresentationTimeOffset=s,t.hasOwnProperty(e)||(t[e]=f)}),this.EU(t))},e.prototype.EU=function(e){var t=this;Object.keys(e).forEach(function(n){var i=t.gU.get(n);i&&i.resolve(e[n]);var r=new l.Deferred;t.gU.set(n,r),r.resolve(e[n])})},e.prototype.FU=function(e,t){var n,i=this,r=this.BU(t);isFinite(r)&&(t.forAll(function(t,n){var o=n.getMatchingSegment(e);o&&i.GU(o,n,r),(0,T.addSegmentTimeInfoToMap)(i.fU,t,n)}),null===(n=this.dU.videoElement)||void 0===n||n.addEventListener(v.MediaElementEvent.currenttimenotadvancing,this.nU))},e.prototype.GU=function(e,t,n){t.truncatedBaseMediaDecodeTime=t.truncatedBaseMediaDecodeTime-t.timescale*n,t.truncatedPlaybackTime=(t.truncatedBaseMediaDecodeTime-t.truncatedPresentationTimeOffset)/t.timescale,this.xU(e,t)},e.prototype.HU=function(e){for(var t,n,i=e.keys,o=e.getAll(),a=[],s=1/0,u=0,c=i;u<c.length;u++){var f=c[u],l=(null!==(t=this.fU.get(f))&&void 0!==t?t:[]).filter(function(e){return!o.includes(e)&&!e.isReferenceSegment});l.sort(function(e,t){return e.originalPlaybackTime-t.originalPlaybackTime});var d=l.pop(),p=null!==(n=null==d?void 0:d.playbackRange.end)&&void 0!==n?n:1/0,m=e.get(f)||[];if(0===m.length)return 1/0;var h=Math.min.apply(Math,m.map(function(e){return e.playbackTime})),v=h-p;s=Math.min(s,h),isFinite(v)&&a.push(v)}if(a.length!==i.length)return 0;var g=s-this.dU.settings.GAP_TOLERANCE,y=this.jU===r.KeepGaps?Math.min.apply(Math,a):Math.max.apply(Math,a);return Math.min(y,g)},e.prototype.IU=function(e,t){var n=this,i=this.HU(t),r=!0;if(t.forAll(function(e,o){if(r){var a=o.timescale,s=i*a,u=o.truncatedPresentationTimeOffset+s,c=o.truncatedBaseMediaDecodeTime;n.MU(c,u,o,t)||(r=!1)}}),r){var o={};t.forAll(function(e,t){var n=t.timescale,r=i*n;t.updateAsContinuous(t.truncatedBaseMediaDecodeTime,t.truncatedPresentationTimeOffset+r);var a=t.originalPresentationTimeOffset-t.truncatedPresentationTimeOffset;o[e]=a/t.timescale}),this.EU(o),e.forEach(function(e){return e.setDirty(!0)})}},e.prototype.JU=function(e,t,n){return 0===t.length||!!t.keys.every(function(e){return(t.get(e)||[]).length>0})&&(this.DU(t),this.FU(e,t),n&&this.IU(e,t),!0)},e.prototype.KU=function(e){var t;if(e.isBaseMediaDecodeTimeLimitExceeded)return!0;var n=(0,M.getLargestPrecedingSegmentTimeInfo)(null!==(t=this.fU.get(e.mimeType))&&void 0!==t?t:[],e.originalPlaybackTime);return!!n&&isFinite(n.truncatedBaseMediaDecodeTime)&&n.truncatedBaseMediaDecodeTime!==n.originalBaseMediaDecodeTime},e.prototype.LU=function(e,t,n){var i,r=e.duration,o=e.timescale,a=e.mimeType,s=this.fU.keys.find(function(e){return e!==a});if(!s)return!1;var u=null===(i=this.fU.get(s))||void 0===i?void 0:i.slice(-1)[0];if(!u)return!1;var c=(t+n)/o,f={start:c,end:c+r},l=u.playbackTime+u.duration,d={start:l,end:l+u.duration},p=Math.max(f.start,d.start);return!(Math.min(f.end,d.end)-p<=r/2)&&d.end*u.timescale-u.presentationTimeOffset>this.maxSafeBaseMediaDecodeTime},e.prototype.MU=function(e,t,n,i){var r=this,o=n.duration,a=n.timescale;if(e+o*a>this.maxSafeBaseMediaDecodeTime)return!1;if(this.LU(n,e,t))return!1;var s=t/a,u=e/a+o,c=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=[];return e.forEach(function(e){e.forAll(function(e,t){n.includes(t.timescale)||n.push(t.timescale)})}),n}(i,this.fU);return c.every(function(e){return r.NU(s,u,e)})},e.prototype.NU=function(e,t,n){return t*n+e*n<=this.maxSafeBaseMediaDecodeTime},e.prototype.OU=function(e){return Math.abs(e)>this.maxSafePresentationTimeOffset},e.prototype.PU=function(e){if(!(0,m.isTizen2017)())return!1;var t=e.originalPlaybackTime,n=e.duration,i=e.mimeType,r=t+n>(0,h.toSeconds)(this.maxSafeBaseMediaDecodeTime);return p.MimeTypeHelper.isAudio(i)&&r},e.prototype.QU=function(e,t){if(this.dU.settings.FORCE_BASE_MEDIA_DECODE_TIME_REWRITE)return!0;var n=e/t.timescale;return!!this.OU(n)||this.PU(t)},e.prototype.RU=function(e,t,n){var i=e.baseMediaDecodeTime,r=e.presentationTimeOffset,o=e.foundMatchingPreviousSegment,a=!this.MU(i,r,t,n);return o?a:a||this.QU(r,t)},e.prototype.cV=function(e){var t=this,n=new f.ArrayMap,i=new f.ArrayMap;return e.keys.forEach(function(r){var o;(0,T.ensureMimeTypeInMap)(n,r),(0,T.ensureMimeTypeInMap)(i,r),(0,T.ensureMimeTypeInMap)(t.fU,r);var a=null!==(o=t.fU.get(r))&&void 0!==o?o:[],s=a.length?a:t.fU.getAllValues();(e.get(r)||[]).forEach(function(r){var o=(0,M.findOverflowDataForSegmentInMap)(r,s,t.dU.settings.GAP_TOLERANCE,t.dU.logger);if(t.RU(o,r,e))r.updateAsDiscontinuous(),(0,T.addSegmentTimeInfoToMap)(i,r.mimeType,r);else{var a=o.baseMediaDecodeTime,u=o.presentationTimeOffset;r.updateAsContinuous(a,u),(0,T.addSegmentTimeInfoToMap)(n,r.mimeType,r)}})}),{discontinuousSegmentTimeInfoMap:i,continuousSegmentTimeInfoMap:n}},e.prototype.dV=function(e,t,n){var i=this.cV(t),r=i.discontinuousSegmentTimeInfoMap,o=i.continuousSegmentTimeInfoMap;if(this.yU(e,o),this.JU(e,r,n))return!0;var a=(0,E.maybeSwitchOverASegmentToDiscontinuous)({continuousSegmentTimeInfoMap:o,discontinuousSegmentTimeInfoMap:r});if(!a){var s=this.cV(this.fU);a=(0,E.maybeSwitchOverASegmentToDiscontinuous)({continuousSegmentTimeInfoMap:s.continuousSegmentTimeInfoMap,discontinuousSegmentTimeInfoMap:r})}return!!a&&this.JU(e,r,n)},e.prototype.eV=function(e){var t=this;e.forAll(function(e,n){var i;(null===(i=t.fU.get(e))||void 0===i?void 0:i.find(n.equals))||(0,T.addSegmentTimeInfoToMap)(t.fU,n.mimeType,n);var r=t.gU.get(n.mimeType);r&&r.resolve(0)})},e.prototype.fV=function(e){return e.every(function(e){return p.MimeTypeHelper.isMP4(e.getMimeType())})},e.prototype.gV=function(){this.maxSafeBaseMediaDecodeTime=1/0,this.maxSafePresentationTimeOffset=1/0},e.prototype.hV=function(){return this.maxSafeBaseMediaDecodeTime!==1/0||this.maxSafePresentationTimeOffset!==1/0},e.prototype.rewriteTimeStampsIfNecessary=function(e){var t;!this.fV(e)&&this.hV()&&this.gV();var n=this.iV(),i=e.map(b.getSectionId).reduce(_,[]).some(function(e){return!n.includes(e)}),r=function(e){return e.reduce(function(e,t){return e.includes(t.getMimeType())||e.push(t.getMimeType()),e},[])}(e),o=this.fU.keys.every(function(e){return r.includes(e)});if(i&&!o)return!1;var a=this.vU(e),s=a[0],u=a[1],c=a[2];if(s)return this.dV(e,c,u);if(i&&u)return this.jV(e,c),!0;for(var f=0,l=c.getAllValues();f<l.length;f++){var d=l[f],p=d.mimeType,m=null!==(t=this.fU.get(p))&&void 0!==t?t:[],h=(0,M.findPrecedingSegmentTimeInfo)(m,d,this.dU.settings.GAP_TOLERANCE);(null==h?void 0:h.isBaseMediaDecodeTimeLimitExceeded)&&!d.isBaseMediaDecodeTimeLimitExceeded&&(d.updateAsDiscontinuous(),d.updateAsContinuous(d.originalBaseMediaDecodeTime,h.truncatedPresentationTimeOffset))}return this.eV(c),!0},e.prototype.iV=function(){return this.fU.transform(function(e){return e.map(function(e){return e.sectionId})}).flatMap(function(e){return e}).reduce(_,[])},e.prototype.jV=function(e,t){var n={},i=this.HU(t);t.forAll(function(e,t){var r=-i*t.timescale,o=r/t.timescale;t.isBaseMediaDecodeTimeLimitExceeded=!0,t.updateAsContinuous(t.originalBaseMediaDecodeTime,t.originalPresentationTimeOffset-r),n[t.mimeType]=o}),this.EU(n),this.eV(t),e.forEach(function(e){return e.setDirty(!0)})},e.prototype.signalBufferRemoval=function(e,t,n){var i;if(this.fU.has(e)){var r=o.BufferRangeHelper.mergeRanges(t,this.dU.settings.GAP_TOLERANCE),a=this.fU.get(e)||[],s=a.filter(function(e){return e.isPlaybackRangeOverlapping(r)});if(0===s.length&&this.EU(((i={})[e]=0,i)),this.kV(a,r,n)){var u=a[0];u.markAsReferenceSegment(),s.push(u)}this.fU.set(e,s)}},e.prototype.kV=function(e,t,n){var i=this.lV();if((0,d.isSwitchingBufferBlocks)(i)||0!==t.length||0===e.length)return!1;var r=this.dU.store.getState(),o=!!(null==r?void 0:r.player)&&(0,s.getIsSeekingOrTimeshifting)(r.player),u=this.dU.serviceManager.get(a.ServiceName.ManifestService,this.dU.sourceContext.sourceIdentifier),c=this.mapToExternalTime(n),f=null==u?void 0:u.getPeriodIdForTime(c);return!o&&e[0].periodId===f},e.prototype.mapToExternalTime=function(e,t){var n=this;void 0===t&&(t=!1);var i=this.fU.getAllValues(),r=i.find(function(t){var i=t.playbackRange.start-n.dU.settings.GAP_TOLERANCE,r=t.playbackRange.end+n.dU.settings.GAP_TOLERANCE;return!t.isReferenceSegment&&e>=i&&e<=r})||(t?i[0]:void 0);return r&&(this.iU=r.originalPlaybackTime-r.playbackTime),this.mapToCachedExternalTime(e)},e.prototype.mapToCachedExternalTime=function(e){return void 0!==this.iU?Math.max(this.iU+e,0):e},e.prototype.mapToInternalTime=function(e,t,n){var i=this;void 0===t&&(t=!1);var r=this.fU.getAllValues().filter(function(e){return void 0===n||n===e.mimeType}),o=r.find(function(t){var n=t.originalPlaybackRange.start-i.dU.settings.GAP_TOLERANCE,r=t.originalPlaybackRange.end+i.dU.settings.GAP_TOLERANCE;return e>=n&&e<=r})||(t?r[0]:void 0);return o?Math.max(o.playbackTime+(e-o.originalPlaybackTime),0):e},e.prototype.mapToExternalTimeRange=function(e){if(null!=e)return{start:this.mapToExternalTime(e.start),end:this.mapToExternalTime(e.end)}},e.prototype.mapToExternalTimeRanges=function(e){var t=this;return e.map(function(e){return t.mapToExternalTimeRange(e)}).filter(function(e){return void 0!==e})},e.prototype.mapToExternalTimeRangesMap=function(e){var t=this;return null==e?null:Object.keys(e).reduce(function(n,i){return n[i]=t.mapToExternalTimeRanges(e[i]),n},{})},e.prototype.getSegmentTimeRanges=function(e,t){var n=this,i=[];return e.forEach(function(e){var r=n.fU.get(t).find(function(t){return t.isSegmentMatching(e)});r&&i.push(r.playbackRange)}),i},e.prototype.getCorrectTimeStampOffset=function(e,t){var n=this.gU.get(e);return n||(n=new l.Deferred,this.gU.set(e,n)),n.promise.then(function(e){return t+e})},e.prototype.dispose=function(){var e,t,n,i;this.fU.clear(),this.qU(),null===(e=this.dU.videoElement)||void 0===e||e.removeEventListener(v.MediaElementEvent.currenttimenotadvancing,this.nU),null===(t=this.dU.videoElement)||void 0===t||t.removeEventListener(v.MediaElementEvent.waiting,this.nU),null===(n=this.dU.videoElement)||void 0===n||n.removeEventListener(v.MediaElementEvent.stalled,this.nU),null===(i=this.dU.videoElement)||void 0===i||i.removeEventListener(v.MediaElementEvent.timeupdate,this.mU)},e.prototype.lV=function(){return this.dU.serviceManager.get(a.ServiceName.SourceStoreService,this.dU.sourceContext.sourceIdentifier)},e}();function _(e,t){return e.includes(t)||e.push(t),e}t.BaseMediaDecodeTimeHandler=O,Math.log(2)},44885:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.addSegmentTimeInfoToMap=void 0,t.ensureMimeTypeInMap=function(e,t){e.get(t)||e.addAll(t,[])},t.addSegmentTimeInfoToMap=function(e,t,n){(function(e,t,n){var i;return null===(i=e.get(t))||void 0===i?void 0:i.find(function(e){return e.segmentUrl===(null==n?void 0:n.segmentUrl)&&e.equals(n)})})(e,t,n)||e.add(t,n)}},73849:function(e,t){function n(e){return Math.floor(e.originalBaseMediaDecodeTime-e.baseMediaDecodeTime)}function i(e){return Math.floor(e.originalPresentationTimeOffset-e.presentationTimeOffset)}function r(e,t,n){return e.find(function(e){var i=e.originalPlaybackRange.end;return t.originalPlaybackRange.start>=i-n&&t.originalPlaybackRange.start<=i+n})}function o(e,t){return e.reduce(function(e,n){var i=n.originalPlaybackTime,r=e?e.originalPlaybackTime:-1/0;return i<t&&i>r?n:e},void 0)}Object.defineProperty(t,"__esModule",{value:!0}),t.findOverflowDataForSegmentInMap=function(e,t,a,s){var u=1/0,c=1/0,f=r(t,e,a)||o(t,e.originalPlaybackTime),l=f?e.timescale/f.timescale:1,d=f&&e.originalPresentationTimeOffset===f.originalPresentationTimeOffset*l;return d&&(u=e.originalBaseMediaDecodeTime-Math.round(n(f)*l),c=e.originalPresentationTimeOffset-Math.round(i(f)*l)),{baseMediaDecodeTime:u,presentationTimeOffset:c,foundMatchingPreviousSegment:Boolean(d)}},t.getBmdtOffset=n,t.getPtoOffset=i,t.findPrecedingSegmentTimeInfo=r,t.getLargestPrecedingSegmentTimeInfo=o},8301:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.findContinuousSegmentToMove=t.maybeSwitchOverASegmentToDiscontinuous=void 0;var i=n(44885);t.maybeSwitchOverASegmentToDiscontinuous=function(e){var n=(0,t.findContinuousSegmentToMove)(e);return n&&(e.continuousSegmentTimeInfoMap.deleteValue(n.mimeType,n),n.updateAsDiscontinuous(),(0,i.addSegmentTimeInfoToMap)(e.discontinuousSegmentTimeInfoMap,n.mimeType,n)),n},t.findContinuousSegmentToMove=function(e){var t=e.continuousSegmentTimeInfoMap.keys;if(2!==t.length)return null;if(t.every(function(t){return e.continuousSegmentTimeInfoMap.get(t).length>0}))return null;for(var n=0,i=t;n<i.length;n++){var r=i[n];if(e.discontinuousSegmentTimeInfoMap.has(r)&&!((e.discontinuousSegmentTimeInfoMap.get(r)||[]).length>0)){var o=e.continuousSegmentTimeInfoMap.get(r)||[];if(o.length)return o[0]}}return null}},48558:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentTimeInformation=void 0,t.getSectionId=o;var i=n(4524),r=function(){function e(e,t){var n,i,r=this;this.equals=function(e){if(e){var t=r.mimeType===e.mimeType,n=r.duration===e.duration,i=r.originalBaseMediaDecodeTime===e.originalBaseMediaDecodeTime,o=r.sectionId===e.sectionId;return t&&n&&i&&o}return!1},this.segmentUrl=e.getUrl(),this.duration=e.getDuration(),this.mimeType=e.getMimeType(),this.timescale=null!==(n=e.getTimescale())&&void 0!==n?n:1,this.originalPlaybackTime=e.getPlaybackTime(),this.Aab=null===(i=e.getSegmentInfo())||void 0===i?void 0:i.byteRange,this.originalBaseMediaDecodeTime=e.getBaseMediaDecodeTime(),this.originalPresentationTimeOffset=e.getPresentationTimeOffset()*this.timescale,this.isBaseMediaDecodeTimeLimitExceeded=this.originalBaseMediaDecodeTime+this.duration*this.timescale>t,this.periodId=e.getPeriodId(),this.zab=!1,this.sectionId=o(e),this.truncatedBaseMediaDecodeTime=1/0,this.truncatedPresentationTimeOffset=1/0,this.truncatedPlaybackTime=1/0}return Object.defineProperty(e.prototype,"isReferenceSegment",{get:function(){return this.zab},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"playbackTime",{get:function(){return this.isBaseMediaDecodeTimeLimitExceeded&&this.truncatedPlaybackTime!==1/0?this.truncatedPlaybackTime:this.originalPlaybackTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseMediaDecodeTime",{get:function(){return this.isBaseMediaDecodeTimeLimitExceeded&&this.truncatedBaseMediaDecodeTime!==1/0?this.truncatedBaseMediaDecodeTime:this.originalBaseMediaDecodeTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"presentationTimeOffset",{get:function(){return this.isBaseMediaDecodeTimeLimitExceeded&&this.truncatedPresentationTimeOffset!==1/0?this.truncatedPresentationTimeOffset:this.originalPresentationTimeOffset},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"playbackRange",{get:function(){return{start:this.playbackTime,end:this.playbackTime+this.duration}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"originalPlaybackRange",{get:function(){return{start:this.originalPlaybackTime,end:this.originalPlaybackTime+this.duration}},enumerable:!1,configurable:!0}),e.prototype.getMatchingSegment=function(e){var t=this;return e.find(function(e){return t.isSegmentMatching(e)})},e.prototype.isSegmentMatching=function(e){var t,n,i,r=e.getUrl()===this.segmentUrl,o=e.getPlaybackTime()===this.originalPlaybackTime,a=null===(t=e.getSegmentInfo())||void 0===t?void 0:t.byteRange,s=(null==a?void 0:a.start)===(null===(n=this.Aab)||void 0===n?void 0:n.start),u=(null==a?void 0:a.end)===(null===(i=this.Aab)||void 0===i?void 0:i.end),c=s&&u,f=e.getMimeType()===this.mimeType;return r&&o&&c&&f},e.prototype.updateAsDiscontinuous=function(){this.isBaseMediaDecodeTimeLimitExceeded=!0},e.prototype.updateAsContinuous=function(e,t){this.truncatedBaseMediaDecodeTime=e,this.truncatedPresentationTimeOffset=t,this.truncatedPlaybackTime=(e-t)/this.timescale},e.prototype.markAsReferenceSegment=function(){this.zab=!0},e.prototype.isPlaybackRangeOverlapping=function(e){var t=this.playbackRange,n={buffered:e},r=i.BufferRangeHelper.isInBufferedRange(n,t.start),o=i.BufferRangeHelper.isInBufferedRange(n,t.end),a=i.BufferRangeHelper.getCommonBufferedRanges({buffered:e,inSegment:[t]}).length>0;return r||o||a},e}();function o(e){var t,n,i;return null!==(i=null===(n=null===(t=e.getSegmentInfo())||void 0===t?void 0:t.discontinuitySequenceNumber)||void 0===n?void 0:n.toString())&&void 0!==i?i:e.getPeriodId()}t.SegmentTimeInformation=r},21651:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentTimeInformationArrayMap=void 0;var r=function(e){function t(){return e.call(this,function(e,t){return e.originalPlaybackTime-t.originalPlaybackTime})||this}return i(t,e),t.prototype.find=function(e){if(e)return this.get(e.getMimeType()).find(function(t){return t.isSegmentMatching(e)})},t}(n(61252).SortedArrayMap);t.SegmentTimeInformationArrayMap=r},61252:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.SortedArrayMap=void 0;var r=function(e){function t(t){var n=e.call(this)||this;return n.Cdb=t,n.Ddb=[],n}return i(t,e),t.prototype.getAllValues=function(){return this.Ddb},t.prototype.Edb=function(e){return e?e.sort(this.Cdb):[]},t.prototype.set=function(t,n){var i=this.Edb(n);return this.Fdb(t,i),e.prototype.set.call(this,t,i)},t.prototype.add=function(e,t){var n=t?[t]:[];return this.addAll(e,n),this},t.prototype.addAll=function(e,t){this.ensure(e),this.set(e,[].concat(t||[],this.get(e)))},t.prototype.delete=function(t){return this.Gdb(this.get(t)),e.prototype.delete.call(this,t)},t.prototype.deleteValue=function(t,n){return this.Gdb([n]),e.prototype.deleteValue.call(this,t,n)},t.prototype.clear=function(){this.Ddb=[],e.prototype.clear.call(this)},t.prototype.Fdb=function(e,t){void 0===t&&(t=[]);var n=this.get(e);this.Gdb(n),this.Ddb=this.Edb(this.Ddb.concat(t))},t.prototype.Gdb=function(e){var t=this;void 0===e&&(e=[]),e.forEach(function(e){var n=t.Ddb.indexOf(e);n>-1&&t.Ddb.splice(n,1)})},t}(n(19483).ArrayMap);t.SortedArrayMap=r},1124:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.getTvMseWrapperConstructor=function(){return void 0===r&&(r=f()),r};var r,o=n(3714),a=n(20213),s=n(70850),u=n(88052),c=n(24281),f=function(){return function(e){function t(t,n){var i=e.call(this,t)||this;return i.Cab={},i.Bab=n,i}return i(t,e),t.prototype.printDetailedBufferRange=function(e,t){var n;try{n=e.buffered}catch(e){return}if(0!==n.length)for(var i=0;i<n.length;i++)n.start(i),n.end(i)},t.prototype.getBufferStartTime=function(){var e=this,t=Object.keys(this.sourceBuffers).map(function(t){return 0===e.sourceBuffers[t].bufferedRanges.length?0:e.Bab.mapToExternalTime(e.sourceBuffers[t].bufferedRanges[0].start)});return Math.max.apply(null,t)},t.prototype.updateTimestampOffset=function(t,n){try{e.prototype.updateTimestampOffset.call(this,t,n)}catch(e){e.code===DOMException.INVALID_STATE_ERR&&this.context.eventHandler.dispatchEvent(o.PlayerEvent.Warning,new a.PlayerWarning(a.WarningCode.PLAYBACK_WARNING,"Unable to update timestampOffset (Invalid State error)",e))}},t.prototype.Dab=function(e,t){this.Cab[e]||(this.Cab[e]={currentOffset:this.sourceBuffers[e].buffer.timestampOffset,pendingOffset:t})},t.prototype.queueTimestampOffsetUpdate=function(t,n){var i=this;return this.Dab(t,n),this.Bab.getCorrectTimeStampOffset(t,n).then(function(e){return i.Cab[t].pendingOffset=e}).then(function(){var n=i.Cab[t].pendingOffset,r=i.Cab[t].currentOffset;return s.Util.roundValue(r,6)===s.Util.roundValue(n,6)&&i.isMediaSourceOpen()?Promise.resolve():(i.Cab[t].currentOffset=n,e.prototype.queueTimestampOffsetUpdate.call(i,t,n).finally(function(){var e,n,r=null===(n=null===(e=i.sourceBuffers[t])||void 0===e?void 0:e.buffer)||void 0===n?void 0:n.timestampOffset;i.Cab[t].currentOffset=r}))})},t.prototype.getBufferRangeStart=function(e,t){void 0===t&&(t=0);var n=this.Bab.getEarliestExternalTimeBufferedRangeIndex(e);return Math.max(t,e.start(n))},t.prototype.preBufferRemoval=function(e,t,n){},t.prototype.getRangePendingRemoval=function(e){return this.sourceBuffers.hasOwnProperty(e)&&this.Bab.mapToExternalTimeRange(this.sourceBuffers[e].rangePendingRemoval)||void 0},t.prototype.addToBuffer=function(t){var n=this;return(0,c.rewriteUnsupportedBoxes)(t),this.Eab(t).then(function(){return e.prototype.addToBuffer.call(n,t)})},t.prototype.Eab=function(e){var t=e.getMimeType(),n=-e.getPresentationTimeOffset();return e.isDirty()&&!e.isInit()?this.setTimestampOffset(t,n):Promise.resolve()},t}(u.ModuleManager.get(a.ModuleName.RendererMse).MSEWrapper)}},35501:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),r=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var i,r=0,o=t.length;r<o;r++)!i&&r in t||(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.getTvRendererConstructor=function(){return void 0===o&&(o=m()),o};var o,a=n(4524),s=n(66790),u=n(34841),c=n(88052),f=n(62756),l=n(84276),d=n(48558),p=n(1124),m=function(){return function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.postBufferRemoval=function(e,n,i){t.video&&t.baseMediaDecodeTimeHandler.signalBufferRemoval(e,t.aU(e),t.video.currentTime)},t}return i(t,e),t.prototype.init=function(t){this.baseMediaDecodeTimeHandler=new l.BaseMediaDecodeTimeHandler(this.context,this.ZU.bind(this),this.getMaxSafeBaseMediaDecodeTime(),this.getMaxSafePresentationTimeOffset()),e.prototype.init.call(this,t),this.YU||(this.YU=new u.Deferred),this.YU.resolve(this.baseMediaDecodeTimeHandler)},t.prototype.getMaxSafeBaseMediaDecodeTime=function(){return 1/0},t.prototype.getMaxSafePresentationTimeOffset=function(){return 1/0},t.prototype.createMSEWrapper=function(){return new((0,p.getTvMseWrapperConstructor)())(this.context,this.baseMediaDecodeTimeHandler)},t.prototype.getCurrentVideoTime=function(){return this.baseMediaDecodeTimeHandler.mapToExternalTime(e.prototype.getCurrentVideoTime.call(this))},t.prototype.getRangesInSourceBuffers=function(){return this.baseMediaDecodeTimeHandler.mapToExternalTimeRangesMap(e.prototype.getRangesInSourceBuffers.call(this))},t.prototype.getBufferedRanges=function(t){return this.baseMediaDecodeTimeHandler.mapToExternalTimeRanges(e.prototype.getBufferedRanges.call(this,t))},t.prototype.getVideoElementBufferedRanges=function(){var t=e.prototype.getVideoElementBufferedRanges.call(this);return this.baseMediaDecodeTimeHandler.mapToExternalTimeRanges(t)},t.prototype.ZU=function(e){var t,n,i=this;if(!this.mse)return Promise.reject();var r=null===(t=this.mse)||void 0===t?void 0:t.getBufferedRanges(e),o=null!==(n=null==r?void 0:r.slice(1))&&void 0!==n?n:[];return Promise.all(o.map(function(t){var n;return null===(n=i.mse)||void 0===n?void 0:n.removeFromBuffer(e,t.start-i.settings.GAP_TOLERANCE,t.end+i.settings.GAP_TOLERANCE,i.postBufferRemoval)})).then(function(){})},t.prototype.removeData=function(e,t,n,i){if(void 0===i&&(i=!1),!this.mse)return Promise.reject();void 0===t&&void 0===n&&!i&&this.saveCurrentTime(),this.removeDataFromSegmentQueues(e,t,n);var r=void 0!==t?this.baseMediaDecodeTimeHandler.mapToInternalTime(t,!0,e):void 0,o=void 0!==n?this.baseMediaDecodeTimeHandler.mapToInternalTime(n,!0,e):void 0;return this.mse.removeFromBuffer(e,r,o,this.postBufferRemoval)},t.prototype.addSegmentFromQueueToMse=function(t){var n=this,i=this.bU(function(e){return!e.isInit()}),r=Object.keys(this.segmentQueues).every(function(e){var t=n.mse&&n.mse.getBufferedRanges(e).length>0,r=i.some(function(t){return t.getMimeType()===e});return t||r});if(0===i.length||!r)return Promise.reject(s.SOURCE_BUFFER_APPEND_STATUS.SUSPENDED);var o=i.reduce(function(e,t){return t.getPlaybackTime()<e.getPlaybackTime()?t:e},i[0]),a=(0,d.getSectionId)(o),u=this.bU(function(e){return!e.isInit()&&(0,d.getSectionId)(e)===a});return this.baseMediaDecodeTimeHandler.rewriteTimeStampsIfNecessary(u)?e.prototype.addSegmentFromQueueToMse.call(this,t):Promise.reject(s.SOURCE_BUFFER_APPEND_STATUS.SUSPENDED)},t.prototype.aU=function(e){var t,n;if(null===this.mse||!this.segmentQueues.hasOwnProperty(e))return[];var i=this.bU(function(e){return!e.isInit()}),o=this.baseMediaDecodeTimeHandler.getSegmentTimeRanges(i,e),s=null!==(n=null===(t=this.mse)||void 0===t?void 0:t.getBufferedRanges(e))&&void 0!==n?n:[];return a.BufferRangeHelper.mergeRanges(r(r([],o,!0),s,!0),this.settings.GAP_TOLERANCE)},t.prototype.adjustTimeToNextCommonBufferStart=function(t){var n=e.prototype.adjustTimeToNextCommonBufferStart.call(this,t);return isNaN(n)?NaN:Math.ceil(100*this.baseMediaDecodeTimeHandler.mapToInternalTime(n))/100},t.prototype.seekOnVideoElement=function(e){var t=this;return this.waitingForSeekedPromise=new Promise(function(n,i){if(t.video){t.video.currentTime=e;var r=t.video.currentTime;n(t.getBaseMediaDecodeTimeHandler().then(function(e){return e.mapToExternalTime(r)}))}else i("No video reference")}),this.waitingForSeekedPromise},t.prototype.getBaseMediaDecodeTimeHandler=function(){return this.YU.promise},t.prototype.bU=function(e){var t=this;return void 0===e&&(e=function(){return!0}),Object.keys(this.segmentQueues).flatMap(function(e){return t.segmentQueues[e]}).filter(e)},t.prototype.getEndOfBufferTime=function(){if(this.video&&this.video.buffered&&this.video.buffered.length>0&&this.baseMediaDecodeTimeHandler)return this.baseMediaDecodeTimeHandler.getEndOfBufferTime()},t.prototype.shutdown=function(t){var n=this;return e.prototype.shutdown.call(this,t).then(function(){n.cU()})},t.prototype.cU=function(){this.YU=new u.Deferred,this.baseMediaDecodeTimeHandler.dispose()},t.prototype.release=function(){return this.cU(),e.prototype.release.call(this)},t}(c.ModuleManager.get(f.ModuleName.RendererMse).MSERenderer)}},24281:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.rewriteUnsupportedBoxes=function(e,t){void 0===t&&(t=o),t.forEach(function(t){var n,i=null===(n=e.getParsedData())||void 0===n?void 0:n.get(t);i&&(0,r.rewriteMp4BoxType)(i,"free")})};var i=n(15487),r=n(2992),o=function(){var e=["skip"];return((0,i.isTizen2016)()||(0,i.isTizen2017)())&&e.push("moov.trak.edts"),e}()},85537:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.withDrmLicenseWaiting=function(e,t){return function(e){function n(){for(var n,i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];var a=e.apply(this,i)||this;return a.mV=[],a.encryptedEventHandler=function(e){var n;a.onEncryptedEvent(e);var i=a.drmService;if(i)for(var r=0,o=null!==(n=null==t?void 0:t(e.initData))&&void 0!==n?n:[];r<o.length;r++){var s=o[r];if(s.systemName===a.pV()){var u=btoa(i.preprocessInitDataStr(s));a.initializeLicense(s.systemName,u)}}},null===(n=a.video)||void 0===n||n.addEventListener(s.MediaElementEvent.encrypted,a.encryptedEventHandler),a.nV=(0,o.subscribe)(a.context.store)(function(e){return null==e?void 0:e.drmLicenses},function(e){return e&&a.resolveAvailableLicenses(e.drmData)}),a}return i(n,e),n.prototype.setCurrentTime=function(t){var n=this;return this.waitForDrmLicenseResolving().then(function(){return e.prototype.setCurrentTime.call(n,t)})},n.prototype.onEncryptedEvent=function(e){},Object.defineProperty(n.prototype,"oV",{get:function(){var e=this;return this.mV.filter(function(t){return t.systemName===e.pV()})},enumerable:!1,configurable:!0}),n.prototype.waitForDrmLicenseResolving=function(){var e,t,n,i=null===(n=null===(t=null===(e=this.context.store)||void 0===e?void 0:e.getState())||void 0===t?void 0:t.drmLicenses)||void 0===n?void 0:n.drmData;i&&this.resolveAvailableLicenses(i);var r=this.oV;return r.length,Promise.all(r.map(function(e){return e.licenseReady.promise})).then(function(){r.length})},n.prototype.resolveAvailableLicenses=function(e){this.oV.filter(function(t){return Boolean(e[t.systemName])}).forEach(function(t){var n=e[t.systemName],i=Object.keys(n).find(function(e){var i=n[e];return btoa(i.initDataStr)===t.licenseInfoKey});i&&e[t.systemName][i].hasLicense&&t.licenseReady.resolve()})},n.prototype.initializeLicense=function(e,t){this.mV.some(function(n){return n.systemName===e&&n.licenseInfoKey===t})||this.mV.push({systemName:e,licenseInfoKey:t,licenseReady:new a.Deferred})},n.prototype.pV=function(){var e,t;return this.context.serviceManager.has(r.ServiceName.DrmService)&&null!==(t=null===(e=this.context.serviceManager.get(r.ServiceName.DrmService))||void 0===e?void 0:e.getUsedKeySystemKind())&&void 0!==t?t:null},n.prototype.shutdown=function(t){var n;return t||(this.mV=[],this.nV(),null===(n=this.video)||void 0===n||n.removeEventListener(s.MediaElementEvent.encrypted,this.encryptedEventHandler)),e.prototype.shutdown.call(this,t)},n}(e)};var r=n(80813),o=n(93204),a=n(34841),s=n(19274)},69507:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.WebosModuleDefinition=void 0;var i=n(70962),r=n(15487),o=n(62756),a=n(41503),s=n(18616),u=n(99959),c=n(98745),f=n(42350),l=n(13492);t.WebosModuleDefinition={name:o.ModuleName.Webos,module:function(){return{getWebosRendererConstructor:u.getWebosRendererConstructor,getWebosDrmManagerConstructor:s.getWebosDrmManagerConstructor,WebosVideoElementWrapper:f.WebosVideoElementWrapper,getWebosUnprefixedEmeHandlerConstructor:c.getWebosUnprefixedEmeHandlerConstructor,getWebos2017UnprefixedEmeHandlerConstructor:a.getWebos2017UnprefixedEmeHandlerConstructor,getWebosWebkitPrefixedEmeHandlerConstructor:l.getWebosWebkitPrefixedEmeHandlerConstructor}},dependencies:[o.ModuleName.RendererMse],hooks:{add:function(){i.DefaultSettings.END_OF_BUFFER_RECOVERY_TOLERANCE=1,(0,r.isWebOs2019OrOlder)()&&(i.DefaultSettings.WEBOS_MAX_SAFE_BMDT=274877906943,i.DefaultSettings.WEBOS_MAX_SAFE_PTO=4194303),(0,r.isWebOs2019OrOlder)()?i.DefaultSettings.MAX_STARTUP_BUFFER=6:(0,r.isWebOs2020)()?i.DefaultSettings.MAX_STARTUP_BUFFER=4:i.DefaultSettings.MAX_STARTUP_BUFFER=2.5,(0,r.isWebOs2016)()&&(i.DefaultSettings.HLS_CLEAR_BUFFERS_ON_DISCONTINUITY_SWITCHES=!0)}}},t.default=t.WebosModuleDefinition},41503:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.getWebos2017UnprefixedEmeHandlerConstructor=function(){return void 0===r&&(r=function(){return function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.load=function(t,n,i,r){return e.prototype.load.call(this,t,n,i,r),Promise.resolve()},t.prototype.setupKeySystem=function(t){var n=this;return this.Gs=new o.Deferred,this.Gs.promise.then(function(){return e.prototype.setupKeySystem.call(n,t)}).catch(function(e){throw e})},t.prototype.addInitData=function(e){var t,n,i;e&&(null===(n=null===(t=this.context.sourceContext)||void 0===t?void 0:t.source.drm)||void 0===n?void 0:n.immediateLicenseRequest)&&(null===(i=this.Gs)||void 0===i||i.resolve())},t.prototype.processMediaEncryptedEvent=function(t){var n;return null===(n=this.Gs)||void 0===n||n.resolve(),e.prototype.processMediaEncryptedEvent.call(this,t)},t.prototype.unload=function(){var t;return null===(t=this.Gs)||void 0===t||t.reject("Unloaded the WebosEmeHandler"),e.prototype.unload.call(this)},t}((0,a.getWebosUnprefixedEmeHandlerConstructor)())}()),r};var r,o=n(34841),a=n(98745)},18616:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.getWebosDrmManagerConstructor=function(){if(null===s&&r.ModuleManager.has(o.ModuleName.DRM)){var e=r.ModuleManager.get(o.ModuleName.DRM).DRMManager;s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.setConfig=function(t,n){var i=this;return e.prototype.setConfig.call(this,t,n).then(function(e){return function(e){return e instanceof(0,a.getWebosWebkitPrefixedEmeHandlerConstructor)()}(i.emeHandler)&&i.emeHandler.setWebosDrmManager(i),e})},t.prototype.addInitData=function(t){var n,i;null===(i=null===(n=this.emeHandler)||void 0===n?void 0:n.addInitData)||void 0===i||i.call(n,t),e.prototype.addInitData.call(this,t)},t.prototype.getRequestedLicenses=function(){var e=this.getUsedKeySystemKind();return this.licenseStorage.getAllLicensesForKeySystem(e).filter(function(e){return e.hasLicense})},t.prototype.resetLicense=function(e,t){this.licenseStorage.resetLicense(t,e)},t}(e)}return s};var r=n(88052),o=n(62756),a=n(13492),s=null},70007:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.WebosOnPlayListener=void 0;var i=n(89927),r=n(19274),o=function(){function e(e){this.eventHandler=e}return e.prototype.listenToPlay=function(){var e=this;return new Promise(function(t,n){e.XU(),e.WU=function(){e.XU(),setTimeout(function(){n(new Error("Play promise rejected because the source was unloaded"))},(0,i.toSeconds)(1))},e.eventHandler.addEventListener(r.MediaElementEvent.emptied,e.WU)})},e.prototype.XU=function(){this.WU&&(this.eventHandler.removeEventListener(r.MediaElementEvent.emptied,this.WU),this.WU=void 0)},e.prototype.dispose=function(){this.XU()},e}();t.WebosOnPlayListener=o},99959:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.getWebosRendererConstructor=function(){var e;return null===l&&(l=d(null===(e=a.ModuleManager.get(s.ModuleName.DRM,!1))||void 0===e?void 0:e.parseInitData)),l};var r=n(77753),o=n(19274),a=n(88052),s=n(62756),u=n(84276),c=n(35501),f=n(85537),l=null,d=function(e){var t=(0,c.getTvRendererConstructor)();return function(e){function t(t){var n=e.call(this,t)||this;return n.Hs=new Map,n.Is=!1,n.Js=!1,n.baseMediaDecodeTimeHandler.setPtoGapFillingMode(u.PtoGapFillingMode.FillGaps),n}return i(t,e),t.prototype.onEncryptedEvent=function(e){this.Is=!0},t.prototype.getMaxSafeBaseMediaDecodeTime=function(){return this.context.settings.WEBOS_MAX_SAFE_BMDT},t.prototype.getMaxSafePresentationTimeOffset=function(){return this.context.settings.WEBOS_MAX_SAFE_PTO},t.prototype.Ks=function(e){return!!function(e){var t=e.isInit(),n=e.isEncrypted(),i=e.hasDrmInitData();return!t&&n&&!i}(e)&&!this.Js&&!this.Is},t.prototype.Ls=function(){var e,t=this;if(0!==this.Hs.size){this.Hs.forEach(function(e){var n,i={type:o.MediaElementEvent.encrypted,initData:e};null===(n=t.context.videoElement)||void 0===n||n.eventHandler.triggerEvent(o.MediaElementEvent.encrypted,i)});var n=this.context.store.getState();(0,r.isInstanceState)(n)&&this.resolveAvailableLicenses(null===(e=a.ModuleManager.get(s.ModuleName.DRM).getLicenseState(n))||void 0===e?void 0:e.drmData)}else this.context.videoElement.eventHandler.triggerEvent(o.MediaElementEvent.encrypted)},t.prototype.Ms=function(e){this.mse&&(this.Js=this.Js||e.hasDrmInitData(),this.Ks(e)&&this.Ls())},t.prototype.addDrmInitData=function(t){var n=this;e.prototype.addDrmInitData.call(this,t),t.forEach(function(e){n.Hs.has(e.initDataStr)||n.Hs.set(e.initDataStr,e.initData)})},t.prototype.appendData=function(t){var n=this;return e.prototype.appendData.call(this,t).then(function(){return n.Ms(t)})},t.prototype.shutdown=function(t){var n,i,r=this;this.Hs.clear(),this.Is=!1,this.Js=!1;var o=function(){return e.prototype.shutdown.call(r,t).then(function(){var e;return null===(e=r.drmService)||void 0===e?void 0:e.suspend()})};return(null!==(i=null===(n=this.drmService)||void 0===n?void 0:n.prepareForMseShutdown())&&void 0!==i?i:Promise.resolve()).then(o,o)},t}((0,f.withDrmLicenseWaiting)(t,e))}},98745:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.getWebosUnprefixedEmeHandlerConstructor=function(){return void 0===r&&(r=s()),r},t.getWebosUnprefixedEmeHandlerClass=s;var r,o=n(88052),a=n(62756);function s(){return function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.Ns=null,t.Os=null,t}return i(t,e),t.prototype.load=function(t,n,i,r){return e.prototype.load.call(this,t,n,i,r)},t.prototype.Ps=function(){var t=this;this.Ns&&e.prototype.setMediaKeys.call(this,this.Ns).catch(function(e){}).finally(function(){t.Ns=null})},t.prototype.setMediaKeys=function(t){return this.Os=t,e.prototype.setMediaKeys.call(this,t)},t.prototype.onServerCertificateSetFailed=function(t,n,i){var r=t!==this.Os,o=n instanceof DOMException&&n.message.includes("Operation aborted");r&&o||e.prototype.onServerCertificateSetFailed.call(this,t,n,i)},t.prototype.processMediaEncryptedEvent=function(t){e.prototype.processMediaEncryptedEvent.call(this,t),this.Ps()},t.prototype.closeSession=function(e){try{return e.close()}catch(e){return Promise.resolve()}},t.prototype.prepareForMseShutdown=function(){var e,t;return null!==(t=null===(e=this.video)||void 0===e?void 0:e.mediaKeysPromise)&&void 0!==t?t:Promise.resolve()},t.prototype.suspend=function(){var e,t;return this.Ns=null!==(t=null===(e=this.video)||void 0===e?void 0:e.mediaKeysObject)&&void 0!==t?t:null,this.setMediaKeys(null)},t.prototype.unload=function(){return this.Ns=null,this.Os=null,e.prototype.unload.call(this)},t}(o.ModuleManager.get(a.ModuleName.DRM).UnprefixedEMEHandler)}},42350:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.WebosVideoElementWrapper=void 0;var r=n(21513),o=n(15487),a=n(79186),s=n(70007),u=function(e){function t(t,n){var i=e.call(this,t,n)||this;return i.Ss=new s.WebosOnPlayListener(i.eventHandler),i}return i(t,e),t.prototype.play=function(){return(0,r.getCapabilities)().chromiumVersion<=o.WEBOS_2018_2019_CHROMIUM_VERSION?Promise.race([e.prototype.play.call(this),this.Ss.listenToPlay()]):e.prototype.play.call(this)},t.prototype.dispose=function(){this.Ss.dispose(),e.prototype.dispose.call(this)},t}(a.VideoElementWrapper);t.WebosVideoElementWrapper=u},13492:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.getWebosWebkitPrefixedEmeHandlerConstructor=function(){if(null===s&&o.ModuleManager.has(a.ModuleName.DRM)){var e=o.ModuleManager.get(a.ModuleName.DRM);s=function(e){function t(t){var n=e.call(this,t)||this;return n.Rs=[],n}return i(t,e),t.prototype.invokeEncryptedListener=function(t,n){var i=this;if(this.Qs){var r=this.Qs.getUsedKeySystemKind();n.forEach(function(e){var t,n;if(e.systemName===r){var o=null!==(n=null===(t=i.keySystem)||void 0===t?void 0:t.getIdentifierFromInitData(e.initDataStr))&&void 0!==n?n:e.initDataStr,a=i.Rs.findIndex(function(e){return e.initDataStr===o});a>-1&&(i.Rs.splice(a,1),i.Qs.resetLicense(o,r))}})}e.prototype.invokeEncryptedListener.call(this,t,n)},t.prototype.prepareForMseShutdown=function(){var e,t=null===(e=this.context.serviceManager)||void 0===e?void 0:e.get(r.ServiceName.DrmService),n=null==t?void 0:t.getUsedKeySystemKind();return t&&n?t.waitForPendingLicenseRequests(n):Promise.resolve()},t.prototype.suspend=function(){return this.Qs&&(this.Rs=this.Qs.getRequestedLicenses()),e.prototype.suspend.call(this)},t.prototype.unload=function(){return this.Qs=null,e.prototype.unload.call(this)},t.prototype.setWebosDrmManager=function(e){this.Qs=e},t}(e.WebKitPrefixedEMEHandler)}return s};var r=n(80813),o=n(88052),a=n(62756),s=null}},function(e){return function(){return e(69507)}()}])});
|
|
17
|
+
"use strict";!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.webos=t():(e.bitmovin=e.bitmovin||{},e.bitmovin.player=e.bitmovin.player||{},e.bitmovin.player.webos=t())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[137],{84276:function(e,t,n){var i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseMediaDecodeTimeHandler=t.PtoGapFillingMode=void 0;var r,o=n(4524),a=n(80813),s=n(87827),u=n(68925),c=n(47602),l=n(19483),f=n(34841),d=n(87244),p=n(85434),m=n(15487),h=n(89927),v=n(19274),y=n(88052),g=n(62756),T=n(44885),M=n(73849),E=n(8301),b=n(48558),W=n(21651);!function(e){e.KeepGaps="keep-gaps",e.FillGaps="fill-gaps"}(r||(t.PtoGapFillingMode=r={}));var _=function(){function e(e,t,n,a){var s=this;this.maxSafeBaseMediaDecodeTime=n,this.maxSafePresentationTimeOffset=a,this.DW=function(){s.FW(s.uW.settings.END_OF_BUFFER_TOLERANCE)},this.EW=function(){s.FW(s.uW.settings.END_OF_BUFFER_RECOVERY_TOLERANCE)},this.KW=function(){if(s.uW.videoElement)try{var e=s.JW(),t=s.uW.videoElement.currentTime,n=s.GW(t).mapEach(function(e){return e.playbackRange}).mapAll(function(e){return o.BufferRangeHelper.mergeRanges(e,s.uW.settings.GAP_TOLERANCE)}).getObject(),r=o.BufferRangeHelper.getCommonBufferedRanges(i(i({},n),{bufferedRanges:e})).shift();if(void 0!==r){var a=r.getStart();s.uW.videoElement.currentTime=a,s.HW(),s.uW.videoElement.eventHandler.removeEventListener(v.MediaElementEvent.currenttimenotadvancing,s.EW),s.BW().finally(function(){var e;return null===(e=s.CX())||void 0===e?void 0:e.dispatch((0,u.setTimestampRollingOver)(!1))}).then(function(){}).catch(function(e){})}else s.IW()}catch(e){}},this.uW=e,this.AW=r.KeepGaps,this.yW=t,this.vW=void 0,this.xW=new Map,this.wW=new W.SegmentTimeInformationArrayMap,this.uW.videoElement&&(this.uW.videoElement.addEventListener(v.MediaElementEvent.waiting,this.EW),this.uW.videoElement.addEventListener(v.MediaElementEvent.stalled,this.EW),this.uW.videoElement.addEventListener(v.MediaElementEvent.timeupdate,this.DW),e.settings.FORCE_BASE_MEDIA_DECODE_TIME_REWRITE)}return e.prototype.BW=function(){var e=this,t=[];return this.CW().keys.forEach(function(n){t.push(e.yW(n))}),Promise.all(t).then(function(){})},e.prototype.getEndOfBufferTime=function(){var e=o.BufferRangeHelper.getCommonBufferedRanges(this.CW(!0).getObject()).sort(function(e,t){return e.getStart()-t.getStart()});return e.length>0?e[e.length-1].getEnd():0},e.prototype.setPtoGapFillingMode=function(e){this.AW=e},e.prototype.getEarliestExternalTimeBufferedRangeIndex=function(e){var t=0;try{for(var n=void 0,i=0;i<e.length;i++){var r=this.mapToExternalTime(e.start(i));(void 0===n||r<n)&&(n=r,t=i)}}catch(e){}return t},e.prototype.CW=function(e){var t=this;return void 0===e&&(e=!1),this.wW.mapEach(function(t){return e?t.originalPlaybackRange:t.playbackRange}).mapAll(function(e){return o.BufferRangeHelper.mergeRanges(e,t.uW.settings.GAP_TOLERANCE)})},e.prototype.FW=function(e){var t,n,i=this.uW.videoElement;if(i){var r=i.currentTime;if(!(r>=i.duration&&i.duration>0)){var o=i.buffered;if(o.length<2)null===(t=this.CX())||void 0===t||t.dispatch((0,u.setTimestampRollingOver)(!1));else if(0!==this.getEarliestExternalTimeBufferedRangeIndex(o)){var a=o.end(o.length-1);r>=a-Math.max(this.uW.settings.MINIMAL_BACKWARD_BUFFER_CLEARING_INTERVAL,this.uW.settings.END_OF_BUFFER_TOLERANCE,this.uW.settings.END_OF_BUFFER_RECOVERY_TOLERANCE)&&(null===(n=this.CX())||void 0===n||n.dispatch((0,u.setTimestampRollingOver)(!0))),r>=a-e&&this.KW()}}}},e.prototype.GW=function(e){var t=this,n=this.uW.settings.GAP_TOLERANCE,i=new l.ArrayMap;return this.wW.keys.forEach(function(r){var o=!1,a=-1/0,s=t.wW.get(r),u=!1;s.sort(function(e,t){return e.originalPlaybackTime-t.originalPlaybackTime});var c=s.filter(function(t){var i=t.playbackRange,r=i.start-n<=e&&i.end+n>=e;if(u=u||r,!isFinite(a)&&r)a=t.playbackTime;else if(isFinite(a))return o=o||t.playbackTime<a;return!1});0!==c.length||u||(s.sort(function(e,t){return e.originalPlaybackTime-t.originalPlaybackTime}),c=s.filter(function(t){return t.playbackRange.end<e})),i.addAll(r,c)}),i},e.prototype.HW=function(){void 0!==this.vW&&(this.vW(),this.vW=void 0)},e.prototype.IW=function(){var e=this,t=this.CX();void 0!==t&&(this.HW(),this.vW=(0,c.subscribeToRendererBufferChanges)(t,function(){return e.EW()}))},e.prototype.JW=function(){var e,t=[],n=null===(e=this.uW.videoElement)||void 0===e?void 0:e.buffered;if(!function(e){return 0!==(null==e?void 0:e.length)}(n))return[];for(var i=0;i<n.length;i++)t.push({start:n.start(i),end:n.end(i)});return t},e.prototype.LW=function(e){var t,n=e.getMimeType(),i=e.getPlaybackTimeRange();if(void 0!==i){var r=(null!==(t=this.wW.get(n))&&void 0!==t?t:[]).filter(function(e){return e.originalPlaybackRange.end<i.end});return r[r.length-1]}},e.prototype.MW=function(e){var t=this,n=!1,i=!1,o=new W.SegmentTimeInformationArrayMap;return this.wW.keys.forEach(function(e){return(0,T.ensureMimeTypeInMap)(o,e)}),e.forEach(function(e){if(!e.isDirty()){var a=new b.SegmentTimeInformation(e,t.maxSafeBaseMediaDecodeTime),s=a.presentationTimeOffset/a.timescale,u=t.fW(s),c=t.gW(a);(n=n||u||c||t.uW.settings.FORCE_BASE_MEDIA_DECODE_TIME_REWRITE||t.bW(a)||t.cW(a,a.baseMediaDecodeTime,a.presentationTimeOffset))&&(a.isBaseMediaDecodeTimeLimitExceeded=!0);var l=t.LW(e);(l?l.originalPresentationTimeOffset/l.timescale:s)===s||t.AW!==r.FillGaps&&!(null==l?void 0:l.isBaseMediaDecodeTimeLimitExceeded)||(i=!0),(0,T.addSegmentTimeInfoToMap)(o,a.mimeType,a)}}),[n,i,o]},e.prototype.NW=function(e){return y.ModuleManager.has(g.ModuleName.ContainerMP4)?e.getTFDTBoxOffsets()||y.ModuleManager.get(g.ModuleName.ContainerMP4).parseTfdtBoxOffsets(e):[]},e.prototype.OW=function(e,t){var n=this.NW(e);e.setTFDTBoxOffsets(n);var i=e.getBaseMediaDecodeTime()-t.truncatedBaseMediaDecodeTime;e.getTFDTBoxOffsets().forEach(function(t){var n=0,r=new DataView(e.getData(),t),o=r.getUint32(n);n+=4;var a=String.fromCharCode(r.getUint8(n++),r.getUint8(n++),r.getUint8(n++),r.getUint8(n++));if(n+=1===o?8:0,"tfdt"===a){var s=r.getUint8(n);n+=4,1===s?function(e,t,n){var i=e.getUint32(t),r=e.getUint32(t+4),o=i*Math.pow(2,32)+r-n;e.setUint32(t,Math.floor(o/Math.pow(2,32))),t+=4,e.setUint32(t,o)}(r,n,i):function(e,t,n){var i=e.getUint32(t)-n;e.setUint32(t,i)}(r,n,i)}}),e.setBaseMediaDecodeTime(t.truncatedBaseMediaDecodeTime),e.setDirty(!0)},e.prototype.PW=function(e,t){var n=this;t.forAll(function(t,i){(0,T.addSegmentTimeInfoToMap)(n.wW,t,i);var r=i.getMatchingSegment(e);r&&n.OW(r,i)})},e.prototype.QW=function(e,t){return e.reduce(function(e,n){var i=t(n),r=Math.floor(i/n.timescale);return!isFinite(e)&&isFinite(r)||r<e?r:e},-1/0)},e.prototype.RW=function(e,t){var n=this;return Math.min.apply(Math,e.transform(function(e){return n.QW(e,t)}))},e.prototype.SW=function(e){return this.RW(e,function(e){return e.truncatedBaseMediaDecodeTime-e.truncatedPresentationTimeOffset})},e.prototype.TW=function(e){return this.RW(e,function(e){return e.originalPresentationTimeOffset})},e.prototype.UW=function(e){var t={},n=this.TW(e);isFinite(n)&&(e.forAll(function(e,i){var r=i.timescale,o=i.originalBaseMediaDecodeTime,a=i.originalPresentationTimeOffset,s=Math.floor(a-n*r),u=a-s,c=o-u,l=Math.floor(u/r);i.truncatedBaseMediaDecodeTime=c,i.truncatedPresentationTimeOffset=s,t.hasOwnProperty(e)||(t[e]=l)}),this.VW(t))},e.prototype.VW=function(e){var t=this;Object.keys(e).forEach(function(n){var i=t.xW.get(n);i&&i.resolve(e[n]);var r=new f.Deferred;t.xW.set(n,r),r.resolve(e[n])})},e.prototype.WW=function(e,t){var n,i=this,r=this.SW(t);isFinite(r)&&(t.forAll(function(t,n){var o=n.getMatchingSegment(e);o&&i.XW(o,n,r),(0,T.addSegmentTimeInfoToMap)(i.wW,t,n)}),null===(n=this.uW.videoElement)||void 0===n||n.addEventListener(v.MediaElementEvent.currenttimenotadvancing,this.EW))},e.prototype.XW=function(e,t,n){t.truncatedBaseMediaDecodeTime=t.truncatedBaseMediaDecodeTime-t.timescale*n,t.truncatedPlaybackTime=(t.truncatedBaseMediaDecodeTime-t.truncatedPresentationTimeOffset)/t.timescale,this.OW(e,t)},e.prototype.YW=function(e){for(var t,n,i=e.keys,o=e.getAll(),a=[],s=1/0,u=0,c=i;u<c.length;u++){var l=c[u],f=(null!==(t=this.wW.get(l))&&void 0!==t?t:[]).filter(function(e){return!o.includes(e)&&!e.isReferenceSegment});f.sort(function(e,t){return e.originalPlaybackTime-t.originalPlaybackTime});var d=f.pop(),p=null!==(n=null==d?void 0:d.playbackRange.end)&&void 0!==n?n:1/0,m=e.get(l)||[];if(0===m.length)return 1/0;var h=Math.min.apply(Math,m.map(function(e){return e.playbackTime})),v=h-p;s=Math.min(s,h),isFinite(v)&&a.push(v)}if(a.length!==i.length)return 0;var y=s-this.uW.settings.GAP_TOLERANCE,g=this.AW===r.KeepGaps?Math.min.apply(Math,a):Math.max.apply(Math,a);return Math.min(g,y)},e.prototype.ZW=function(e,t){var n=this,i=this.YW(t),r=!0;if(t.forAll(function(e,o){if(r){var a=o.timescale,s=i*a,u=o.truncatedPresentationTimeOffset+s,c=o.truncatedBaseMediaDecodeTime;n.dW(c,u,o,t)||(r=!1)}}),r){var o={};t.forAll(function(e,t){var n=t.timescale,r=i*n;t.updateAsContinuous(t.truncatedBaseMediaDecodeTime,t.truncatedPresentationTimeOffset+r);var a=t.originalPresentationTimeOffset-t.truncatedPresentationTimeOffset;o[e]=a/t.timescale}),this.VW(o),e.forEach(function(e){return e.setDirty(!0)})}},e.prototype.aW=function(e,t,n){return 0===t.length||!!t.keys.every(function(e){return(t.get(e)||[]).length>0})&&(this.UW(t),this.WW(e,t),n&&this.ZW(e,t),!0)},e.prototype.bW=function(e){var t;if(e.isBaseMediaDecodeTimeLimitExceeded)return!0;var n=(0,M.getLargestPrecedingSegmentTimeInfo)(null!==(t=this.wW.get(e.mimeType))&&void 0!==t?t:[],e.originalPlaybackTime);return!!n&&isFinite(n.truncatedBaseMediaDecodeTime)&&n.truncatedBaseMediaDecodeTime!==n.originalBaseMediaDecodeTime},e.prototype.cW=function(e,t,n){var i,r=e.duration,o=e.timescale,a=e.mimeType,s=this.wW.keys.find(function(e){return e!==a});if(!s)return!1;var u=null===(i=this.wW.get(s))||void 0===i?void 0:i.slice(-1)[0];if(!u)return!1;var c=(t+n)/o,l={start:c,end:c+r},f=u.playbackTime+u.duration,d={start:f,end:f+u.duration},p=Math.max(l.start,d.start);return!(Math.min(l.end,d.end)-p<=r/2)&&d.end*u.timescale-u.presentationTimeOffset>this.maxSafeBaseMediaDecodeTime},e.prototype.dW=function(e,t,n,i){var r=this,o=n.duration,a=n.timescale;if(e+o*a>this.maxSafeBaseMediaDecodeTime)return!1;if(this.cW(n,e,t))return!1;var s=t/a,u=e/a+o,c=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=[];return e.forEach(function(e){e.forAll(function(e,t){n.includes(t.timescale)||n.push(t.timescale)})}),n}(i,this.wW);return c.every(function(e){return r.eW(s,u,e)})},e.prototype.eW=function(e,t,n){return t*n+e*n<=this.maxSafeBaseMediaDecodeTime},e.prototype.fW=function(e){return Math.abs(e)>this.maxSafePresentationTimeOffset},e.prototype.gW=function(e){if(!(0,m.isTizen2017)())return!1;var t=e.originalPlaybackTime,n=e.duration,i=e.mimeType,r=t+n>(0,h.toSeconds)(this.maxSafeBaseMediaDecodeTime);return p.MimeTypeHelper.isAudio(i)&&r},e.prototype.hW=function(e,t){if(this.uW.settings.FORCE_BASE_MEDIA_DECODE_TIME_REWRITE)return!0;var n=e/t.timescale;return!!this.fW(n)||this.gW(t)},e.prototype.iW=function(e,t,n){var i=e.baseMediaDecodeTime,r=e.presentationTimeOffset,o=e.foundMatchingPreviousSegment,a=!this.dW(i,r,t,n);return o?a:a||this.hW(r,t)},e.prototype.jW=function(e){var t=this,n=new l.ArrayMap,i=new l.ArrayMap;return e.keys.forEach(function(r){var o;(0,T.ensureMimeTypeInMap)(n,r),(0,T.ensureMimeTypeInMap)(i,r),(0,T.ensureMimeTypeInMap)(t.wW,r);var a=null!==(o=t.wW.get(r))&&void 0!==o?o:[],s=a.length?a:t.wW.getAllValues();(e.get(r)||[]).forEach(function(r){var o=(0,M.findOverflowDataForSegmentInMap)(r,s,t.uW.settings.GAP_TOLERANCE,t.uW.logger);if(t.iW(o,r,e))r.updateAsDiscontinuous(),(0,T.addSegmentTimeInfoToMap)(i,r.mimeType,r);else{var a=o.baseMediaDecodeTime,u=o.presentationTimeOffset;r.updateAsContinuous(a,u),(0,T.addSegmentTimeInfoToMap)(n,r.mimeType,r)}})}),{discontinuousSegmentTimeInfoMap:i,continuousSegmentTimeInfoMap:n}},e.prototype.kW=function(e,t,n){var i=this.jW(t),r=i.discontinuousSegmentTimeInfoMap,o=i.continuousSegmentTimeInfoMap;if(this.PW(e,o),this.aW(e,r,n))return!0;var a=(0,E.maybeSwitchOverASegmentToDiscontinuous)({continuousSegmentTimeInfoMap:o,discontinuousSegmentTimeInfoMap:r});if(!a){var s=this.jW(this.wW);a=(0,E.maybeSwitchOverASegmentToDiscontinuous)({continuousSegmentTimeInfoMap:s.continuousSegmentTimeInfoMap,discontinuousSegmentTimeInfoMap:r})}return!!a&&this.aW(e,r,n)},e.prototype.lW=function(e){var t=this;e.forAll(function(e,n){var i;(null===(i=t.wW.get(e))||void 0===i?void 0:i.find(n.equals))||(0,T.addSegmentTimeInfoToMap)(t.wW,n.mimeType,n);var r=t.xW.get(n.mimeType);r&&r.resolve(0)})},e.prototype.wX=function(e){return e.every(function(e){return p.MimeTypeHelper.isMP4(e.getMimeType())})},e.prototype.xX=function(){this.maxSafeBaseMediaDecodeTime=1/0,this.maxSafePresentationTimeOffset=1/0},e.prototype.yX=function(){return this.maxSafeBaseMediaDecodeTime!==1/0||this.maxSafePresentationTimeOffset!==1/0},e.prototype.rewriteTimeStampsIfNecessary=function(e){var t;!this.wX(e)&&this.yX()&&this.xX();var n=this.zX(),i=e.map(b.getSectionId).reduce(O,[]).some(function(e){return!n.includes(e)}),r=function(e){return e.reduce(function(e,t){return e.includes(t.getMimeType())||e.push(t.getMimeType()),e},[])}(e),o=this.wW.keys.every(function(e){return r.includes(e)});if(i&&!o)return!1;var a=this.MW(e),s=a[0],u=a[1],c=a[2];if(s)return this.kW(e,c,u);if(i&&u)return this.AX(e,c),!0;for(var l=0,f=c.getAllValues();l<f.length;l++){var d=f[l],p=d.mimeType,m=null!==(t=this.wW.get(p))&&void 0!==t?t:[],h=(0,M.findPrecedingSegmentTimeInfo)(m,d,this.uW.settings.GAP_TOLERANCE);(null==h?void 0:h.isBaseMediaDecodeTimeLimitExceeded)&&!d.isBaseMediaDecodeTimeLimitExceeded&&(d.updateAsDiscontinuous(),d.updateAsContinuous(d.originalBaseMediaDecodeTime,h.truncatedPresentationTimeOffset))}return this.lW(c),!0},e.prototype.zX=function(){return this.wW.transform(function(e){return e.map(function(e){return e.sectionId})}).flatMap(function(e){return e}).reduce(O,[])},e.prototype.AX=function(e,t){var n={},i=this.YW(t);t.forAll(function(e,t){var r=-i*t.timescale,o=r/t.timescale;t.isBaseMediaDecodeTimeLimitExceeded=!0,t.updateAsContinuous(t.originalBaseMediaDecodeTime,t.originalPresentationTimeOffset-r),n[t.mimeType]=o}),this.VW(n),this.lW(t),e.forEach(function(e){return e.setDirty(!0)})},e.prototype.signalBufferRemoval=function(e,t,n){var i;if(this.wW.has(e)){var r=o.BufferRangeHelper.mergeRanges(t,this.uW.settings.GAP_TOLERANCE),a=this.wW.get(e)||[],s=a.filter(function(e){return e.isPlaybackRangeOverlapping(r)});if(0===s.length&&this.VW(((i={})[e]=0,i)),this.BX(a,r,n)){var u=a[0];u.markAsReferenceSegment(),s.push(u)}this.wW.set(e,s)}},e.prototype.BX=function(e,t,n){var i=this.CX();if((0,d.isSwitchingBufferBlocks)(i)||0!==t.length||0===e.length)return!1;var r=this.uW.store.getState(),o=!!(null==r?void 0:r.player)&&(0,s.getIsSeekingOrTimeshifting)(r.player),u=this.uW.serviceManager.get(a.ServiceName.ManifestService,this.uW.sourceContext.sourceIdentifier),c=this.mapToExternalTime(n),l=null==u?void 0:u.getPeriodIdForTime(c);return!o&&e[0].periodId===l},e.prototype.mapToExternalTime=function(e,t){var n=this;void 0===t&&(t=!1);var i=this.wW.getAllValues(),r=i.find(function(t){var i=t.playbackRange.start-n.uW.settings.GAP_TOLERANCE,r=t.playbackRange.end+n.uW.settings.GAP_TOLERANCE;return!t.isReferenceSegment&&e>=i&&e<=r})||(t?i[0]:void 0);return r&&(this.zW=r.originalPlaybackTime-r.playbackTime),this.mapToCachedExternalTime(e)},e.prototype.mapToCachedExternalTime=function(e){return void 0!==this.zW?Math.max(this.zW+e,0):e},e.prototype.mapToInternalTime=function(e,t,n){var i=this;void 0===t&&(t=!1);var r=this.wW.getAllValues().filter(function(e){return void 0===n||n===e.mimeType}),o=r.find(function(t){var n=t.originalPlaybackRange.start-i.uW.settings.GAP_TOLERANCE,r=t.originalPlaybackRange.end+i.uW.settings.GAP_TOLERANCE;return e>=n&&e<=r})||(t?r[0]:void 0);return o?Math.max(o.playbackTime+(e-o.originalPlaybackTime),0):e},e.prototype.mapToExternalTimeRange=function(e){if(null!=e)return{start:this.mapToExternalTime(e.start),end:this.mapToExternalTime(e.end)}},e.prototype.mapToExternalTimeRanges=function(e){var t=this;return e.map(function(e){return t.mapToExternalTimeRange(e)}).filter(function(e){return void 0!==e})},e.prototype.mapToExternalTimeRangesMap=function(e){var t=this;return null==e?null:Object.keys(e).reduce(function(n,i){return n[i]=t.mapToExternalTimeRanges(e[i]),n},{})},e.prototype.getSegmentTimeRanges=function(e,t){var n=this,i=[];return e.forEach(function(e){var r=n.wW.get(t).find(function(t){return t.isSegmentMatching(e)});r&&i.push(r.playbackRange)}),i},e.prototype.getCorrectTimeStampOffset=function(e,t){var n=this.xW.get(e);return n||(n=new f.Deferred,this.xW.set(e,n)),n.promise.then(function(e){return t+e})},e.prototype.dispose=function(){var e,t,n,i;this.wW.clear(),this.HW(),null===(e=this.uW.videoElement)||void 0===e||e.removeEventListener(v.MediaElementEvent.currenttimenotadvancing,this.EW),null===(t=this.uW.videoElement)||void 0===t||t.removeEventListener(v.MediaElementEvent.waiting,this.EW),null===(n=this.uW.videoElement)||void 0===n||n.removeEventListener(v.MediaElementEvent.stalled,this.EW),null===(i=this.uW.videoElement)||void 0===i||i.removeEventListener(v.MediaElementEvent.timeupdate,this.DW)},e.prototype.CX=function(){return this.uW.serviceManager.get(a.ServiceName.SourceStoreService,this.uW.sourceContext.sourceIdentifier)},e}();function O(e,t){return e.includes(t)||e.push(t),e}t.BaseMediaDecodeTimeHandler=_,Math.log(2)},44885:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.addSegmentTimeInfoToMap=void 0,t.ensureMimeTypeInMap=function(e,t){e.get(t)||e.addAll(t,[])},t.addSegmentTimeInfoToMap=function(e,t,n){(function(e,t,n){var i;return null===(i=e.get(t))||void 0===i?void 0:i.find(function(e){return e.segmentUrl===(null==n?void 0:n.segmentUrl)&&e.equals(n)})})(e,t,n)||e.add(t,n)}},73849:function(e,t){function n(e){return Math.floor(e.originalBaseMediaDecodeTime-e.baseMediaDecodeTime)}function i(e){return Math.floor(e.originalPresentationTimeOffset-e.presentationTimeOffset)}function r(e,t,n){return e.find(function(e){var i=e.originalPlaybackRange.end;return t.originalPlaybackRange.start>=i-n&&t.originalPlaybackRange.start<=i+n})}function o(e,t){return e.reduce(function(e,n){var i=n.originalPlaybackTime,r=e?e.originalPlaybackTime:-1/0;return i<t&&i>r?n:e},void 0)}Object.defineProperty(t,"__esModule",{value:!0}),t.findOverflowDataForSegmentInMap=function(e,t,a,s){var u=1/0,c=1/0,l=r(t,e,a)||o(t,e.originalPlaybackTime),f=l?e.timescale/l.timescale:1,d=l&&e.originalPresentationTimeOffset===l.originalPresentationTimeOffset*f;return d&&(u=e.originalBaseMediaDecodeTime-Math.round(n(l)*f),c=e.originalPresentationTimeOffset-Math.round(i(l)*f)),{baseMediaDecodeTime:u,presentationTimeOffset:c,foundMatchingPreviousSegment:Boolean(d)}},t.getBmdtOffset=n,t.getPtoOffset=i,t.findPrecedingSegmentTimeInfo=r,t.getLargestPrecedingSegmentTimeInfo=o},8301:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.findContinuousSegmentToMove=t.maybeSwitchOverASegmentToDiscontinuous=void 0;var i=n(44885);t.maybeSwitchOverASegmentToDiscontinuous=function(e){var n=(0,t.findContinuousSegmentToMove)(e);return n&&(e.continuousSegmentTimeInfoMap.deleteValue(n.mimeType,n),n.updateAsDiscontinuous(),(0,i.addSegmentTimeInfoToMap)(e.discontinuousSegmentTimeInfoMap,n.mimeType,n)),n},t.findContinuousSegmentToMove=function(e){var t=e.continuousSegmentTimeInfoMap.keys;if(2!==t.length)return null;if(t.every(function(t){return e.continuousSegmentTimeInfoMap.get(t).length>0}))return null;for(var n=0,i=t;n<i.length;n++){var r=i[n];if(e.discontinuousSegmentTimeInfoMap.has(r)&&!((e.discontinuousSegmentTimeInfoMap.get(r)||[]).length>0)){var o=e.continuousSegmentTimeInfoMap.get(r)||[];if(o.length)return o[0]}}return null}},48558:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentTimeInformation=void 0,t.getSectionId=o;var i=n(4524),r=function(){function e(e,t){var n,i,r=this;this.equals=function(e){if(e){var t=r.mimeType===e.mimeType,n=r.duration===e.duration,i=r.originalBaseMediaDecodeTime===e.originalBaseMediaDecodeTime,o=r.sectionId===e.sectionId;return t&&n&&i&&o}return!1},this.segmentUrl=e.getUrl(),this.duration=e.getDuration(),this.mimeType=e.getMimeType(),this.timescale=null!==(n=e.getTimescale())&&void 0!==n?n:1,this.originalPlaybackTime=e.getPlaybackTime(),this.Icb=null===(i=e.getSegmentInfo())||void 0===i?void 0:i.byteRange,this.originalBaseMediaDecodeTime=e.getBaseMediaDecodeTime(),this.originalPresentationTimeOffset=e.getPresentationTimeOffset()*this.timescale,this.isBaseMediaDecodeTimeLimitExceeded=this.originalBaseMediaDecodeTime+this.duration*this.timescale>t,this.periodId=e.getPeriodId(),this.Hcb=!1,this.sectionId=o(e),this.truncatedBaseMediaDecodeTime=1/0,this.truncatedPresentationTimeOffset=1/0,this.truncatedPlaybackTime=1/0}return Object.defineProperty(e.prototype,"isReferenceSegment",{get:function(){return this.Hcb},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"playbackTime",{get:function(){return this.isBaseMediaDecodeTimeLimitExceeded&&this.truncatedPlaybackTime!==1/0?this.truncatedPlaybackTime:this.originalPlaybackTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseMediaDecodeTime",{get:function(){return this.isBaseMediaDecodeTimeLimitExceeded&&this.truncatedBaseMediaDecodeTime!==1/0?this.truncatedBaseMediaDecodeTime:this.originalBaseMediaDecodeTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"presentationTimeOffset",{get:function(){return this.isBaseMediaDecodeTimeLimitExceeded&&this.truncatedPresentationTimeOffset!==1/0?this.truncatedPresentationTimeOffset:this.originalPresentationTimeOffset},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"playbackRange",{get:function(){return{start:this.playbackTime,end:this.playbackTime+this.duration}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"originalPlaybackRange",{get:function(){return{start:this.originalPlaybackTime,end:this.originalPlaybackTime+this.duration}},enumerable:!1,configurable:!0}),e.prototype.getMatchingSegment=function(e){var t=this;return e.find(function(e){return t.isSegmentMatching(e)})},e.prototype.isSegmentMatching=function(e){var t,n,i,r=e.getUrl()===this.segmentUrl,o=e.getPlaybackTime()===this.originalPlaybackTime,a=null===(t=e.getSegmentInfo())||void 0===t?void 0:t.byteRange,s=(null==a?void 0:a.start)===(null===(n=this.Icb)||void 0===n?void 0:n.start),u=(null==a?void 0:a.end)===(null===(i=this.Icb)||void 0===i?void 0:i.end),c=s&&u,l=e.getMimeType()===this.mimeType;return r&&o&&c&&l},e.prototype.updateAsDiscontinuous=function(){this.isBaseMediaDecodeTimeLimitExceeded=!0},e.prototype.updateAsContinuous=function(e,t){this.truncatedBaseMediaDecodeTime=e,this.truncatedPresentationTimeOffset=t,this.truncatedPlaybackTime=(e-t)/this.timescale},e.prototype.markAsReferenceSegment=function(){this.Hcb=!0},e.prototype.isPlaybackRangeOverlapping=function(e){var t=this.playbackRange,n={buffered:e},r=i.BufferRangeHelper.isInBufferedRange(n,t.start),o=i.BufferRangeHelper.isInBufferedRange(n,t.end),a=i.BufferRangeHelper.getCommonBufferedRanges({buffered:e,inSegment:[t]}).length>0;return r||o||a},e}();function o(e){var t,n,i;return null!==(i=null===(n=null===(t=e.getSegmentInfo())||void 0===t?void 0:t.discontinuitySequenceNumber)||void 0===n?void 0:n.toString())&&void 0!==i?i:e.getPeriodId()}t.SegmentTimeInformation=r},21651:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentTimeInformationArrayMap=void 0;var r=function(e){function t(){return e.call(this,function(e,t){return e.originalPlaybackTime-t.originalPlaybackTime})||this}return i(t,e),t.prototype.find=function(e){if(e)return this.get(e.getMimeType()).find(function(t){return t.isSegmentMatching(e)})},t}(n(61252).SortedArrayMap);t.SegmentTimeInformationArrayMap=r},61252:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.SortedArrayMap=void 0;var r=function(e){function t(t){var n=e.call(this)||this;return n.Tdb=t,n.Udb=[],n}return i(t,e),t.prototype.getAllValues=function(){return this.Udb},t.prototype.Vdb=function(e){return e?e.sort(this.Tdb):[]},t.prototype.set=function(t,n){var i=this.Vdb(n);return this.Wdb(t,i),e.prototype.set.call(this,t,i)},t.prototype.add=function(e,t){var n=t?[t]:[];return this.addAll(e,n),this},t.prototype.addAll=function(e,t){this.ensure(e),this.set(e,[].concat(t||[],this.get(e)))},t.prototype.delete=function(t){return this.Xdb(this.get(t)),e.prototype.delete.call(this,t)},t.prototype.deleteValue=function(t,n){return this.Xdb([n]),e.prototype.deleteValue.call(this,t,n)},t.prototype.clear=function(){this.Udb=[],e.prototype.clear.call(this)},t.prototype.Wdb=function(e,t){void 0===t&&(t=[]);var n=this.get(e);this.Xdb(n),this.Udb=this.Vdb(this.Udb.concat(t))},t.prototype.Xdb=function(e){var t=this;void 0===e&&(e=[]),e.forEach(function(e){var n=t.Udb.indexOf(e);n>-1&&t.Udb.splice(n,1)})},t}(n(19483).ArrayMap);t.SortedArrayMap=r},1124:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.getTvMseWrapperConstructor=function(){return void 0===r&&(r=l()),r};var r,o=n(3714),a=n(20213),s=n(70850),u=n(88052),c=n(24281),l=function(){return function(e){function t(t,n){var i=e.call(this,t)||this;return i.Ecb={},i.Dcb=n,i}return i(t,e),t.prototype.printDetailedBufferRange=function(e,t){var n;try{n=e.buffered}catch(e){return}if(0!==n.length)for(var i=0;i<n.length;i++)n.start(i),n.end(i)},t.prototype.getBufferStartTime=function(){var e=this,t=Object.keys(this.sourceBuffers).map(function(t){return 0===e.sourceBuffers[t].bufferedRanges.length?0:e.Dcb.mapToExternalTime(e.sourceBuffers[t].bufferedRanges[0].start)});return Math.max.apply(null,t)},t.prototype.updateTimestampOffset=function(t,n){try{e.prototype.updateTimestampOffset.call(this,t,n)}catch(e){e.code===DOMException.INVALID_STATE_ERR&&this.context.eventHandler.dispatchEvent(o.PlayerEvent.Warning,new a.PlayerWarning(a.WarningCode.PLAYBACK_WARNING,"Unable to update timestampOffset (Invalid State error)",e))}},t.prototype.Fcb=function(e,t){this.Ecb[e]||(this.Ecb[e]={currentOffset:this.sourceBuffers[e].buffer.timestampOffset,pendingOffset:t})},t.prototype.queueTimestampOffsetUpdate=function(t,n){var i=this;return this.Fcb(t,n),this.Dcb.getCorrectTimeStampOffset(t,n).then(function(e){return i.Ecb[t].pendingOffset=e}).then(function(){var n=i.Ecb[t].pendingOffset,r=i.Ecb[t].currentOffset;return s.Util.roundValue(r,6)===s.Util.roundValue(n,6)&&i.isMediaSourceOpen()?Promise.resolve():(i.Ecb[t].currentOffset=n,e.prototype.queueTimestampOffsetUpdate.call(i,t,n).finally(function(){var e,n,r=null===(n=null===(e=i.sourceBuffers[t])||void 0===e?void 0:e.buffer)||void 0===n?void 0:n.timestampOffset;i.Ecb[t].currentOffset=r}))})},t.prototype.getBufferRangeStart=function(e,t){void 0===t&&(t=0);var n=this.Dcb.getEarliestExternalTimeBufferedRangeIndex(e);return Math.max(t,e.start(n))},t.prototype.preBufferRemoval=function(e,t,n){},t.prototype.getRangePendingRemoval=function(e){return this.sourceBuffers.hasOwnProperty(e)&&this.Dcb.mapToExternalTimeRange(this.sourceBuffers[e].rangePendingRemoval)||void 0},t.prototype.addToBuffer=function(t){var n=this;return(0,c.rewriteUnsupportedBoxes)(t),this.Gcb(t).then(function(){return e.prototype.addToBuffer.call(n,t)})},t.prototype.Gcb=function(e){var t=e.getMimeType(),n=-e.getPresentationTimeOffset();return e.isDirty()&&!e.isInit()?this.setTimestampOffset(t,n):Promise.resolve()},t}(u.ModuleManager.get(a.ModuleName.RendererMse).MSEWrapper)}},35501:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),r=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var i,r=0,o=t.length;r<o;r++)!i&&r in t||(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.getTvRendererConstructor=function(){return void 0===o&&(o=m()),o};var o,a=n(4524),s=n(66790),u=n(34841),c=n(88052),l=n(62756),f=n(84276),d=n(48558),p=n(1124),m=function(){return function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.postBufferRemoval=function(e,n,i){t.video&&t.baseMediaDecodeTimeHandler.signalBufferRemoval(e,t.mW(e),t.video.currentTime)},t}return i(t,e),t.prototype.init=function(t){this.baseMediaDecodeTimeHandler=new f.BaseMediaDecodeTimeHandler(this.context,this.bV.bind(this),this.getMaxSafeBaseMediaDecodeTime(),this.getMaxSafePresentationTimeOffset()),e.prototype.init.call(this,t),this.aV||(this.aV=new u.Deferred),this.aV.resolve(this.baseMediaDecodeTimeHandler)},t.prototype.getMaxSafeBaseMediaDecodeTime=function(){return 1/0},t.prototype.getMaxSafePresentationTimeOffset=function(){return 1/0},t.prototype.createMSEWrapper=function(){return new((0,p.getTvMseWrapperConstructor)())(this.context,this.baseMediaDecodeTimeHandler)},t.prototype.getCurrentVideoTime=function(){return this.baseMediaDecodeTimeHandler.mapToExternalTime(e.prototype.getCurrentVideoTime.call(this))},t.prototype.getRangesInSourceBuffers=function(){return this.baseMediaDecodeTimeHandler.mapToExternalTimeRangesMap(e.prototype.getRangesInSourceBuffers.call(this))},t.prototype.getBufferedRanges=function(t){return this.baseMediaDecodeTimeHandler.mapToExternalTimeRanges(e.prototype.getBufferedRanges.call(this,t))},t.prototype.getVideoElementBufferedRanges=function(){var t=e.prototype.getVideoElementBufferedRanges.call(this);return this.baseMediaDecodeTimeHandler.mapToExternalTimeRanges(t)},t.prototype.bV=function(e){var t,n,i=this;if(!this.mse)return Promise.reject();var r=null===(t=this.mse)||void 0===t?void 0:t.getBufferedRanges(e),o=null!==(n=null==r?void 0:r.slice(1))&&void 0!==n?n:[];return Promise.all(o.map(function(t){var n;return null===(n=i.mse)||void 0===n?void 0:n.removeFromBuffer(e,t.start-i.settings.GAP_TOLERANCE,t.end+i.settings.GAP_TOLERANCE,i.postBufferRemoval)})).then(function(){})},t.prototype.removeData=function(e,t,n,i){if(void 0===i&&(i=!1),!this.mse)return Promise.reject();void 0===t&&void 0===n&&!i&&this.saveCurrentTime(),this.removeDataFromSegmentQueues(e,t,n);var r=void 0!==t?this.baseMediaDecodeTimeHandler.mapToInternalTime(t,!0,e):void 0,o=void 0!==n?this.baseMediaDecodeTimeHandler.mapToInternalTime(n,!0,e):void 0;return this.mse.removeFromBuffer(e,r,o,this.postBufferRemoval)},t.prototype.addSegmentFromQueueToMse=function(t){var n=this,i=this.nW(function(e){return!e.isInit()}),r=Object.keys(this.segmentQueues).every(function(e){var t=n.mse&&n.mse.getBufferedRanges(e).length>0,r=i.some(function(t){return t.getMimeType()===e});return t||r});if(0===i.length||!r)return Promise.reject(s.SOURCE_BUFFER_APPEND_STATUS.SUSPENDED);var o=i.reduce(function(e,t){return t.getPlaybackTime()<e.getPlaybackTime()?t:e},i[0]),a=(0,d.getSectionId)(o),u=this.nW(function(e){return!e.isInit()&&(0,d.getSectionId)(e)===a});return this.baseMediaDecodeTimeHandler.rewriteTimeStampsIfNecessary(u)?e.prototype.addSegmentFromQueueToMse.call(this,t):Promise.reject(s.SOURCE_BUFFER_APPEND_STATUS.SUSPENDED)},t.prototype.mW=function(e){var t,n;if(null===this.mse||!this.segmentQueues.hasOwnProperty(e))return[];var i=this.nW(function(e){return!e.isInit()}),o=this.baseMediaDecodeTimeHandler.getSegmentTimeRanges(i,e),s=null!==(n=null===(t=this.mse)||void 0===t?void 0:t.getBufferedRanges(e))&&void 0!==n?n:[];return a.BufferRangeHelper.mergeRanges(r(r([],o,!0),s,!0),this.settings.GAP_TOLERANCE)},t.prototype.adjustTimeToNextCommonBufferStart=function(t){var n=e.prototype.adjustTimeToNextCommonBufferStart.call(this,t);return isNaN(n)?NaN:Math.ceil(100*this.baseMediaDecodeTimeHandler.mapToInternalTime(n))/100},t.prototype.seekOnVideoElement=function(e){var t=this;return this.waitingForSeekedPromise=new Promise(function(n,i){if(t.video){t.video.currentTime=e;var r=t.video.currentTime;n(t.getBaseMediaDecodeTimeHandler().then(function(e){return e.mapToExternalTime(r)}))}else i("No video reference")}),this.waitingForSeekedPromise},t.prototype.getBaseMediaDecodeTimeHandler=function(){return this.aV.promise},t.prototype.nW=function(e){var t=this;return void 0===e&&(e=function(){return!0}),Object.keys(this.segmentQueues).flatMap(function(e){return t.segmentQueues[e]}).filter(e)},t.prototype.getEndOfBufferTime=function(){if(this.video&&this.video.buffered&&this.video.buffered.length>0&&this.baseMediaDecodeTimeHandler)return this.baseMediaDecodeTimeHandler.getEndOfBufferTime()},t.prototype.shutdown=function(t){var n=this;return e.prototype.shutdown.call(this,t).then(function(){n.oW()})},t.prototype.oW=function(){this.aV=new u.Deferred,this.baseMediaDecodeTimeHandler.dispose()},t.prototype.release=function(){return this.oW(),e.prototype.release.call(this)},t}(c.ModuleManager.get(l.ModuleName.RendererMse).MSERenderer)}},24281:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.rewriteUnsupportedBoxes=function(e,t){void 0===t&&(t=o),t.forEach(function(t){var n,i=null===(n=e.getParsedData())||void 0===n?void 0:n.get(t);i&&(0,r.rewriteMp4BoxType)(i,"free")})};var i=n(15487),r=n(2992),o=function(){var e=["skip"];return((0,i.isTizen2016)()||(0,i.isTizen2017)())&&e.push("moov.trak.edts"),e}()},85537:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.withDrmLicenseWaiting=function(e,t){return function(e){function n(){for(var n,i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];var a=e.apply(this,i)||this;return a.DX=[],a.encryptedEventHandler=function(e){var n;a.onEncryptedEvent(e);var i=a.drmService;if(i)for(var r=0,o=null!==(n=null==t?void 0:t(e.initData))&&void 0!==n?n:[];r<o.length;r++){var s=o[r];if(s.systemName===a.GX()){var u=btoa(i.preprocessInitDataStr(s));a.initializeLicense(s.systemName,u)}}},null===(n=a.video)||void 0===n||n.addEventListener(s.MediaElementEvent.encrypted,a.encryptedEventHandler),a.EX=(0,o.subscribe)(a.context.store)(function(e){return null==e?void 0:e.drmLicenses},function(e){return e&&a.resolveAvailableLicenses(e.drmData)}),a}return i(n,e),n.prototype.setCurrentTime=function(t){var n=this;return this.waitForDrmLicenseResolving().then(function(){return e.prototype.setCurrentTime.call(n,t)})},n.prototype.onEncryptedEvent=function(e){},Object.defineProperty(n.prototype,"FX",{get:function(){var e=this;return this.DX.filter(function(t){return t.systemName===e.GX()})},enumerable:!1,configurable:!0}),n.prototype.waitForDrmLicenseResolving=function(){var e,t,n,i=null===(n=null===(t=null===(e=this.context.store)||void 0===e?void 0:e.getState())||void 0===t?void 0:t.drmLicenses)||void 0===n?void 0:n.drmData;i&&this.resolveAvailableLicenses(i);var r=this.FX;return r.length,Promise.all(r.map(function(e){return e.licenseReady.promise})).then(function(){r.length})},n.prototype.resolveAvailableLicenses=function(e){this.FX.filter(function(t){return Boolean(e[t.systemName])}).forEach(function(t){var n=e[t.systemName],i=Object.keys(n).find(function(e){var i=n[e];return btoa(i.initDataStr)===t.licenseInfoKey});i&&e[t.systemName][i].hasLicense&&t.licenseReady.resolve()})},n.prototype.initializeLicense=function(e,t){this.DX.some(function(n){return n.systemName===e&&n.licenseInfoKey===t})||this.DX.push({systemName:e,licenseInfoKey:t,licenseReady:new a.Deferred})},n.prototype.GX=function(){var e,t;return this.context.serviceManager.has(r.ServiceName.DrmService)&&null!==(t=null===(e=this.context.serviceManager.get(r.ServiceName.DrmService))||void 0===e?void 0:e.getUsedKeySystemKind())&&void 0!==t?t:null},n.prototype.shutdown=function(t){var n;return t||(this.DX=[],this.EX(),null===(n=this.video)||void 0===n||n.removeEventListener(s.MediaElementEvent.encrypted,this.encryptedEventHandler)),e.prototype.shutdown.call(this,t)},n}(e)};var r=n(80813),o=n(93204),a=n(34841),s=n(19274)},69507:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.WebosModuleDefinition=void 0;var i=n(70962),r=n(15487),o=n(62756),a=n(41503),s=n(18616),u=n(99959),c=n(98745),l=n(42350),f=n(13492);t.WebosModuleDefinition={name:o.ModuleName.Webos,module:function(){return{getWebosRendererConstructor:u.getWebosRendererConstructor,getWebosDrmManagerConstructor:s.getWebosDrmManagerConstructor,WebosVideoElementWrapper:l.WebosVideoElementWrapper,getWebosUnprefixedEmeHandlerConstructor:c.getWebosUnprefixedEmeHandlerConstructor,getWebos2017UnprefixedEmeHandlerConstructor:a.getWebos2017UnprefixedEmeHandlerConstructor,getWebosWebkitPrefixedEmeHandlerConstructor:f.getWebosWebkitPrefixedEmeHandlerConstructor}},dependencies:[o.ModuleName.RendererMse],hooks:{add:function(){i.DefaultSettings.END_OF_BUFFER_RECOVERY_TOLERANCE=1,(0,r.isWebOs2019OrOlder)()&&(i.DefaultSettings.WEBOS_MAX_SAFE_BMDT=274877906943,i.DefaultSettings.WEBOS_MAX_SAFE_PTO=4194303),(0,r.isWebOs2019OrOlder)()?i.DefaultSettings.MAX_STARTUP_BUFFER=6:(0,r.isWebOs2020)()?i.DefaultSettings.MAX_STARTUP_BUFFER=4:i.DefaultSettings.MAX_STARTUP_BUFFER=2.5,(0,r.isWebOs2016)()&&(i.DefaultSettings.HLS_CLEAR_BUFFERS_ON_DISCONTINUITY_SWITCHES=!0)}}},t.default=t.WebosModuleDefinition},41503:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.getWebos2017UnprefixedEmeHandlerConstructor=function(){return void 0===r&&(r=function(){return function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.load=function(t,n,i,r){return e.prototype.load.call(this,t,n,i,r),Promise.resolve()},t.prototype.setupKeySystem=function(t){var n=this;return this.xw=new o.Deferred,this.xw.promise.then(function(){return e.prototype.setupKeySystem.call(n,t)}).catch(function(e){throw e})},t.prototype.addInitData=function(e){var t,n,i;e&&(null===(n=null===(t=this.context.sourceContext)||void 0===t?void 0:t.source.drm)||void 0===n?void 0:n.immediateLicenseRequest)&&(null===(i=this.xw)||void 0===i||i.resolve())},t.prototype.processMediaEncryptedEvent=function(t){var n;return null===(n=this.xw)||void 0===n||n.resolve(),e.prototype.processMediaEncryptedEvent.call(this,t)},t.prototype.unload=function(){var t;return null===(t=this.xw)||void 0===t||t.reject("Unloaded the WebosEmeHandler"),e.prototype.unload.call(this)},t}((0,a.getWebosUnprefixedEmeHandlerConstructor)())}()),r};var r,o=n(34841),a=n(98745)},18616:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.getWebosDrmManagerConstructor=function(){if(null===s&&r.ModuleManager.has(o.ModuleName.DRM)){var e=r.ModuleManager.get(o.ModuleName.DRM).DRMManager;s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.setConfig=function(t,n){var i=this;return e.prototype.setConfig.call(this,t,n).then(function(e){return function(e){return e instanceof(0,a.getWebosWebkitPrefixedEmeHandlerConstructor)()}(i.emeHandler)&&i.emeHandler.setWebosDrmManager(i),e})},t.prototype.addInitData=function(t){var n,i;null===(i=null===(n=this.emeHandler)||void 0===n?void 0:n.addInitData)||void 0===i||i.call(n,t),e.prototype.addInitData.call(this,t)},t.prototype.getRequestedLicenses=function(){var e=this.getUsedKeySystemKind();return this.licenseStorage.getAllLicensesForKeySystem(e).filter(function(e){return e.hasLicense})},t.prototype.resetLicense=function(e,t){this.licenseStorage.resetLicense(t,e)},t}(e)}return s};var r=n(88052),o=n(62756),a=n(13492),s=null},70007:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.WebosOnPlayListener=void 0;var i=n(89927),r=n(19274),o=function(){function e(e){this.eventHandler=e}return e.prototype.listenToPlay=function(){var e=this;return new Promise(function(t,n){e.tW(),e.sW=function(){e.tW(),setTimeout(function(){n(new Error("Play promise rejected because the source was unloaded"))},(0,i.toSeconds)(1))},e.eventHandler.addEventListener(r.MediaElementEvent.emptied,e.sW)})},e.prototype.tW=function(){this.sW&&(this.eventHandler.removeEventListener(r.MediaElementEvent.emptied,this.sW),this.sW=void 0)},e.prototype.dispose=function(){this.tW()},e}();t.WebosOnPlayListener=o},99959:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.getWebosRendererConstructor=function(){var e;return null===f&&(f=d(null===(e=a.ModuleManager.get(s.ModuleName.DRM,!1))||void 0===e?void 0:e.parseInitData)),f};var r=n(77753),o=n(19274),a=n(88052),s=n(62756),u=n(84276),c=n(35501),l=n(85537),f=null,d=function(e){var t=(0,c.getTvRendererConstructor)();return function(e){function t(t){var n=e.call(this,t)||this;return n.yw=new Map,n.zw=!1,n.Aw=!1,n.baseMediaDecodeTimeHandler.setPtoGapFillingMode(u.PtoGapFillingMode.FillGaps),n}return i(t,e),t.prototype.onEncryptedEvent=function(e){this.zw=!0},t.prototype.getMaxSafeBaseMediaDecodeTime=function(){return this.context.settings.WEBOS_MAX_SAFE_BMDT},t.prototype.getMaxSafePresentationTimeOffset=function(){return this.context.settings.WEBOS_MAX_SAFE_PTO},t.prototype.Bw=function(e){return!!function(e){var t=e.isInit(),n=e.isEncrypted(),i=e.hasDrmInitData();return!t&&n&&!i}(e)&&!this.Aw&&!this.zw},t.prototype.Cw=function(){var e,t=this;if(0!==this.yw.size){this.yw.forEach(function(e){var n,i={type:o.MediaElementEvent.encrypted,initData:e};null===(n=t.context.videoElement)||void 0===n||n.eventHandler.triggerEvent(o.MediaElementEvent.encrypted,i)});var n=this.context.store.getState();(0,r.isInstanceState)(n)&&this.resolveAvailableLicenses(null===(e=a.ModuleManager.get(s.ModuleName.DRM).getLicenseState(n))||void 0===e?void 0:e.drmData)}else this.context.videoElement.eventHandler.triggerEvent(o.MediaElementEvent.encrypted)},t.prototype.Dw=function(e){this.mse&&(this.Aw=this.Aw||e.hasDrmInitData(),this.Bw(e)&&this.Cw())},t.prototype.addDrmInitData=function(t){var n=this;e.prototype.addDrmInitData.call(this,t),t.forEach(function(e){n.yw.has(e.initDataStr)||n.yw.set(e.initDataStr,e.initData)})},t.prototype.appendData=function(t){var n=this;return e.prototype.appendData.call(this,t).then(function(){return n.Dw(t)})},t.prototype.shutdown=function(t){var n,i,r=this;this.yw.clear(),this.zw=!1,this.Aw=!1;var o=function(){return e.prototype.shutdown.call(r,t).then(function(){var e;return null===(e=r.drmService)||void 0===e?void 0:e.suspend()})};return(null!==(i=null===(n=this.drmService)||void 0===n?void 0:n.prepareForMseShutdown())&&void 0!==i?i:Promise.resolve()).then(o,o)},t}((0,l.withDrmLicenseWaiting)(t,e))}},98745:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.getWebosUnprefixedEmeHandlerConstructor=function(){return void 0===r&&(r=s()),r},t.getWebosUnprefixedEmeHandlerClass=s;var r,o=n(88052),a=n(62756);function s(){return function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.Fw=null,t.Gw=null,t}return i(t,e),t.prototype.load=function(t,n,i,r){return e.prototype.load.call(this,t,n,i,r)},t.prototype.Hw=function(){var t=this;this.Fw&&e.prototype.setMediaKeys.call(this,this.Fw).catch(function(e){}).finally(function(){t.Fw=null})},t.prototype.setMediaKeys=function(t){return this.Gw=t,e.prototype.setMediaKeys.call(this,t)},t.prototype.onServerCertificateSetFailed=function(t,n,i){var r=t!==this.Gw,o=n instanceof DOMException&&n.message.includes("Operation aborted");r&&o||e.prototype.onServerCertificateSetFailed.call(this,t,n,i)},t.prototype.processMediaEncryptedEvent=function(t){e.prototype.processMediaEncryptedEvent.call(this,t),this.Hw()},t.prototype.closeSession=function(e){try{return e.close()}catch(e){return Promise.resolve()}},t.prototype.prepareForMseShutdown=function(){var e,t;return null!==(t=null===(e=this.video)||void 0===e?void 0:e.mediaKeysPromise)&&void 0!==t?t:Promise.resolve()},t.prototype.suspend=function(){var e,t;return this.Fw=null!==(t=null===(e=this.video)||void 0===e?void 0:e.mediaKeysObject)&&void 0!==t?t:null,this.setMediaKeys(null)},t.prototype.unload=function(){return this.Fw=null,this.Gw=null,e.prototype.unload.call(this)},t}(o.ModuleManager.get(a.ModuleName.DRM).UnprefixedEMEHandler)}},42350:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.WebosVideoElementWrapper=void 0;var r=n(21513),o=n(15487),a=n(79186),s=n(70007),u=function(e){function t(t,n){var i=e.call(this,t,n)||this;return i.Ew=new s.WebosOnPlayListener(i.eventHandler),i}return i(t,e),t.prototype.play=function(){return(0,r.getCapabilities)().chromiumVersion<=o.WEBOS_2018_2019_CHROMIUM_VERSION?Promise.race([e.prototype.play.call(this),this.Ew.listenToPlay()]):e.prototype.play.call(this)},t.prototype.dispose=function(){this.Ew.dispose(),e.prototype.dispose.call(this)},t}(a.VideoElementWrapper);t.WebosVideoElementWrapper=u},13492:function(e,t,n){var i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.getWebosWebkitPrefixedEmeHandlerConstructor=function(){if(null===s&&o.ModuleManager.has(a.ModuleName.DRM)){var e=o.ModuleManager.get(a.ModuleName.DRM);s=function(e){function t(t){var n=e.call(this,t)||this;return n.Jw=[],n}return i(t,e),t.prototype.invokeEncryptedListener=function(t,n){var i=this;if(this.Iw){var r=this.Iw.getUsedKeySystemKind();n.forEach(function(e){var t,n;if(e.systemName===r){var o=null!==(n=null===(t=i.keySystem)||void 0===t?void 0:t.getIdentifierFromInitData(e.initDataStr))&&void 0!==n?n:e.initDataStr,a=i.Jw.findIndex(function(e){return e.initDataStr===o});a>-1&&(i.Jw.splice(a,1),i.Iw.resetLicense(o,r))}})}e.prototype.invokeEncryptedListener.call(this,t,n)},t.prototype.prepareForMseShutdown=function(){var e,t=null===(e=this.context.serviceManager)||void 0===e?void 0:e.get(r.ServiceName.DrmService),n=null==t?void 0:t.getUsedKeySystemKind();return t&&n?t.waitForPendingLicenseRequests(n):Promise.resolve()},t.prototype.suspend=function(){return this.Iw&&(this.Jw=this.Iw.getRequestedLicenses()),e.prototype.suspend.call(this)},t.prototype.unload=function(){return this.Iw=null,e.prototype.unload.call(this)},t.prototype.setWebosDrmManager=function(e){this.Iw=e},t}(e.WebKitPrefixedEMEHandler)}return s};var r=n(80813),o=n(88052),a=n(62756),s=null}},function(e){return function(){return e(69507)}()}])});
|
|
18
18
|
})();
|