bitmovin-player 8.281.0 → 8.282.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 +1 -1
- package/modules/bitmovinplayer-analytics.prod.js +1 -1
- 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
|
@@ -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.282.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.vidaa=t():(e.bitmovin=e.bitmovin||{},e.bitmovin.player=e.bitmovin.player||{},e.bitmovin.player.vidaa=t())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[838],{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),d=n(34841),l=n(87244),m=n(85434),p=n(15487),g=n(89927),h=n(19274),v=n(88052),T=n(62756),y=n(44885),M=n(73849),b=n(8301),E=n(48558),V=n(21651);!function(e){e.KeepGaps="keep-gaps",e.FillGaps="fill-gaps"}(r||(t.PtoGapFillingMode=r={}));var B=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 V.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(O(n)," bits")),e.logger.debug("PresentationTimeOffset limit is set to ".concat(O(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 f.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 V.SegmentTimeInformationArrayMap;return this.DV.keys.forEach(function(e){return(0,y.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 f=t.SV(e),d=f?f.originalPresentationTimeOffset/f.timescale:s;d===s||t.HV!==r.FillGaps&&!(null==f?void 0:f.isBaseMediaDecodeTimeLimitExceeded)||(t.BV.logger.debug("Detected a presentation time offset change: ".concat(d," -> ").concat(s),{precedingSegmentTimeInfo:null==f?void 0:f.segmentUrl}),i=!0),(0,y.addSegmentTimeInfoToMap)(o,a.mimeType,a)}}),[n,i,o]},e.prototype.UV=function(e){return v.ModuleManager.has(T.ModuleName.ContainerMP4)?e.getTFDTBoxOffsets()||v.ModuleManager.get(T.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,y.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,f=Math.floor(u/r);i.truncatedBaseMediaDecodeTime=c,i.truncatedPresentationTimeOffset=s,t.hasOwnProperty(e)||(t[e]=f)}),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 d.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,y.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 f=c[u],d=(null!==(t=this.DV.get(f))&&void 0!==t?t:[]).filter(function(e){return!o.includes(e)&&!e.isReferenceSegment});d.sort(function(e,t){return e.originalPlaybackTime-t.originalPlaybackTime});var l=d.pop(),m=null!==(n=null==l?void 0:l.playbackRange.end)&&void 0!==n?n:1/0,p=e.get(f)||[];if(0===p.length)return 1/0;var g=Math.min.apply(Math,p.map(function(e){return e.playbackTime})),h=g-m;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,T=this.HV===r.KeepGaps?Math.min.apply(Math,a):Math.max.apply(Math,a);return Math.min(T,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,M.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,f={start:c,end:c+r},d=u.playbackTime+u.duration,l={start:d,end:d+u.duration},m=Math.max(f.start,l.start);return!(Math.min(f.end,l.end)-m<=r/2)&&l.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,p.isTizen2017)())return!1;var t=e.originalPlaybackTime,n=e.duration,i=e.mimeType,r=t+n>(0,g.toSeconds)(this.maxSafeBaseMediaDecodeTime);return m.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 f.ArrayMap,i=new f.ArrayMap;return e.keys.forEach(function(r){var o;(0,y.ensureMimeTypeInMap)(n,r),(0,y.ensureMimeTypeInMap)(i,r),(0,y.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,M.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,y.addSegmentTimeInfoToMap)(i,r.mimeType,r);else{var a=o.baseMediaDecodeTime,u=o.presentationTimeOffset;r.updateAsContinuous(a,u),(0,y.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,b.maybeSwitchOverASegmentToDiscontinuous)({continuousSegmentTimeInfoMap:a,discontinuousSegmentTimeInfoMap:o});if(!s){var u=this.AW(this.DV);s=(0,b.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,y.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 m.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(P,[]).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 f=0,d=c.getAllValues();f<d.length;f++){var l=d[f],m=l.mimeType,p=null!==(t=this.DV.get(m))&&void 0!==t?t:[],g=(0,M.findPrecedingSegmentTimeInfo)(p,l,this.BV.settings.GAP_TOLERANCE);(null==g?void 0:g.isBaseMediaDecodeTimeLimitExceeded)&&!l.isBaseMediaDecodeTimeLimitExceeded&&(l.updateAsDiscontinuous(),l.updateAsContinuous(l.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(P,[])},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,l.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),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.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 d.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=B;var D=Math.log(2);function O(e){return Math.ceil(Math.log(e+1)/D)}function P(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,f=r(t,e,a)||o(t,e.originalPlaybackTime),d=f?e.timescale/f.timescale:1;1!==d&&s.debug("Detected a timescale change: ".concat(null==f?void 0:f.timescale," -> ").concat(e.timescale));var l=f&&e.originalPresentationTimeOffset===f.originalPresentationTimeOffset*d;return l&&(u=e.originalBaseMediaDecodeTime-Math.round(n(f)*d),c=e.originalPresentationTimeOffset-Math.round(i(f)*d)),{baseMediaDecodeTime:u,presentationTimeOffset:c,foundMatchingPreviousSegment:Boolean(l)}},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,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.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=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.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=p()),o};var o,a=n(4524),s=n(66790),u=n(34841),c=n(88052),f=n(62756),d=n(84276),l=n(48558),m=n(1124),p=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 d.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,m.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,l.getSectionId)(o),u=this.wV(function(e){return!e.isInit()&&(0,l.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(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}()},73868:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.VidaaModuleDefinition=void 0;var i=n(62756),r=n(72858),o=n(34742);t.VidaaModuleDefinition={name:i.ModuleName.Vidaa,module:function(){return{VidaaVideoElementWrapper:o.VidaaVideoElementWrapper,getVidaaMSERendererConstructor:r.getVidaaMSERendererConstructor}},dependencies:[i.ModuleName.RendererMse]},t.default=t.VidaaModuleDefinition},72858: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.getVidaaMSERendererConstructor=function(){return null===o&&(o=function(){return function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.getMaxSafeBaseMediaDecodeTime=function(){return this.context.settings.VIDAA_MAX_SAFE_BMDT},t.prototype.getMaxSafePresentationTimeOffset=function(){return this.context.settings.VIDAA_MAX_SAFE_PTO},t}((0,r.getTvRendererConstructor)())}()),o};var r=n(35501),o=null},34742: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.VidaaVideoElementWrapper=void 0;var r=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.prime=function(){return this.context.logger.log("Not priming video element as this causes issues on VIDAA"),Promise.resolve()},t}(n(79186).VideoElementWrapper);t.VidaaVideoElementWrapper=r}},function(e){return function(){return e(73868)}()}])});
|
|
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.vidaa=t():(e.bitmovin=e.bitmovin||{},e.bitmovin.player=e.bitmovin.player||{},e.bitmovin.player.vidaa=t())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[838],{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),d=n(34841),l=n(87244),m=n(85434),p=n(15487),g=n(89927),h=n(19274),v=n(88052),T=n(62756),y=n(44885),M=n(73849),b=n(8301),V=n(48558),E=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.mV=function(){s.oV(s.dV.settings.END_OF_BUFFER_TOLERANCE)},this.nV=function(){s.oV(s.dV.settings.END_OF_BUFFER_RECOVERY_TOLERANCE)},this.tV=function(){if(s.dV.videoElement)try{var e=s.sV(),t=s.dV.videoElement.currentTime,n=s.pV(t).mapEach(function(e){return e.playbackRange}).mapAll(function(e){return o.BufferRangeHelper.mergeRanges(e,s.dV.settings.GAP_TOLERANCE)}).getObject(),r=o.BufferRangeHelper.getCommonBufferedRanges(i(i({},n),{bufferedRanges:e})).shift();if(void 0!==r){var a=r.getStart();s.dV.logger.debug("continuing playback at ".concat(a," (from ").concat(t,")")),s.dV.videoElement.currentTime=a,s.qV(),s.dV.videoElement.eventHandler.removeEventListener(h.MediaElementEvent.currenttimenotadvancing,s.nV),s.kV().finally(function(){var e;return null===(e=s.bV())||void 0===e?void 0:e.dispatch((0,u.setTimestampRollingOver)(!1))}).then(function(){s.dV.logger.debug("successfully cleared previous buffers")}).catch(function(e){s.dV.logger.debug("could not clear previous buffers:",e)})}else s.rV()}catch(e){s.dV.logger.debug("could not handle timestamp overflow:",e)}else s.dV.logger.debug("Could not handle timestamp overflow: Video Element is not defined")},this.dV=e,this.jV=r.KeepGaps,this.hV=t,this.eV=void 0,this.gV=new Map,this.fV=new E.SegmentTimeInformationArrayMap,this.dV.videoElement?(this.dV.videoElement.addEventListener(h.MediaElementEvent.waiting,this.nV),this.dV.videoElement.addEventListener(h.MediaElementEvent.stalled,this.nV),this.dV.videoElement.addEventListener(h.MediaElementEvent.timeupdate,this.mV),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.kV=function(){var e=this,t=[];return this.lV().keys.forEach(function(n){t.push(e.hV(n))}),Promise.all(t).then(function(){})},e.prototype.getEndOfBufferTime=function(){var e=o.BufferRangeHelper.getCommonBufferedRanges(this.lV(!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.jV=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.dV.logger.debug("Could not determine buffer region offset:",e)}return t},e.prototype.lV=function(e){var t=this;return void 0===e&&(e=!1),this.fV.mapEach(function(t){return e?t.originalPlaybackRange:t.playbackRange}).mapAll(function(e){return o.BufferRangeHelper.mergeRanges(e,t.dV.settings.GAP_TOLERANCE)})},e.prototype.oV=function(e){var t,n,i=this.dV.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.bV())||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.dV.settings.MINIMAL_BACKWARD_BUFFER_CLEARING_INTERVAL,this.dV.settings.END_OF_BUFFER_TOLERANCE,this.dV.settings.END_OF_BUFFER_RECOVERY_TOLERANCE)&&(null===(n=this.bV())||void 0===n||n.dispatch((0,u.setTimestampRollingOver)(!0))),r>=a-e&&this.tV()}}}},e.prototype.pV=function(e){var t=this,n=this.dV.settings.GAP_TOLERANCE,i=new f.ArrayMap;return this.fV.keys.forEach(function(r){var o=!1,a=-1/0,s=t.fV.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.qV=function(){void 0!==this.eV&&(this.eV(),this.eV=void 0)},e.prototype.rV=function(){var e=this,t=this.bV();void 0!==t&&(this.qV(),this.eV=(0,c.subscribeToRendererBufferChanges)(t,function(){return e.nV()}))},e.prototype.sV=function(){var e,t=[],n=null===(e=this.dV.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.uV=function(e){var t,n=e.getMimeType(),i=e.getPlaybackTimeRange();if(void 0!==i){var r=(null!==(t=this.fV.get(n))&&void 0!==t?t:[]).filter(function(e){return e.originalPlaybackRange.end<i.end});return r[r.length-1]}},e.prototype.vV=function(e){var t=this,n=!1,i=!1,o=new E.SegmentTimeInformationArrayMap;return this.fV.keys.forEach(function(e){return(0,y.ensureMimeTypeInMap)(o,e)}),e.forEach(function(e){if(!e.isDirty()){var a=new V.SegmentTimeInformation(e,t.maxSafeBaseMediaDecodeTime),s=a.presentationTimeOffset/a.timescale,u=t.OV(s),c=t.PV(a);(n=n||u||c||t.dV.settings.FORCE_BASE_MEDIA_DECODE_TIME_REWRITE||t.KV(a)||t.LV(a,a.baseMediaDecodeTime,a.presentationTimeOffset))&&(a.isBaseMediaDecodeTimeLimitExceeded=!0,t.dV.logger.debug("BaseMediaDecodeTime (".concat(a.originalBaseMediaDecodeTime,") exceeding limit for ").concat(a.mimeType," segment")));var f=t.uV(e),d=f?f.originalPresentationTimeOffset/f.timescale:s;d===s||t.jV!==r.FillGaps&&!(null==f?void 0:f.isBaseMediaDecodeTimeLimitExceeded)||(t.dV.logger.debug("Detected a presentation time offset change: ".concat(d," -> ").concat(s),{precedingSegmentTimeInfo:null==f?void 0:f.segmentUrl}),i=!0),(0,y.addSegmentTimeInfoToMap)(o,a.mimeType,a)}}),[n,i,o]},e.prototype.wV=function(e){return v.ModuleManager.has(T.ModuleName.ContainerMP4)?e.getTFDTBoxOffsets()||v.ModuleManager.get(T.ModuleName.ContainerMP4).parseTfdtBoxOffsets(e):(this.dV.logger.debug("Can't rewrite BMDT for TS segment as MP4 module is not available"),[])},e.prototype.xV=function(e,t){var n=this.wV(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.yV=function(e,t){var n=this;t.forAll(function(t,i){(0,y.addSegmentTimeInfoToMap)(n.fV,t,i);var r=i.getMatchingSegment(e);r&&n.xV(r,i)})},e.prototype.zV=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.AV=function(e,t){var n=this;return Math.min.apply(Math,e.transform(function(e){return n.zV(e,t)}))},e.prototype.BV=function(e){return this.AV(e,function(e){return e.truncatedBaseMediaDecodeTime-e.truncatedPresentationTimeOffset})},e.prototype.CV=function(e){return this.AV(e,function(e){return e.originalPresentationTimeOffset})},e.prototype.DV=function(e){var t={},n=this.CV(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.EV(t)):this.dV.logger.debug("Could not determine common PresentationTimeOffset divisor")},e.prototype.EV=function(e){var t=this;Object.keys(e).forEach(function(n){var i=t.gV.get(n);i&&i.resolve(e[n]);var r=new d.Deferred;t.gV.set(n,r),r.resolve(e[n])})},e.prototype.FV=function(e,t){var n,i=this,r=this.BV(t);isFinite(r)?(t.forAll(function(t,n){var o=n.getMatchingSegment(e);o&&i.GV(o,n,r),(0,y.addSegmentTimeInfoToMap)(i.fV,t,n)}),null===(n=this.dV.videoElement)||void 0===n||n.addEventListener(h.MediaElementEvent.currenttimenotadvancing,this.nV)):this.dV.logger.debug("Could not determine common BaseMediaDecideTime divisor")},e.prototype.GV=function(e,t,n){t.truncatedBaseMediaDecodeTime=t.truncatedBaseMediaDecodeTime-t.timescale*n,t.truncatedPlaybackTime=(t.truncatedBaseMediaDecodeTime-t.truncatedPresentationTimeOffset)/t.timescale,this.xV(e,t)},e.prototype.HV=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],d=(null!==(t=this.fV.get(f))&&void 0!==t?t:[]).filter(function(e){return!o.includes(e)&&!e.isReferenceSegment});d.sort(function(e,t){return e.originalPlaybackTime-t.originalPlaybackTime});var l=d.pop(),m=null!==(n=null==l?void 0:l.playbackRange.end)&&void 0!==n?n:1/0,p=e.get(f)||[];if(0===p.length)return 1/0;var g=Math.min.apply(Math,p.map(function(e){return e.playbackTime})),h=g-m;s=Math.min(s,g),isFinite(h)&&a.push(h)}if(a.length!==i.length)return this.dV.logger.debug("No segments to align with end of buffer"),0;var v=s-this.dV.settings.GAP_TOLERANCE,T=this.jV===r.KeepGaps?Math.min.apply(Math,a):Math.max.apply(Math,a);return Math.min(T,v)},e.prototype.IV=function(e,t){var n=this,i=this.HV(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.MV(c,u,o,t)||(n.dV.logger.debug("Cannot shift segments to EOB: would exceed timestamp limits for ".concat(e)),r=!1)}}),r){this.dV.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.EV(o),e.forEach(function(e){return e.setDirty(!0)})}else this.dV.logger.debug("Cannot align segments with end of buffer: would exceed timestamp limits")},e.prototype.JV=function(e,t,n){return 0===t.length||(t.keys.every(function(e){return(t.get(e)||[]).length>0})?(this.DV(t),this.FV(e,t),n&&this.IV(e,t),!0):(this.dV.logger.debug("Could not handle BaseMediaDecodeTime overflow: at least one buffer is empty"),!1))},e.prototype.KV=function(e){var t;if(e.isBaseMediaDecodeTimeLimitExceeded)return!0;var n=(0,M.getLargestPrecedingSegmentTimeInfo)(null!==(t=this.fV.get(e.mimeType))&&void 0!==t?t:[],e.originalPlaybackTime);return!!n&&isFinite(n.truncatedBaseMediaDecodeTime)&&n.truncatedBaseMediaDecodeTime!==n.originalBaseMediaDecodeTime},e.prototype.LV=function(e,t,n){var i,r=e.duration,o=e.timescale,a=e.mimeType,s=this.fV.keys.find(function(e){return e!==a});if(!s)return!1;var u=null===(i=this.fV.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},d=u.playbackTime+u.duration,l={start:d,end:d+u.duration},m=Math.max(f.start,l.start);return!(Math.min(f.end,l.end)-m<=r/2)&&l.end*u.timescale-u.presentationTimeOffset>this.maxSafeBaseMediaDecodeTime},e.prototype.MV=function(e,t,n,i){var r=this,o=n.duration,a=n.timescale;if(e+o*a>this.maxSafeBaseMediaDecodeTime)return this.dV.logger.debug("Detected BMDT overflow for ".concat(n.mimeType," segment")),!1;if(this.LV(n,e,t))return this.dV.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.fV);return c.every(function(e){return r.NV(s,u,e)})},e.prototype.NV=function(e,t,n){return t*n+e*n<=this.maxSafeBaseMediaDecodeTime},e.prototype.OV=function(e){return Math.abs(e)>this.maxSafePresentationTimeOffset},e.prototype.PV=function(e){if(!(0,p.isTizen2017)())return!1;var t=e.originalPlaybackTime,n=e.duration,i=e.mimeType,r=t+n>(0,g.toSeconds)(this.maxSafeBaseMediaDecodeTime);return m.MimeTypeHelper.isAudio(i)&&r},e.prototype.QV=function(e,t){if(this.dV.settings.FORCE_BASE_MEDIA_DECODE_TIME_REWRITE)return!0;var n=e/t.timescale;return!!this.OV(n)||this.PV(t)},e.prototype.RV=function(e,t,n){var i=e.baseMediaDecodeTime,r=e.presentationTimeOffset,o=e.foundMatchingPreviousSegment,a=!this.MV(i,r,t,n);return o?a:a||this.QV(r,t)},e.prototype.SV=function(e){var t=this,n=new f.ArrayMap,i=new f.ArrayMap;return e.keys.forEach(function(r){var o;(0,y.ensureMimeTypeInMap)(n,r),(0,y.ensureMimeTypeInMap)(i,r),(0,y.ensureMimeTypeInMap)(t.fV,r);var a=null!==(o=t.fV.get(r))&&void 0!==o?o:[],s=a.length?a:t.fV.getAllValues();(e.get(r)||[]).forEach(function(r){var o=(0,M.findOverflowDataForSegmentInMap)(r,s,t.dV.settings.GAP_TOLERANCE,t.dV.logger);if(t.RV(o,r,e))t.dV.logger.debug("Segment added to discontinuous time info map.",r.segmentUrl,r.mimeType),r.updateAsDiscontinuous(),(0,y.addSegmentTimeInfoToMap)(i,r.mimeType,r);else{var a=o.baseMediaDecodeTime,u=o.presentationTimeOffset;r.updateAsContinuous(a,u),(0,y.addSegmentTimeInfoToMap)(n,r.mimeType,r)}})}),{discontinuousSegmentTimeInfoMap:i,continuousSegmentTimeInfoMap:n}},e.prototype.TV=function(e,t,n){var i,r=this.SV(t),o=r.discontinuousSegmentTimeInfoMap,a=r.continuousSegmentTimeInfoMap;if(this.yV(e,a),this.JV(e,o,n))return!0;var s=(0,b.maybeSwitchOverASegmentToDiscontinuous)({continuousSegmentTimeInfoMap:a,discontinuousSegmentTimeInfoMap:o});if(!s){var u=this.SV(this.fV);s=(0,b.maybeSwitchOverASegmentToDiscontinuous)({continuousSegmentTimeInfoMap:u.continuousSegmentTimeInfoMap,discontinuousSegmentTimeInfoMap:o}),this.dV.logger.debug("Did not find any matching segment time info in current map, retried with existing ones.",s)}return!!s&&(this.dV.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.JV(e,o,n))},e.prototype.UV=function(e){var t=this;e.forAll(function(e,n){var i;(null===(i=t.fV.get(e))||void 0===i?void 0:i.find(n.equals))||(0,y.addSegmentTimeInfoToMap)(t.fV,n.mimeType,n);var r=t.gV.get(n.mimeType);r&&r.resolve(0)})},e.prototype.VV=function(e){return e.every(function(e){return m.MimeTypeHelper.isMP4(e.getMimeType())})},e.prototype.WV=function(){this.maxSafeBaseMediaDecodeTime=1/0,this.maxSafePresentationTimeOffset=1/0},e.prototype.XV=function(){return this.maxSafeBaseMediaDecodeTime!==1/0||this.maxSafePresentationTimeOffset!==1/0},e.prototype.rewriteTimeStampsIfNecessary=function(e){var t;!this.VV(e)&&this.XV()&&(this.dV.logger.debug("Disabling BMDT rewriting due to unsupported container format"),this.WV());var n=this.YV(),i=e.map(V.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.fV.keys.every(function(e){return r.includes(e)});if(i&&!o)return this.dV.logger.debug("Cannot check for rewriting necessity - not all buffers have data yet"),!1;var a=this.vV(e),s=a[0],u=a[1],c=a[2];if(s)return this.TV(e,c,u);if(i&&u)return this.ZV(e,c),!0;for(var f=0,d=c.getAllValues();f<d.length;f++){var l=d[f],m=l.mimeType,p=null!==(t=this.fV.get(m))&&void 0!==t?t:[],g=(0,M.findPrecedingSegmentTimeInfo)(p,l,this.dV.settings.GAP_TOLERANCE);(null==g?void 0:g.isBaseMediaDecodeTimeLimitExceeded)&&!l.isBaseMediaDecodeTimeLimitExceeded&&(l.updateAsDiscontinuous(),l.updateAsContinuous(l.originalBaseMediaDecodeTime,g.truncatedPresentationTimeOffset))}return this.UV(c),!0},e.prototype.YV=function(){return this.fV.transform(function(e){return e.map(function(e){return e.sectionId})}).flatMap(function(e){return e}).reduce(D,[])},e.prototype.ZV=function(e,t){var n={},i=this.HV(t);this.dV.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.EV(n),this.UV(t),e.forEach(function(e){return e.setDirty(!0)})},e.prototype.signalBufferRemoval=function(e,t,n){var i;if(this.fV.has(e)){var r=o.BufferRangeHelper.mergeRanges(t,this.dV.settings.GAP_TOLERANCE),a=this.fV.get(e)||[],s=a.filter(function(e){return e.isPlaybackRangeOverlapping(r)});if(0===s.length&&this.EV(((i={})[e]=0,i)),this.aV(a,r,n)){var u=a[0];this.dV.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.fV.set(e,s)}},e.prototype.aV=function(e,t,n){var i=this.bV();if((0,l.isSwitchingBufferBlocks)(i)||0!==t.length||0===e.length)return!1;var r=this.dV.store.getState(),o=!!(null==r?void 0:r.player)&&(0,s.getIsSeekingOrTimeshifting)(r.player),u=this.dV.serviceManager.get(a.ServiceName.ManifestService,this.dV.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.fV.getAllValues(),r=i.find(function(t){var i=t.playbackRange.start-n.dV.settings.GAP_TOLERANCE,r=t.playbackRange.end+n.dV.settings.GAP_TOLERANCE;return!t.isReferenceSegment&&e>=i&&e<=r})||(t?i[0]:void 0);return r&&(this.iV=r.originalPlaybackTime-r.playbackTime),this.mapToCachedExternalTime(e)},e.prototype.mapToCachedExternalTime=function(e){return void 0!==this.iV?Math.max(this.iV+e,0):(this.dV.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.fV.getAllValues().filter(function(e){return void 0===n||n===e.mimeType}),o=r.find(function(t){var n=t.originalPlaybackRange.start-i.dV.settings.GAP_TOLERANCE,r=t.originalPlaybackRange.end+i.dV.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.fV.get(t).find(function(t){return t.isSegmentMatching(e)});r&&i.push(r.playbackRange)}),i},e.prototype.getCorrectTimeStampOffset=function(e,t){var n=this.gV.get(e);return n||(n=new d.Deferred,this.gV.set(e,n)),n.promise.then(function(e){return t+e})},e.prototype.dispose=function(){var e,t,n,i;this.fV.clear(),this.qV(),null===(e=this.dV.videoElement)||void 0===e||e.removeEventListener(h.MediaElementEvent.currenttimenotadvancing,this.nV),null===(t=this.dV.videoElement)||void 0===t||t.removeEventListener(h.MediaElementEvent.waiting,this.nV),null===(n=this.dV.videoElement)||void 0===n||n.removeEventListener(h.MediaElementEvent.stalled,this.nV),null===(i=this.dV.videoElement)||void 0===i||i.removeEventListener(h.MediaElementEvent.timeupdate,this.mV)},e.prototype.bV=function(){return this.dV.serviceManager.get(a.ServiceName.SourceStoreService,this.dV.sourceContext.sourceIdentifier)},e}();t.BaseMediaDecodeTimeHandler=O;var P=Math.log(2);function S(e){return Math.ceil(Math.log(e+1)/P)}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,f=r(t,e,a)||o(t,e.originalPlaybackTime),d=f?e.timescale/f.timescale:1;1!==d&&s.debug("Detected a timescale change: ".concat(null==f?void 0:f.timescale," -> ").concat(e.timescale));var l=f&&e.originalPresentationTimeOffset===f.originalPresentationTimeOffset*d;return l&&(u=e.originalBaseMediaDecodeTime-Math.round(n(f)*d),c=e.originalPresentationTimeOffset-Math.round(i(f)*d)),{baseMediaDecodeTime:u,presentationTimeOffset:c,foundMatchingPreviousSegment:Boolean(l)}},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.wcb=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.vcb=!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.vcb},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.wcb)||void 0===n?void 0:n.start),u=(null==a?void 0:a.end)===(null===(i=this.wcb)||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.vcb=!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.Qdb=t,n.Rdb=[],n}return i(t,e),t.prototype.getAllValues=function(){return this.Rdb},t.prototype.Sdb=function(e){return e?e.sort(this.Qdb):[]},t.prototype.set=function(t,n){var i=this.Sdb(n);return this.Tdb(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.Udb(this.get(t)),e.prototype.delete.call(this,t)},t.prototype.deleteValue=function(t,n){return this.Udb([n]),e.prototype.deleteValue.call(this,t,n)},t.prototype.clear=function(){this.Rdb=[],e.prototype.clear.call(this)},t.prototype.Tdb=function(e,t){void 0===t&&(t=[]);var n=this.get(e);this.Udb(n),this.Rdb=this.Sdb(this.Rdb.concat(t))},t.prototype.Udb=function(e){var t=this;void 0===e&&(e=[]),e.forEach(function(e){var n=t.Rdb.indexOf(e);n>-1&&t.Rdb.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.ycb={},i.xcb=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.xcb.mapToExternalTime(r,!0)," - ").concat(this.xcb.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.xcb.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.zcb=function(e,t){this.ycb[e]||(this.ycb[e]={currentOffset:this.sourceBuffers[e].buffer.timestampOffset,pendingOffset:t})},t.prototype.queueTimestampOffsetUpdate=function(t,n){var i=this;return this.zcb(t,n),this.xcb.getCorrectTimeStampOffset(t,n).then(function(e){return i.ycb[t].pendingOffset=e}).then(function(){var n=i.ycb[t].pendingOffset,r=i.ycb[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.ycb[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.ycb[t].currentOffset=r}))})},t.prototype.getBufferRangeStart=function(e,t){void 0===t&&(t=0);var n=this.xcb.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.xcb.mapToExternalTime(t)," to ").concat(this.xcb.mapToExternalTime(n),") (").concat(t," to ").concat(n,")"))},t.prototype.getRangePendingRemoval=function(e){return this.sourceBuffers.hasOwnProperty(e)&&this.xcb.mapToExternalTimeRange(this.sourceBuffers[e].rangePendingRemoval)||void 0},t.prototype.addToBuffer=function(t){var n=this;return(0,c.rewriteUnsupportedBoxes)(t),this.Acb(t).then(function(){return e.prototype.addToBuffer.call(n,t)})},t.prototype.Acb=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=p()),o};var o,a=n(4524),s=n(66790),u=n(34841),c=n(88052),f=n(62756),d=n(84276),l=n(48558),m=n(1124),p=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.LU(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 d.BaseMediaDecodeTimeHandler(this.context,this.KU.bind(this),this.getMaxSafeBaseMediaDecodeTime(),this.getMaxSafePresentationTimeOffset()),e.prototype.init.call(this,t),this.JU||(this.JU=new u.Deferred),this.JU.resolve(this.baseMediaDecodeTimeHandler)},t.prototype.getMaxSafeBaseMediaDecodeTime=function(){return 1/0},t.prototype.getMaxSafePresentationTimeOffset=function(){return 1/0},t.prototype.createMSEWrapper=function(){return new((0,m.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.KU=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.MU(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,l.getSectionId)(o),u=this.MU(function(e){return!e.isInit()&&(0,l.getSectionId)(e)===a});return this.baseMediaDecodeTimeHandler.rewriteTimeStampsIfNecessary(u)?e.prototype.addSegmentFromQueueToMse.call(this,t):Promise.reject(s.SOURCE_BUFFER_APPEND_STATUS.SUSPENDED)},t.prototype.LU=function(e){var t,n;if(null===this.mse||!this.segmentQueues.hasOwnProperty(e))return[];var i=this.MU(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.JU.promise},t.prototype.MU=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.NU()})},t.prototype.NU=function(){this.JU=new u.Deferred,this.baseMediaDecodeTimeHandler.dispose()},t.prototype.release=function(){return this.NU(),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}()},73868:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.VidaaModuleDefinition=void 0;var i=n(62756),r=n(72858),o=n(34742);t.VidaaModuleDefinition={name:i.ModuleName.Vidaa,module:function(){return{VidaaVideoElementWrapper:o.VidaaVideoElementWrapper,getVidaaMSERendererConstructor:r.getVidaaMSERendererConstructor}},dependencies:[i.ModuleName.RendererMse]},t.default=t.VidaaModuleDefinition},72858: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.getVidaaMSERendererConstructor=function(){return null===o&&(o=function(){return function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.getMaxSafeBaseMediaDecodeTime=function(){return this.context.settings.VIDAA_MAX_SAFE_BMDT},t.prototype.getMaxSafePresentationTimeOffset=function(){return this.context.settings.VIDAA_MAX_SAFE_PTO},t}((0,r.getTvRendererConstructor)())}()),o};var r=n(35501),o=null},34742: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.VidaaVideoElementWrapper=void 0;var r=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.prime=function(){return this.context.logger.log("Not priming video element as this causes issues on VIDAA"),Promise.resolve()},t}(n(79186).VideoElementWrapper);t.VidaaVideoElementWrapper=r}},function(e){return function(){return e(73868)}()}])});
|
|
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.282.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.vidaa=t():(e.bitmovin=e.bitmovin||{},e.bitmovin.player=e.bitmovin.player||{},e.bitmovin.player.vidaa=t())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[838],{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),d=n(34841),l=n(87244),p=n(85434),m=n(15487),h=n(89927),g=n(19274),v=n(88052),T=n(62756),y=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 O=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(g.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(g.MediaElementEvent.waiting,this.EW),this.uW.videoElement.addEventListener(g.MediaElementEvent.stalled,this.EW),this.uW.videoElement.addEventListener(g.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 f.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,y.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 f=t.LW(e);(f?f.originalPresentationTimeOffset/f.timescale:s)===s||t.AW!==r.FillGaps&&!(null==f?void 0:f.isBaseMediaDecodeTimeLimitExceeded)||(i=!0),(0,y.addSegmentTimeInfoToMap)(o,a.mimeType,a)}}),[n,i,o]},e.prototype.NW=function(e){return v.ModuleManager.has(T.ModuleName.ContainerMP4)?e.getTFDTBoxOffsets()||v.ModuleManager.get(T.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,y.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,f=Math.floor(u/r);i.truncatedBaseMediaDecodeTime=c,i.truncatedPresentationTimeOffset=s,t.hasOwnProperty(e)||(t[e]=f)}),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 d.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,y.addSegmentTimeInfoToMap)(i.wW,t,n)}),null===(n=this.uW.videoElement)||void 0===n||n.addEventListener(g.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 f=c[u],d=(null!==(t=this.wW.get(f))&&void 0!==t?t:[]).filter(function(e){return!o.includes(e)&&!e.isReferenceSegment});d.sort(function(e,t){return e.originalPlaybackTime-t.originalPlaybackTime});var l=d.pop(),p=null!==(n=null==l?void 0:l.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})),g=h-p;s=Math.min(s,h),isFinite(g)&&a.push(g)}if(a.length!==i.length)return 0;var v=s-this.uW.settings.GAP_TOLERANCE,T=this.AW===r.KeepGaps?Math.min.apply(Math,a):Math.max.apply(Math,a);return Math.min(T,v)},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,f={start:c,end:c+r},d=u.playbackTime+u.duration,l={start:d,end:d+u.duration},p=Math.max(f.start,l.start);return!(Math.min(f.end,l.end)-p<=r/2)&&l.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 f.ArrayMap,i=new f.ArrayMap;return e.keys.forEach(function(r){var o;(0,y.ensureMimeTypeInMap)(n,r),(0,y.ensureMimeTypeInMap)(i,r),(0,y.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,y.addSegmentTimeInfoToMap)(i,r.mimeType,r);else{var a=o.baseMediaDecodeTime,u=o.presentationTimeOffset;r.updateAsContinuous(a,u),(0,y.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,y.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(P,[]).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 f=0,d=c.getAllValues();f<d.length;f++){var l=d[f],p=l.mimeType,m=null!==(t=this.wW.get(p))&&void 0!==t?t:[],h=(0,M.findPrecedingSegmentTimeInfo)(m,l,this.uW.settings.GAP_TOLERANCE);(null==h?void 0:h.isBaseMediaDecodeTimeLimitExceeded)&&!l.isBaseMediaDecodeTimeLimitExceeded&&(l.updateAsDiscontinuous(),l.updateAsContinuous(l.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(P,[])},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,l.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),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.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 d.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(g.MediaElementEvent.currenttimenotadvancing,this.EW),null===(t=this.uW.videoElement)||void 0===t||t.removeEventListener(g.MediaElementEvent.waiting,this.EW),null===(n=this.uW.videoElement)||void 0===n||n.removeEventListener(g.MediaElementEvent.stalled,this.EW),null===(i=this.uW.videoElement)||void 0===i||i.removeEventListener(g.MediaElementEvent.timeupdate,this.DW)},e.prototype.CX=function(){return this.uW.serviceManager.get(a.ServiceName.SourceStoreService,this.uW.sourceContext.sourceIdentifier)},e}();function P(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),d=f?e.timescale/f.timescale:1,l=f&&e.originalPresentationTimeOffset===f.originalPresentationTimeOffset*d;return l&&(u=e.originalBaseMediaDecodeTime-Math.round(n(f)*d),c=e.originalPresentationTimeOffset-Math.round(i(f)*d)),{baseMediaDecodeTime:u,presentationTimeOffset:c,foundMatchingPreviousSegment:Boolean(l)}},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,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.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=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.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),f=n(62756),d=n(84276),l=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 d.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,l.getSectionId)(o),u=this.nW(function(e){return!e.isInit()&&(0,l.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(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}()},73868:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.VidaaModuleDefinition=void 0;var i=n(62756),r=n(72858),o=n(34742);t.VidaaModuleDefinition={name:i.ModuleName.Vidaa,module:function(){return{VidaaVideoElementWrapper:o.VidaaVideoElementWrapper,getVidaaMSERendererConstructor:r.getVidaaMSERendererConstructor}},dependencies:[i.ModuleName.RendererMse]},t.default=t.VidaaModuleDefinition},72858: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.getVidaaMSERendererConstructor=function(){return null===o&&(o=function(){return function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.getMaxSafeBaseMediaDecodeTime=function(){return this.context.settings.VIDAA_MAX_SAFE_BMDT},t.prototype.getMaxSafePresentationTimeOffset=function(){return this.context.settings.VIDAA_MAX_SAFE_PTO},t}((0,r.getTvRendererConstructor)())}()),o};var r=n(35501),o=null},34742: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.VidaaVideoElementWrapper=void 0;var r=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.prime=function(){return Promise.resolve()},t}(n(79186).VideoElementWrapper);t.VidaaVideoElementWrapper=r}},function(e){return function(){return e(73868)}()}])});
|
|
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.vidaa=t():(e.bitmovin=e.bitmovin||{},e.bitmovin.player=e.bitmovin.player||{},e.bitmovin.player.vidaa=t())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[838],{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),d=n(34841),l=n(87244),p=n(85434),m=n(15487),h=n(89927),g=n(19274),v=n(88052),T=n(62756),y=n(44885),M=n(73849),b=n(8301),E=n(48558),V=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.videoElement.currentTime=a,s.OV(),s.BV.videoElement.eventHandler.removeEventListener(g.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(){}).catch(function(e){})}else s.PV()}catch(e){}},this.BV=e,this.HV=r.KeepGaps,this.FV=t,this.CV=void 0,this.EV=new Map,this.DV=new V.SegmentTimeInformationArrayMap,this.BV.videoElement&&(this.BV.videoElement.addEventListener(g.MediaElementEvent.waiting,this.LV),this.BV.videoElement.addEventListener(g.MediaElementEvent.stalled,this.LV),this.BV.videoElement.addEventListener(g.MediaElementEvent.timeupdate,this.KV),e.settings.FORCE_BASE_MEDIA_DECODE_TIME_REWRITE)}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){}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 f.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 V.SegmentTimeInformationArrayMap;return this.DV.keys.forEach(function(e){return(0,y.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);var f=t.SV(e);(f?f.originalPresentationTimeOffset/f.timescale:s)===s||t.HV!==r.FillGaps&&!(null==f?void 0:f.isBaseMediaDecodeTimeLimitExceeded)||(i=!0),(0,y.addSegmentTimeInfoToMap)(o,a.mimeType,a)}}),[n,i,o]},e.prototype.UV=function(e){return v.ModuleManager.has(T.ModuleName.ContainerMP4)?e.getTFDTBoxOffsets()||v.ModuleManager.get(T.ModuleName.ContainerMP4).parseTfdtBoxOffsets(e):[]},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,y.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,f=Math.floor(u/r);i.truncatedBaseMediaDecodeTime=c,i.truncatedPresentationTimeOffset=s,t.hasOwnProperty(e)||(t[e]=f)}),this.mW(t))},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 d.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,y.addSegmentTimeInfoToMap)(i.DV,t,n)}),null===(n=this.BV.videoElement)||void 0===n||n.addEventListener(g.MediaElementEvent.currenttimenotadvancing,this.LV))},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 f=c[u],d=(null!==(t=this.DV.get(f))&&void 0!==t?t:[]).filter(function(e){return!o.includes(e)&&!e.isReferenceSegment});d.sort(function(e,t){return e.originalPlaybackTime-t.originalPlaybackTime});var l=d.pop(),p=null!==(n=null==l?void 0:l.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})),g=h-p;s=Math.min(s,h),isFinite(g)&&a.push(g)}if(a.length!==i.length)return 0;var v=s-this.BV.settings.GAP_TOLERANCE,T=this.HV===r.KeepGaps?Math.min.apply(Math,a):Math.max.apply(Math,a);return Math.min(T,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)||(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.mW(o),e.forEach(function(e){return e.setDirty(!0)})}},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)},e.prototype.sW=function(e){var t;if(e.isBaseMediaDecodeTimeLimitExceeded)return!0;var n=(0,M.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,f={start:c,end:c+r},d=u.playbackTime+u.duration,l={start:d,end:d+u.duration},p=Math.max(f.start,l.start);return!(Math.min(f.end,l.end)-p<=r/2)&&l.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!1;if(this.tW(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.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,h.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 f.ArrayMap,i=new f.ArrayMap;return e.keys.forEach(function(r){var o;(0,y.ensureMimeTypeInMap)(n,r),(0,y.ensureMimeTypeInMap)(i,r),(0,y.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,M.findOverflowDataForSegmentInMap)(r,s,t.BV.settings.GAP_TOLERANCE,t.BV.logger);if(t.zW(o,r,e))r.updateAsDiscontinuous(),(0,y.addSegmentTimeInfoToMap)(i,r.mimeType,r);else{var a=o.baseMediaDecodeTime,u=o.presentationTimeOffset;r.updateAsContinuous(a,u),(0,y.addSegmentTimeInfoToMap)(n,r.mimeType,r)}})}),{discontinuousSegmentTimeInfoMap:i,continuousSegmentTimeInfoMap:n}},e.prototype.BW=function(e,t,n){var i=this.AW(t),r=i.discontinuousSegmentTimeInfoMap,o=i.continuousSegmentTimeInfoMap;if(this.WV(e,o),this.rW(e,r,n))return!0;var a=(0,b.maybeSwitchOverASegmentToDiscontinuous)({continuousSegmentTimeInfoMap:o,discontinuousSegmentTimeInfoMap:r});if(!a){var s=this.AW(this.DV);a=(0,b.maybeSwitchOverASegmentToDiscontinuous)({continuousSegmentTimeInfoMap:s.continuousSegmentTimeInfoMap,discontinuousSegmentTimeInfoMap:r})}return!!a&&this.rW(e,r,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,y.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.EW();var n=this.GW(),i=e.map(E.getSectionId).reduce(B,[]).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!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 f=0,d=c.getAllValues();f<d.length;f++){var l=d[f],p=l.mimeType,m=null!==(t=this.DV.get(p))&&void 0!==t?t:[],h=(0,M.findPrecedingSegmentTimeInfo)(m,l,this.BV.settings.GAP_TOLERANCE);(null==h?void 0:h.isBaseMediaDecodeTimeLimitExceeded)&&!l.isBaseMediaDecodeTimeLimitExceeded&&(l.updateAsDiscontinuous(),l.updateAsContinuous(l.originalBaseMediaDecodeTime,h.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(B,[])},e.prototype.HW=function(e,t){var n={},i=this.pW(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.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];u.markAsReferenceSegment(),s.push(u)}this.DV.set(e,s)}},e.prototype.IW=function(e,t,n){var i=this.JW();if((0,l.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),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.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):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 d.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(g.MediaElementEvent.currenttimenotadvancing,this.LV),null===(t=this.BV.videoElement)||void 0===t||t.removeEventListener(g.MediaElementEvent.waiting,this.LV),null===(n=this.BV.videoElement)||void 0===n||n.removeEventListener(g.MediaElementEvent.stalled,this.LV),null===(i=this.BV.videoElement)||void 0===i||i.removeEventListener(g.MediaElementEvent.timeupdate,this.KV)},e.prototype.JW=function(){return this.BV.serviceManager.get(a.ServiceName.SourceStoreService,this.BV.sourceContext.sourceIdentifier)},e}();function B(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),d=f?e.timescale/f.timescale:1,l=f&&e.originalPresentationTimeOffset===f.originalPresentationTimeOffset*d;return l&&(u=e.originalBaseMediaDecodeTime-Math.round(n(f)*d),c=e.originalPresentationTimeOffset-Math.round(i(f)*d)),{baseMediaDecodeTime:u,presentationTimeOffset:c,foundMatchingPreviousSegment:Boolean(l)}},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.qcb=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.fbb=!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.fbb},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.qcb)||void 0===n?void 0:n.start),u=(null==a?void 0:a.end)===(null===(i=this.qcb)||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.fbb=!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.Kcb=t,n.Lcb=[],n}return i(t,e),t.prototype.getAllValues=function(){return this.Lcb},t.prototype.Mcb=function(e){return e?e.sort(this.Kcb):[]},t.prototype.set=function(t,n){var i=this.Mcb(n);return this.Ncb(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.Ocb(this.get(t)),e.prototype.delete.call(this,t)},t.prototype.deleteValue=function(t,n){return this.Ocb([n]),e.prototype.deleteValue.call(this,t,n)},t.prototype.clear=function(){this.Lcb=[],e.prototype.clear.call(this)},t.prototype.Ncb=function(e,t){void 0===t&&(t=[]);var n=this.get(e);this.Ocb(n),this.Lcb=this.Mcb(this.Lcb.concat(t))},t.prototype.Ocb=function(e){var t=this;void 0===e&&(e=[]),e.forEach(function(e){var n=t.Lcb.indexOf(e);n>-1&&t.Lcb.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.scb={},i.rcb=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.rcb.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.tcb=function(e,t){this.scb[e]||(this.scb[e]={currentOffset:this.sourceBuffers[e].buffer.timestampOffset,pendingOffset:t})},t.prototype.queueTimestampOffsetUpdate=function(t,n){var i=this;return this.tcb(t,n),this.rcb.getCorrectTimeStampOffset(t,n).then(function(e){return i.scb[t].pendingOffset=e}).then(function(){var n=i.scb[t].pendingOffset,r=i.scb[t].currentOffset;return s.Util.roundValue(r,6)===s.Util.roundValue(n,6)&&i.isMediaSourceOpen()?Promise.resolve():(i.scb[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.scb[t].currentOffset=r}))})},t.prototype.getBufferRangeStart=function(e,t){void 0===t&&(t=0);var n=this.rcb.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.rcb.mapToExternalTimeRange(this.sourceBuffers[e].rangePendingRemoval)||void 0},t.prototype.addToBuffer=function(t){var n=this;return(0,c.rewriteUnsupportedBoxes)(t),this.ucb(t).then(function(){return e.prototype.addToBuffer.call(n,t)})},t.prototype.ucb=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),d=n(84276),l=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.yV(e),t.video.currentTime)},t}return i(t,e),t.prototype.init=function(t){this.baseMediaDecodeTimeHandler=new d.BaseMediaDecodeTimeHandler(this.context,this.xV.bind(this),this.getMaxSafeBaseMediaDecodeTime(),this.getMaxSafePresentationTimeOffset()),e.prototype.init.call(this,t),this.wV||(this.wV=new u.Deferred),this.wV.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.xV=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.zV(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,l.getSectionId)(o),u=this.zV(function(e){return!e.isInit()&&(0,l.getSectionId)(e)===a});return this.baseMediaDecodeTimeHandler.rewriteTimeStampsIfNecessary(u)?e.prototype.addSegmentFromQueueToMse.call(this,t):Promise.reject(s.SOURCE_BUFFER_APPEND_STATUS.SUSPENDED)},t.prototype.yV=function(e){var t,n;if(null===this.mse||!this.segmentQueues.hasOwnProperty(e))return[];var i=this.zV(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.wV.promise},t.prototype.zV=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.AV()})},t.prototype.AV=function(){this.wV=new u.Deferred,this.baseMediaDecodeTimeHandler.dispose()},t.prototype.release=function(){return this.AV(),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}()},73868:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.VidaaModuleDefinition=void 0;var i=n(62756),r=n(72858),o=n(34742);t.VidaaModuleDefinition={name:i.ModuleName.Vidaa,module:function(){return{VidaaVideoElementWrapper:o.VidaaVideoElementWrapper,getVidaaMSERendererConstructor:r.getVidaaMSERendererConstructor}},dependencies:[i.ModuleName.RendererMse]},t.default=t.VidaaModuleDefinition},72858: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.getVidaaMSERendererConstructor=function(){return null===o&&(o=function(){return function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.getMaxSafeBaseMediaDecodeTime=function(){return this.context.settings.VIDAA_MAX_SAFE_BMDT},t.prototype.getMaxSafePresentationTimeOffset=function(){return this.context.settings.VIDAA_MAX_SAFE_PTO},t}((0,r.getTvRendererConstructor)())}()),o};var r=n(35501),o=null},34742: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.VidaaVideoElementWrapper=void 0;var r=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.prime=function(){return Promise.resolve()},t}(n(79186).VideoElementWrapper);t.VidaaVideoElementWrapper=r}},function(e){return function(){return e(73868)}()}])});
|
|
18
18
|
})();
|