@bitmovin/player-web-x 10.1.3 → 10.1.4

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.
Files changed (45) hide show
  1. package/bundles/playerx-bitmovin-v8-core.js +2 -2
  2. package/bundles/playerx-bitmovin-v8.js +2 -2
  3. package/bundles/playerx-core.js +2 -2
  4. package/bundles/playerx-dash.js +2 -2
  5. package/bundles/playerx-hls.js +2 -2
  6. package/bundles/playerx-tv.js +2 -2
  7. package/package.json +1 -1
  8. package/packages/playerx-adaptation.package.js +2 -2
  9. package/packages/playerx-analytics.package.js +1 -1
  10. package/packages/playerx-bitmovin-source-api.package.js +1 -1
  11. package/packages/playerx-bitmovin-ui.package.js +1 -1
  12. package/packages/playerx-bitmovin-v8-core.package.js +1 -1
  13. package/packages/playerx-bitmovin-v8-static-api.package.js +1 -1
  14. package/packages/playerx-bitmovin-video-element-utils.package.js +1 -1
  15. package/packages/playerx-capabilities.package.js +1 -1
  16. package/packages/playerx-container-mp4.package.js +1 -1
  17. package/packages/playerx-container-ts.package.js +1 -1
  18. package/packages/playerx-core.package.js +2 -2
  19. package/packages/playerx-dash-parsing.package.js +1 -1
  20. package/packages/playerx-dash-translation.package.js +1 -1
  21. package/packages/playerx-dash.package.js +2 -2
  22. package/packages/playerx-data.package.js +2 -2
  23. package/packages/playerx-event-bus.package.js +1 -1
  24. package/packages/playerx-hls-parsing.package.js +1 -1
  25. package/packages/playerx-hls-translation.package.js +2 -2
  26. package/packages/playerx-hls.package.js +1 -1
  27. package/packages/playerx-network.package.js +2 -2
  28. package/packages/playerx-playback-api.package.js +1 -1
  29. package/packages/playerx-playback.package.js +1 -1
  30. package/packages/playerx-player-api.package.js +1 -1
  31. package/packages/playerx-presentation.package.js +2 -2
  32. package/packages/playerx-segment-processing.package.js +1 -1
  33. package/packages/playerx-source.package.js +1 -1
  34. package/packages/playerx-sources-api.package.js +1 -1
  35. package/packages/playerx-subtitle-api.package.js +1 -1
  36. package/packages/playerx-subtitle-base.package.js +1 -1
  37. package/packages/playerx-subtitle-format-detection.package.js +1 -1
  38. package/packages/playerx-subtitle-native-renderer.package.js +1 -1
  39. package/packages/playerx-subtitles.package.js +1 -1
  40. package/packages/playerx-trick-play.package.js +1 -1
  41. package/packages/playerx-ts-transmuxer.package.js +1 -1
  42. package/packages/playerx-tv.package.js +1 -1
  43. package/packages/playerx-view-mode.package.js +1 -1
  44. package/packages/playerx-web-vtt.package.js +1 -1
  45. package/playerx-framework-utils.js +1 -1
@@ -5,6 +5,6 @@
5
5
  * source code is subject to the terms and conditions of the accompanying
6
6
  * license agreement.
7
7
  *
8
- * Bitmovin Player X Version 10.1.3
8
+ * Bitmovin Player X Version 10.1.4
9
9
  *******************************************************************************/
10
10
  !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["container-mp4"]=e():(t.bitmovin=t.bitmovin||{},t.bitmovin.playerx=t.bitmovin.playerx||{},t.bitmovin.playerx["container-mp4"]=e())}(self,(()=>(()=>{"use strict";var t={7085:(t,e)=>{function s(t,e,s){const i=e;return i._name=t,{onAdd:i,dependencies:s}}Object.defineProperty(e,"__esModule",{value:!0}),e.createPackage=void 0,e.createPackage=s},1270:(t,e)=>{function s(t,e){const s=e;return s._name=t,s}function i(t){return(...e)=>{const[i,r]=t(...e);return s(i,r)}}function r(t){var e;return null!==(e=t._name)&&void 0!==e?e:t.name}Object.defineProperty(e,"__esModule",{value:!0}),e.getTaskName=e.createTaskClosure=e.createTask=void 0,e.createTask=s,e.createTaskClosure=i,e.getTaskName=r},8668:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BundleExportNames=void 0,function(t){t.Logger="logger",t.PlayerConfig="player-config"}(e.BundleExportNames||(e.BundleExportNames={}))},9922:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BoxTypes=void 0,e.BoxTypes=["ftyp","pdin","moov","moof","mvhd","trak","tkhd","edts","elst","mdia","mdhd","hdlr","minf","vmhd","smhd","dinf","dref","stbl","stsd","avc1","avcC","hvcC","mp4a","esds","stts","stsc","stsz","stco","ctts","stss","stsh","padb","stdp","cprt","free","skip","wide","pasp","clap","meco","mere","udta","meta","iloc","ipro","sinf","frma","schm","schi","hnti","hinf","vttC","tref","iref","urn ","url ","urn ","url ","styp","prft","pitm","fiin","feci","senc","sbgp","sgpd","subs","frma","saio","saiz","saio","saiz","seig","prft","fecr","urim","fiin","feci","fecr","gitn","wave","junk","void","pssh"]},4173:(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ContainerMp4Package=void 0;const i=s(7085),r=s(4809),n=s(158),o=s(7269),a=s(8622);e.ContainerMp4Package=(0,i.createPackage)("container-mp4-package",((t,e)=>{const{StateEffectFactory:s,EventListenerEffectFactory:i}=e.registry.get(r.CoreExportNames.CoreEffects),o=e.using(s).using(i);o.registry.get(n.SegmentProcessingExportNames.SegmentProcessingComponent).addProcessor((0,a.createFmp4Parser)(o))}),[o.SourceExportNames.SourceState,r.CoreExportNames.CoreEffects,r.CoreExportNames.CoreStateAtoms,n.SegmentProcessingExportNames.SegmentProcessorType,n.SegmentProcessingExportNames.SegmentProcessorErrors,n.SegmentProcessingExportNames.SegmentProcessingComponent]),e.default=e.ContainerMp4Package},3131:(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.parseCodecFromMoov=void 0;const i=s(8668),r=s(4809),n={Avc:["avc1","avc2","avc3"],Hvc:["hvc1","hev1"],Av1:["av01"]};function o(t){let e="";for(let s=0;s<t.byteLength;s++){const i=(255&t[s]).toString(16);i.length<2&&(e+="0"),e+=i}return e}function a(t,e){if(!e)return;const s=[...e.general_constraint_indicator_flags_bytes];for(;0===s[s.length-1];)s.pop();const i=s.map((t=>t.toString(16).toUpperCase()));return[t,`${["","A","B","C"][e.general_profile_space]}${e.general_profile_idc}`,`${e.general_profile_compatibility_flags}`,`${0===e.general_tier_flag?"L":"H"}${e.general_level_idc}`,...i].join(".")}function h(t){const e=t.get("avcC");if(!e||0===e.sps.length)return;return t.type+"."+o(new Uint8Array(e.sps[0].splice(1,3)))}function c(t,e){const s=e.get("mdia.minf.stbl.stsd");if(!s)return;const r=s.entries[0],n=(r.get("esds")||{}).decoderConfig;if(!n)return;const o=r.type,a=n.objectProfileIndication.toString(16),h=n.decoderConfigDescriptor.audioObjectType;if(0===parseInt(a)&&0===parseInt(h)&&"mp4a"===o){return t.registry.get(i.BundleExportNames.Logger).warn('Failed to extract MP4 codec string from segment - carrying on assuming it is "mp4a.40.2"'),"mp4a.40.2"}return o+"."+a+"."+h}function d(t,e){const s=e.get("mdia.minf.stbl.stsd");if(!s)return;const r=s.entries.find((t=>[...n.Avc,...n.Hvc,...n.Av1].includes(t.type)));if(r){if(n.Avc.includes(r.type))return h(r);if(n.Hvc.includes(r.type))return a(r.type,r.get("hvcC"));if(n.Av1.includes(r.type)){return t.registry.get(i.BundleExportNames.Logger).warn('Skipping AV1 codec extraction - using "av01.0.09M.08.0.111.01.01.01.0" instead'),"av01.0.09M.08.0.111.01.01.01.0"}}}function _(t,e){const{MediaType:s}=t.registry.get(r.CoreExportNames.Constants),i={[s.Unknown]:[]},n={};if(void 0===e)return{codecMap:i,trackMap:n};const o=e.list("trak");for(const e of o){const r=e.get("tkhd").track_ID,o=d(t,e),a=c(t,e);o&&(n[r]=s.Video,delete i[s.Unknown],i[s.Video]=[o]),a&&(n[r]=s.Audio,delete i[s.Unknown],i[s.Audio]=[a])}return{codecMap:i,trackMap:n}}e.parseCodecFromMoov=_},6917:(t,e)=>{function s(t,e){var s,i;const r=t.fetch("trun"),n=null===(s=null==r?void 0:r.samples)||void 0===s?void 0:s[0];return(null!==(i=null==n?void 0:n.sample_composition_time_offset)&&void 0!==i?i:0)/e}function i(t,e){const s=t.fetch("tfdt");return s&&void 0!==e?s.baseMediaDecodeTime/e:-1}function r(t,e){var s;const i=t.get("trun");if(!i)return 0;const r=t.get("tfhd"),n=r?r.default_sample_duration:void 0,o=null===(s=i.samples)||void 0===s?void 0:s.reduce(((t,s)=>t+(s.sample_duration||n||e||0)),0);return null!=o?o:0}function n(t,e){return i(t,e)+s(t,e)}function o(t,e,s){return t.list("moof.traf").reduce(((t,e)=>t+r(e,s)),0)/e}function a(t,e){const s=[],i=[...t.list("moov.trak.tkhd"),...t.list("moof.traf.tfhd")];for(const{track_ID:t}of i){const i=e[t];void 0===i||s.includes(i)||s.push(i)}return s}Object.defineProperty(e,"__esModule",{value:!0}),e.parseMediaTypes=e.parseDuration=e.parsePlaybackTime=void 0,e.parsePlaybackTime=n,e.parseDuration=o,e.parseMediaTypes=a},8622:function(t,e,s){var i=this&&this.__awaiter||function(t,e,s,i){function r(t){return t instanceof s?t:new s((function(e){e(t)}))}return new(s||(s=Promise))((function(s,n){function o(t){try{h(i.next(t))}catch(t){n(t)}}function a(t){try{h(i.throw(t))}catch(t){n(t)}}function h(t){t.done?s(t.value):r(t.value).then(o,a)}h((i=i.apply(t,e||[])).next())}))},r=this&&this.__asyncValues||function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,s=t[Symbol.asyncIterator];return s?s.call(t):(t="function"==typeof __values?__values(t):t[Symbol.iterator](),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(s){e[s]=t[s]&&function(e){return new Promise((function(i,n){r(i,n,(e=t[s](e)).done,e.value)}))}}function r(t,e,s,i){Promise.resolve(i).then((function(e){t({value:e,done:s})}),e)}};Object.defineProperty(e,"__esModule",{value:!0}),e.createFmp4Parser=void 0;const n=s(1270),o=s(4809),a=s(158),h=s(8780),c=(0,n.createTask)("fmp4-parser-processor",((t,e)=>i(void 0,void 0,void 0,(function*(){var s,i,n,o;const a=new h.FragmentParser(e,t);try{try{for(var c,d=!0,_=r(t.input);!(s=(c=yield _.next()).done);){o=c.value,d=!1;try{const t=o;yield a.addChunk(t)}finally{d=!0}}}catch(t){i={error:t}}finally{try{d||s||!(n=_.return)||(yield n.call(_))}finally{if(i)throw i.error}}yield a.flush()}catch(t){const e=t instanceof Error?t:new Error(String(t));throw a.throwOnDataAtoms(e),e}}))));function d(t){const{ContainerFormat:e}=t.registry.get(o.CoreExportNames.CoreStateAtoms).Segments;return{name:"fmp4-parser",type:t.registry.get(a.SegmentProcessingExportNames.SegmentProcessorType).Parser,container:e.MP4,process:c}}e.createFmp4Parser=d},8780:function(t,e,s){var i=this&&this.__awaiter||function(t,e,s,i){function r(t){return t instanceof s?t:new s((function(e){e(t)}))}return new(s||(s=Promise))((function(s,n){function o(t){try{h(i.next(t))}catch(t){n(t)}}function a(t){try{h(i.throw(t))}catch(t){n(t)}}function h(t){t.done?s(t.value):r(t.value).then(o,a)}h((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.FragmentParser=e.FragmentParserError=void 0;const r=s(8246),n=s(4809),o=s(158),a=s(9922),h=s(6917),c=s(1313),d=s(5099);class _ extends r.FrameworkError{constructor(t){super(t),this.name="FragmentParserError"}}e.FragmentParserError=_;class f{constructor(t,e){this.context=t,this.data=e,this.parsedBoxes=[],this.chunks=[],this.totalSegmentDuration=0,this.playbackTimeExposed=!1,this.containerFormatValidated=!1,this.fragmentStartChunkIndex=0,this.fragmentStartByteOffset=0,this.cursorChunkIndex=0,this.cursorByteOffset=0,this.dataAtoms=[]}getBoxesOfType(t){return this.parsedBoxes.filter((e=>e.type===t))}hasCompleteFragment(){const t=this.getBoxesOfType("moof"),e=this.getBoxesOfType("mdat");return t.length>=1&&e.length>=1}getRemainingBytes(t,e){let s=-t;for(let t=e;t<this.chunks.length;t++)s+=this.chunks[t].byteLength;return Math.max(0,s)}readNextBoxHeaderBytes(){const t=[];let e=this.cursorChunkIndex,s=this.cursorByteOffset;for(let i=0;i<8;i++){const i=this.chunks[e];t.push(i[s]),s++,s>=i.byteLength&&(s=0,e++)}return t}tryCreateNextFragment(){if(!this.hasCompleteFragment())return;const t=["moof","mdat"],e=[],s=()=>t.every((t=>e.some((e=>e.type===t))));do{const t=this.parsedBoxes.shift();if(!t)throw new _("Unexpectedly encountered empty box");e.push(t)}while(!s());const i=e.reduce(((t,e)=>t+e.size),0),r=new Uint8Array(i);return this.fillFragment(r),{data:r}}fillFragment(t){const e=t.byteLength;let s=0;for(;s<e;){const i=this.chunks[this.fragmentStartChunkIndex],r=i.byteLength-this.fragmentStartByteOffset,n=e-s;r>n?(t.set(i.subarray(this.fragmentStartByteOffset,this.fragmentStartByteOffset+n),s),s+=n,this.fragmentStartByteOffset+=n):(t.set(i.subarray(this.fragmentStartByteOffset),s),s+=r,this.fragmentStartByteOffset=0,this.cursorChunkIndex--,this.chunks.shift())}}advanceCursor(t){for(;t>0;){const e=this.chunks[this.cursorChunkIndex].byteLength-this.cursorByteOffset;e>t?(this.cursorByteOffset+=t,t=0):(this.cursorChunkIndex++,this.cursorByteOffset=0,t-=e)}}maybeValidateContainerFormat(t){if(!this.containerFormatValidated&&!a.BoxTypes.includes(t)){const{UnsupportedContainerFormatError:t}=this.context.registry.get(o.SegmentProcessingExportNames.SegmentProcessorErrors);throw new t("fmp4-parser")}this.containerFormatValidated=!0}tryParseNextBox(){const t=this.getRemainingBytes(this.cursorByteOffset,this.cursorChunkIndex);if(t<8)return;const e=this.readNextBoxHeaderBytes(),s=(e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3],i=String.fromCharCode(e[4],e[5],e[6],e[7]),r=s<=t;return this.maybeValidateContainerFormat(i),r&&this.advanceCursor(s),r?{size:s,type:i}:void 0}getOrCreateDataAtom(t){const{state:e}=this.context.effects,{Segments:s,DataStream:i}=this.context.registry.get(n.CoreExportNames.CoreStateAtoms),{createSegmentDataAtom:r,ContainerFormat:o}=s,{createDataStreamAtom:a}=i,h=this.dataAtoms.find((e=>e.mediaTypes.length===t.length&&e.mediaTypes.every((e=>t.includes(e)))));if(h)return h;const c=r(this.context,{mediaTypes:t,containerFormat:o.MP4,fragments:a(this.context)});return this.dataAtoms.push(c),e.dispatch(this.data.output.push,c),c}parseFragment(t){return i(this,void 0,void 0,(function*(){const{segment:e,playbackTimeExtracted:s,codecsExtracted:i}=this.data,{state:r}=this.context.effects,{isDataOrSelfInitSegment:o}=this.context.registry.get(n.CoreExportNames.CoreStateAtoms).Segments,a=c.ISOBoxer.parseBuffer(t.data.buffer),{timeScale:_,defaultSampleDuration:f,trackMap:u,codecMap:p}=yield(0,d.getOrParseMetadata)(this.context,e,a);if(o(e)){const t=(0,h.parsePlaybackTime)(a,_),e=(0,h.parseDuration)(a,_,f);e>-1&&(this.totalSegmentDuration+=e),!this.playbackTimeExposed&&t>-1&&(r.dispatch(s.trigger,t),this.playbackTimeExposed=!0)}const l=(0,h.parseMediaTypes)(a,u),m=this.getOrCreateDataAtom(l);r.dispatch(i.trigger,p),r.dispatch(m.fragments.push,t)}))}consumeRemainingBytes(){return i(this,void 0,void 0,(function*(){const t=this.getRemainingBytes(this.fragmentStartByteOffset,this.fragmentStartChunkIndex);if(t<=0)return;const e=new Uint8Array(t);this.fillFragment(e),yield this.parseFragment({data:e})}))}addChunk(t){return i(this,void 0,void 0,(function*(){let e,s;for(this.chunks.push(t);void 0!==(e=this.tryParseNextBox());)this.parsedBoxes.push(e);for(;void 0!==(s=this.tryCreateNextFragment());)yield this.parseFragment(s)}))}flush(){return i(this,void 0,void 0,(function*(){const{state:t}=this.context.effects;yield this.consumeRemainingBytes(),this.totalSegmentDuration>0&&t.dispatch(this.data.durationExtracted.trigger,this.totalSegmentDuration);for(const e of this.dataAtoms)t.dispatch(e.fragments.close);t.dispatch(this.data.output.close)}))}throwOnDataAtoms(t){const{state:e}=this.context.effects;for(const s of this.dataAtoms)e.dispatch(s.fragments.throw,t)}}e.FragmentParser=f},1313:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ISOBox=e.ISOFile=e.ISOBoxer=void 0;const s=["moov","trak","tref","mdia","minf","stbl","edts","dinf","sinf","mvex","moof","traf","mfra","udta","meco","strk","vttc","schi"];e.ISOBoxer={parseBuffer:function(t,s={}){return new e.ISOFile(t,s).parse()}};const i=8;function r(t=0){return{offset:t}}var n=function(t,e={}){this.options=Object.assign({},e),this.options.iv_size=e.iv_size||i,t&&(this._raw=new DataView(t)),this._cursor=r(),this.boxes=[]};function o(t){return 0===t.length?null:t[0]}function a(t,e){const s=e.indexOf(".");let i=[];if(-1===s)for(let s=0;s<t.length;s++)t[s].type===e&&i.push(t[s]);else{const r=e.substr(0,s),n=e.substr(s+1);for(let e=0;e<t.length;e++)t[e].type===r&&(i=i.concat(t[e].list(n)))}return i}e.ISOFile=n,e.ISOFile.prototype.fetch=function(t){const e=this.fetchAll(t,!0);return e.length?e[0]:null},e.ISOFile.prototype.fetchAll=function(t,s){const i=[];return e.ISOFile._sweep.call(this,t,i,s),i},e.ISOFile.prototype.parse=function(){for(this._cursor.offset=0,this.boxes=[];this._cursor.offset<this._raw.byteLength;){const t=e.ISOBox.parse(this);if(void 0===t.type)break;this.boxes.push(t)}return this},e.ISOFile._sweep=function(t,s,i){this.type&&this.type===t&&s.push(this);for(const r in this.boxes){if(s.length&&i)return;e.ISOFile._sweep.call(this.boxes[r],t,s,i)}},e.ISOFile.prototype.get=function(t){return o(this.list(t))},e.ISOFile.prototype.list=function(t){return a(this.boxes,t)};const h=function(){this._cursor=r()};function c(t,s){t.forEach((function(t){e.ISOBox.prototype._boxParsers[t]=s}))}e.ISOBox=h,e.ISOBox.parse=function(t){const s=new e.ISOBox;return s._offset=t._cursor.offset,s._root=t._root?t._root:t,s._raw=t._raw,s._parent=t,s._parseBox(),t._cursor.offset=s._raw.byteOffset+s._raw.byteLength,s},e.ISOBox.prototype.list=function(t){return a(this.boxes||this.entries||[],t)},e.ISOBox.prototype.get=function(t){return o(this.list(t))},e.ISOBox.prototype._readUint64=function(){const t=this._raw.getUint32(this._cursor.offset-this._raw.byteOffset),e=this._raw.getUint32(this._cursor.offset-this._raw.byteOffset+4);return t*Math.pow(2,32)+e},e.ISOBox.prototype._readInt64=function(){const t=this._raw.getInt32(this._cursor.offset-this._raw.byteOffset),e=this._raw.getInt32(this._cursor.offset-this._raw.byteOffset+4);return t*Math.pow(2,32)+e},e.ISOBox.prototype._readInt=function(t){let e=null;switch(t){case 8:e=this._raw.getInt8(this._cursor.offset-this._raw.byteOffset);break;case 16:e=this._raw.getInt16(this._cursor.offset-this._raw.byteOffset);break;case 32:e=this._raw.getInt32(this._cursor.offset-this._raw.byteOffset);break;case 64:e=this._readInt64()}return this._cursor.offset+=t>>3,e},e.ISOBox.prototype._readUint=function(t){let e=null;switch(t){case 8:e=this._raw.getUint8(this._cursor.offset-this._raw.byteOffset);break;case 16:e=this._raw.getUint16(this._cursor.offset-this._raw.byteOffset);break;case 24:e=(this._raw.getUint16(this._cursor.offset-this._raw.byteOffset)<<8)+this._raw.getUint8(this._cursor.offset-this._raw.byteOffset+2);break;case 32:e=this._raw.getUint32(this._cursor.offset-this._raw.byteOffset);break;case 64:e=this._readUint64()}return this._cursor.offset+=t>>3,e},e.ISOBox.prototype._readUintArray=function(t,e){const s=new Array(e);for(let i=0;i<e;++i)s[i]=this._readUint(t);return s},e.ISOBox.prototype._readFP=function(t){return this._readInt(2*t)/Math.pow(2,t)},e.ISOBox.prototype._readString=function(t){let e="";for(let s=0;s<t;s++){const t=this._readUint(8);e+=String.fromCharCode(t)}return e},e.ISOBox.prototype._readHex=function(t){for(var e=[],s=0;s<t;s++){const t=this._readUint(8);e.push((t>>>4).toString(16)),e.push((15&t).toString(16))}return e.join("")},e.ISOBox.prototype._readUUID=function(){return this._readUintArray(8,16)},e.ISOBox.prototype._readTerminatedString=function(){let t="";for(;;){const e=this._readUint(8);if(0==e)break;t+=String.fromCharCode(e)}return t},e.ISOBox.prototype._readTemplate=function(t){return this._readUint(t/2)+this._readUint(t/2)/Math.pow(2,t/2)},e.ISOBox.prototype._parseBox=function(){if(this._cursor.offset=this._offset,this._offset+8>this._raw.buffer.byteLength)this._root._incomplete=!0;else{switch(this.size=this._readUint(32),this.type=this._readString(4),1===this.size&&(this.largesize=this._readUint(64)),"uuid"===this.type&&(this.usertype=this._readUUID()),this.size){case 0:this._raw=new DataView(this._raw.buffer,this._offset,this._raw.byteLength-this._cursor.offset);break;case 1:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.largesize);break;default:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.size)}!this._incomplete&&this._boxParsers[this.type]&&this._boxParsers[this.type].call(this)}},e.ISOBox.prototype._parseFullBox=function(){this.version=this._readUint(8),this.flags=this._readUint(24)},e.ISOBox.prototype._createDataView=function(){return new DataView(this._raw.buffer,this._cursor.offset,this._raw.byteLength-(this._cursor.offset-this._offset))},e.ISOBox.prototype._boxParsers={},c(s,(function(){for(this.boxes=[];this._cursor.offset-this._raw.byteOffset<this._raw.byteLength;)this.boxes.push(e.ISOBox.parse(this))})),e.ISOBox.prototype._boxParsers.elst=function(){this._parseFullBox(),this.entry_count=this._readUint(32),this.entries=[];for(let t=1;t<=this.entry_count;t++){const t=new e.ISOBox;1===this.version?(t.segment_duration=this._readUint(64),t.media_time=this._readInt(64)):(t.segment_duration=this._readUint(32),t.media_time=this._readInt(32)),t.media_rate_integer=this._readInt(16),t.media_rate_fraction=this._readInt(16),this.entries.push(t)}},e.ISOBox.prototype._boxParsers.emsg=function(){this._parseFullBox(),0===this.version?(this.scheme_id_uri=this._readTerminatedString(),this.value=this._readTerminatedString(),this.timescale=this._readUint(32),this.presentation_time_delta=this._readUint(32),this.event_duration=this._readUint(32),this.id=this._readUint(32)):(this.timescale=this._readUint(32),this.presentation_time=this._readUint(64),this.event_duration=this._readUint(32),this.id=this._readUint(32),this.scheme_id_uri=this._readTerminatedString(),this.value=this._readTerminatedString()),this.message_data=this._createDataView()},c(["free","mdat"],(function(){this.data=this._createDataView()})),c(["ftyp","styp"],(function(){for(this.major_brand=this._readString(4),this.minor_versions=this._readUint(32),this.compatible_brands=[];this._cursor.offset-this._raw.byteOffset<this._raw.byteLength;)this.compatible_brands.push(this._readString(4))})),e.ISOBox.prototype._boxParsers.hdlr=function(){this._parseFullBox(),this.pre_defined=this._readUint(32),this.handler_type=this._readString(4),this.reserved=[this._readUint(32),this._readUint(32),this._readUint(32)],this.name=this._readTerminatedString()},e.ISOBox.prototype._boxParsers.mdhd=function(){this._parseFullBox(),1==this.version?(this.creation_time=this._readUint(64),this.modification_time=this._readUint(64),this.timescale=this._readUint(32),this.duration=this._readUint(64)):(this.creation_time=this._readUint(32),this.modification_time=this._readUint(32),this.timescale=this._readUint(32),this.duration=this._readUint(32));const t=this._readUint(16);this.pad=t>>15,this.language=String.fromCharCode(96+(t>>10&31),96+(t>>5&31),96+(31&t)),this.pre_defined=this._readUint(16)},e.ISOBox.prototype._boxParsers.mfhd=function(){this._parseFullBox(),this.sequence_number=this._readUint(32)},e.ISOBox.prototype._boxParsers.mvhd=function(){this._parseFullBox(),1===this.version?(this.creation_time=this._readUint(64),this.modification_time=this._readUint(64),this.timescale=this._readUint(32),this.duration=this._readUint(64)):(this.creation_time=this._readUint(32),this.modification_time=this._readUint(32),this.timescale=this._readUint(32),this.duration=this._readUint(32)),this.rate=this._readTemplate(32),this.volume=this._readTemplate(16),this.reserved1=this._readUint(16),this.reserved2=[this._readUint(32),this._readUint(32)],this.matrix=[];for(var t=0;t<9;t++)this.matrix.push(this._readTemplate(32));for(this.pre_defined=[],t=0;t<6;t++)this.pre_defined.push(this._readUint(32));this.next_track_ID=this._readUint(32)},e.ISOBox.prototype._boxParsers.sidx=function(){this._parseFullBox(),this.reference_ID=this._readUint(32),this.timescale=this._readUint(32),0===this.version?(this.earliest_presentation_time=this._readUint(32),this.first_offset=this._readUint(32)):(this.earliest_presentation_time=this._readUint(64),this.first_offset=this._readUint(64)),this.reserved=this._readUint(16),this.reference_count=this._readUint(16),this.references=[];for(let t=0;t<this.reference_count;t++){const t={},e=this._readUint(32);t.reference_type=e>>31&1,t.referenced_size=2147483647&e,t.subsegment_duration=this._readUint(32);const s=this._readUint(32);t.starts_with_SAP=s>>31&1,t.SAP_type=s>>28&7,t.SAP_delta_time=268435455&s,this.references.push(t)}},e.ISOBox.prototype._boxParsers.ssix=function(){this._parseFullBox(),this.subsegment_count=this._readUint(32),this.subsegments=[];for(let t=0;t<this.subsegment_count;t++){const t={};t.ranges_count=this._readUint(32),t.ranges=[];for(let e=0;e<t.ranges_count;e++){const e={};e.level=this._readUint(8),e.range_size=this._readUint(24),t.ranges.push(e)}this.subsegments.push(t)}},e.ISOBox.prototype._boxParsers.tfdt=function(){this._parseFullBox(),1===this.version?this.baseMediaDecodeTime=this._readUint(64):this.baseMediaDecodeTime=this._readUint(32)},e.ISOBox.prototype._boxParsers.tfhd=function(){this._parseFullBox(),this.track_ID=this._readUint(32),1&this.flags?(this.base_data_offset_present=!0,this.base_data_offset=this._readUint(64)):131072&this.flags&&(this.default_base_is_moof=!0),2&this.flags&&(this.sample_description_offset=this._readUint(32)),8&this.flags&&(this.default_sample_duration=this._readUint(32)),16&this.flags&&(this.default_sample_size=this._readUint(32)),32&this.flags&&(this.default_sample_flags=this._readUint(32))},e.ISOBox.prototype._boxParsers.tkhd=function(){this._parseFullBox(),1===this.version?(this.creation_time=this._readUint(64),this.modification_time=this._readUint(64),this.track_ID=this._readUint(32),this.reserved1=this._readUint(32),this.duration=this._readUint(64)):(this.creation_time=this._readUint(32),this.modification_time=this._readUint(32),this.track_ID=this._readUint(32),this.reserved1=this._readUint(32),this.duration=this._readUint(32)),this.reserved2=[this._readUint(32),this._readUint(32)],this.layer=this._readUint(16),this.alternate_group=this._readUint(16),this.volume=this._readTemplate(16),this.reserved3=this._readUint(16),this.matrix=[];for(let t=0;t<9;t++)this.matrix.push(this._readTemplate(32));this.width=this._readTemplate(32),this.height=this._readTemplate(32)},e.ISOBox.prototype._boxParsers.trun=function(){this._parseFullBox(),this.sample_count=this._readUint(32),1&this.flags&&(this.data_offset_present=!0,this.data_offset=this._readInt(32)),4&this.flags&&(this.first_sample_flags=this._readUint(32)),this.samples=[];for(let t=0;t<this.sample_count;t++){const t={};256&this.flags&&(t.sample_duration=this._readUint(32)),512&this.flags&&(t.sample_size=this._readUint(32)),1024&this.flags&&(t.sample_flags=this._readUint(32)),2048&this.flags&&(0==this.version?t.sample_composition_time_offset=this._readUint(32):t.sample_composition_time_offset=this._readInt(32)),this.samples.push(t)}},e.ISOBox.prototype._boxParsers.trex=function(){this._parseFullBox(),this.track_ID=this._readUint(32),this.default_sample_description_index=this._readUint(32),this.default_sample_duration=this._readUint(32),this.default_sample_size=this._readUint(32),this.default_sample_flags=this._readUint(32)},e.ISOBox.prototype._boxParsers.stsd=function(){for(this._parseFullBox(),this.entry_count=this._readUint(32),this.entries=[];this._cursor.offset-this._raw.byteOffset<this._raw.byteLength;)this.entries.push(e.ISOBox.parse(this))},e.ISOBox.prototype._boxParsers.encv=function(){for(this._readHex(6),this.data_reference_index=this._readUint(16),this._readUint(16),this._readUint(16),this._readUint(32),this._readUint(32),this._readUint(32),this.width=this._readUint(16),this.height=this._readUint(16),this.horizresolution=this._readTemplate(32),this.vertresolution=this._readTemplate(32),this._readUint(32),this.frame_count=this._readUint(16),this._readUint(8),this.compressor_name=this._readString(4),this.depth=this._readUint(16),this._readUint(16),this._readHex(27),this.boxes=[];this._cursor.offset-this._raw.byteOffset<this._raw.byteLength;)this.boxes.push(e.ISOBox.parse(this))},c(["enca","mp4a"],(function(){for(this._readHex(6),this.data_reference_index=this._readUint(16),this._readUint(32),this._readUint(32),this.channel_count=this._readUint(16),this.sample_size=this._readUint(16),this._readUint(16),this._readUint(16),this.sample_rate=this._readUint(32)>>>16,this.boxes=[];this._cursor.offset-this._raw.byteOffset<this._raw.byteLength;)this.boxes.push(e.ISOBox.parse(this))}));function d(t,e){return t._cursor.offset-t._raw.byteOffset+e<=t.size}function _(t){if(!d(t,6))return{bytes_of_clear_data:0,bytes_of_encrypted_data:0};return{bytes_of_clear_data:t._readUint(16),bytes_of_encrypted_data:t._readUint(32)}}function f(t,e){return d(t,2)?(e.subsample_count=t._readUint(16),e.subsamples=Array.apply(null,Array(e.subsample_count)).map((e=>_(t))),e):Object.assign(Object.assign({},e),{subsample_count:0,subsamples:[]})}function u(t){if(!d(t,t._root.options.iv_size))return void(t.samples=[]);let e={iv:t._readHex(t._root.options.iv_size)};return t.flags&&(e=f(t,e)),e}c(["avc1","hvc1","hev1"],(function(){this._readUint(32),this._readUint(16),this.data_reference_index=this._readUint(16),this.version=this._readUint(16),this.revision_level=this._readUint(16),this.vendor=this._readUint(32),this.temporal_quality=this._readUint(32),this.spatial_quality=this._readUint(32),this.width=this._readUint(16),this.height=this._readUint(16),this.horizontal_resolution=this._readTemplate(32),this.vertical_resolution=this._readTemplate(32),this.data_size=this._readUint(32),this.frame_count=this._readUint(16);const t=this._readUint(8);this.compressor_name="";for(let e=0;e<31;e++){const s=this._readUint(8);e<t&&(this.compressor_name+=String.fromCharCode(s))}for(this.depth=this._readUint(16),this._readInt(16),this.boxes=[];this._cursor.offset-this._raw.byteOffset<this._raw.byteLength;)this.boxes.push(e.ISOBox.parse(this))})),e.ISOBox.prototype._boxParsers.avcC=function(){this.configuration_version=this._readUint(8),this.avc_profile_indication=this._readUint(8),this.profile_compatibility=this._readUint(8),this.avc_level_indication=this._readUint(8);const t=this._readUint(8);this.complete_representation=t>>>7&1,this.length_size_minus_one=3&t,this.num_sps=31&this._readUint(8),this.sps=[];for(let t=0;t<this.num_sps;++t)this.sps.push(this._readUintArray(8,this._readUint(16)));this.num_pps=31&this._readUint(8),this.pps=[];for(let t=0;t<this.num_pps;++t)this.pps.push(this._readUintArray(8,this._readUint(16)))},e.ISOBox.prototype._boxParsers.hvcC=function(){let t;this.configurationVersion=this._readUint(8),t=this._readUint(8),this.general_profile_space=t>>>6,this.general_tier_flag=t>>>5&1,this.general_profile_idc=31&t,this.general_profile_compatibility_flags=this._readUint(32),this.general_constraint_indicator_flags_bytes=[];for(let t=0;t<6;t++)this.general_constraint_indicator_flags_bytes[t]=this._readUint(8);this.general_level_idc=this._readUint(8),this.min_spatial_segmentation_idc=4095&this._readUint(16),this.parallelismType=3&this._readUint(8),this.chroma_format_idc=3&this._readUint(8),this.bit_depth_luma_minus8=7&this._readUint(8),this.bit_depth_chroma_minus8=7&this._readUint(8),this.avgFrameRate=this._readUint(16),t=this._readUint(8),this.constantFrameRate=t>>>6,this.numTemporalLayers=t>>>3&7,this.temporalIdNested=t>>>2&1,this.lengthSizeMinusOne=3&t,this.numOfArrays=this._readUint(8)},e.ISOBox.prototype._boxParsers.esds=function(){this._parseFullBox(),this._readUint(16),this.esId=this._readUint(16),this.streamPriority=31&this._readUint(8),this._readUint(16),this.decoderConfig={},this.decoderConfig.objectProfileIndication=this._readUint(8),this.decoderConfig.streamType=this._readUint(8)>>>2&63,this.decoderConfig.bufferSize=this._readUint(24),this.decoderConfig.maxBitrate=this._readUint(32),this.decoderConfig.avgBitrate=this._readUint(32),this.decoderConfig.decoderConfigDescriptor={},this.decoderConfig.decoderConfigDescriptor.tag=this._readUint(8),this.decoderConfig.decoderConfigDescriptor.length=this._readUint(8);const t=this._readUint(8),e=this._readUint(8),s=this.decoderConfig.decoderConfigDescriptor;s.audioObjectType=t>>>3&31,s.samplingFrequencyIndex=(7&t)<<1|e>>>7&1,s.channelConfiguration=e>>>3&15},e.ISOBox.prototype._boxParsers.tenc=function(){this._parseFullBox(),this.default_is_encrypted=1===this._readUint(24),this.default_iv_size=this._readUint(8),this.default_kid=this._readHex(16)},e.ISOBox.prototype._boxParsers.senc=function(){this._parseFullBox(),this.sample_count=this._readUint(32),this.samples=Array.apply(null,Array(this.sample_count)).map((t=>u(this)))},e.ISOBox.prototype._boxParsers.frma=function(){this.codingname=this._readString(4)},e.ISOBox.prototype._boxParsers.schm=function(){this._parseFullBox(),this.scheme_type=this._readString(4),this.scheme_version=this._readUint(32),1&this.flags&&(this.scheme_uri=this._readUint(8))},e.ISOBox.prototype._boxParsers.saiz=function(){if(this._parseFullBox(),1&this.flags&&(this.aux_info_type=this._readUint(32),this.aux_info_type_parameter=this._readUint(32)),this.default_sample_info_size=this._readUint(8),this.sample_count=this._readUint(32),0===this.default_sample_info_size){this.sample_info_size=[];for(let t=0;t<this.sample_count;++t)this.sample_info_size.push(this._readUint(8))}},e.ISOBox.prototype._boxParsers.pssh=function(){if(this._parseFullBox(),this.system_id=this._readUUID(),this.version>0){this.kid_count=this._readUint(32),this.kids=[];for(let t=0;t<this.kid_count;++t)this.kids.push(this._readString(16))}this.data_size=this._readUint(32),this.data=new DataView(this._raw.buffer,this._cursor.offset,this.data_size)},e.ISOBox.prototype._boxParsers.prft=function(){this._parseFullBox(),this.reference_track_ID=this._readUint(32),this.ntp_timestamp_seconds=this._readUint(32),this.ntp_timestamp_seconds_fraction=this._readUint(32),0===this.version?this.media_time=this._readUint(32):this.media_time=this._readUint(64)}},5099:function(t,e,s){var i=this&&this.__awaiter||function(t,e,s,i){function r(t){return t instanceof s?t:new s((function(e){e(t)}))}return new(s||(s=Promise))((function(s,n){function o(t){try{h(i.next(t))}catch(t){n(t)}}function a(t){try{h(i.throw(t))}catch(t){n(t)}}function h(t){t.done?s(t.value):r(t.value).then(o,a)}h((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.getOrParseMetadata=void 0;const r=s(1270),n=s(4809),o=s(3131),a=s(8780),h="fmp4-segment-metadata";function c(t){return void 0!==t&&"object"==typeof t}function d(t){return c(t)&&"timeScale"in t&&"defaultSampleDuration"in t}function _(t,e){return i(this,void 0,void 0,(function*(){const{state:s,abortable:i}=t.effects;return i(((i,n)=>{const o=s.subscribe(t,e.metadata,(0,r.createTask)("init-segment-metadata-subscriber",(t=>{const e=t.get(h);if(void 0!==e){if(!d(e)){const t=new a.FragmentParserError("Encountered malformed init segment metadata");return o(t),void n(t)}i(e),o()}})),(t=>t instanceof a.FragmentParserError))}))}))}function f(t,e){return i(this,void 0,void 0,(function*(){const s=e.metadata.get(h);return d(s)?s:yield _(t,e)}))}function u(t,e){var s,r,n;return i(this,void 0,void 0,(function*(){const i=e.get("moov");if(void 0===i)throw new a.FragmentParserError("Could not extract moov box");const h=i.get("mvex.trex"),c=null!==(r=null===(s=i.get("trak.mdia.mdhd"))||void 0===s?void 0:s.timescale)&&void 0!==r?r:1,d=null!==(n=null==h?void 0:h.default_sample_duration)&&void 0!==n?n:0,{codecMap:_,trackMap:f}=(0,o.parseCodecFromMoov)(t,i);return{timeScale:c,defaultSampleDuration:d,codecMap:_,trackMap:f}}))}function p(t,e,s){return i(this,void 0,void 0,(function*(){const{isDataSegment:i}=t.registry.get(n.CoreExportNames.CoreStateAtoms).Segments;if(i(e))return yield f(t,e.initSegment);{const{state:i}=t.effects,r=yield u(t,s);return i.dispatch(e.metadata.add,h,r),r}}))}e.getOrParseMetadata=p},8246:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FrameworkError=void 0;class s extends Error{constructor(t){super(t),this.name="FrameworkError"}}e.FrameworkError=s},4809:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CoreExportNames=void 0,function(t){t.Utils="utils",t.Constants="constants",t.CoreEffects="core-effects",t.CoreStateAtoms="core-state-atoms"}(e.CoreExportNames||(e.CoreExportNames={}))},158:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SegmentProcessorType=e.SegmentProcessingExportNames=void 0,function(t){t.SegmentProcessingComponent="segment-processing-component",t.SegmentProcessorType="segment-processor-type",t.SegmentProcessorErrors="segment-processor-errors"}(e.SegmentProcessingExportNames||(e.SegmentProcessingExportNames={})),function(t){t.Decryptor="decryptor",t.Parser="parser",t.Preprocessor="preprocessor",t.Transmuxer="transmuxer",t.Postprocessor="postprocessor"}(e.SegmentProcessorType||(e.SegmentProcessorType={}))},7269:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SourceExportNames=void 0,function(t){t.CreateSourceStateAtom="create-source-state-atom",t.CreateSourceReference="create-source-reference",t.SourceReferences="source-references",t.SourceState="source-state-atom"}(e.SourceExportNames||(e.SourceExportNames={}))}},e={};function s(i){var r=e[i];if(void 0!==r)return r.exports;var n=e[i]={exports:{}};return t[i].call(n.exports,n,n.exports,s),n.exports}return s(4173)})()));
@@ -5,6 +5,6 @@
5
5
  * source code is subject to the terms and conditions of the accompanying
6
6
  * license agreement.
7
7
  *
8
- * Bitmovin Player X Version 10.1.3
8
+ * Bitmovin Player X Version 10.1.4
9
9
  *******************************************************************************/
10
10
  !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["container-ts"]=t():(e.bitmovin=e.bitmovin||{},e.bitmovin.playerx=e.bitmovin.playerx||{},e.bitmovin.playerx["container-ts"]=t())}(self,(()=>(()=>{"use strict";var e={7085:(e,t)=>{function r(e,t,r){const a=t;return a._name=e,{onAdd:a,dependencies:r}}Object.defineProperty(t,"__esModule",{value:!0}),t.createPackage=void 0,t.createPackage=r},1270:(e,t)=>{function r(e,t){const r=t;return r._name=e,r}function a(e){return(...t)=>{const[a,s]=e(...t);return r(a,s)}}function s(e){var t;return null!==(t=e._name)&&void 0!==t?t:e.name}Object.defineProperty(t,"__esModule",{value:!0}),t.getTaskName=t.createTaskClosure=t.createTask=void 0,t.createTask=r,t.createTaskClosure=a,t.getTaskName=s},7445:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ContainerTsPackage=void 0;const a=r(7085),s=r(4809),n=r(158),o=r(7269),i=r(3974);t.ContainerTsPackage=(0,a.createPackage)("container-ts-package",((e,t)=>{const{StateEffectFactory:r,EventListenerEffectFactory:a}=t.registry.get(s.CoreExportNames.CoreEffects),o=t.using(r).using(a);o.registry.get(n.SegmentProcessingExportNames.SegmentProcessingComponent).addProcessor((0,i.createTsParser)(o))}),[o.SourceExportNames.SourceState,s.CoreExportNames.CoreEffects,s.CoreExportNames.CoreStateAtoms,n.SegmentProcessingExportNames.SegmentProcessorType,n.SegmentProcessingExportNames.SegmentProcessorErrors,n.SegmentProcessingExportNames.SegmentProcessingComponent]),t.default=t.ContainerTsPackage},5681:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseCodecString=void 0;const a=r(9874);function s(e,t){return e.toString(16).padStart(t,"0")}function n(e){switch(e){case 1:return"mp2a.66";case 2:return"mp2a.67";case 3:return"mp2a.68";default:throw new Error(`Cannot generate codec string for ISO/IEC 13818-7 codec with profile ${e}`)}}function o(e,t,r){return`avc1.${s(e,2)}${s(t,2)}${s(r,2)}`}function i(e,t){switch(e){case a.PesStreamType.ISO_IEC_13818_7_Audio_with_ADTS:{const{profile:e}=t;return n(e)}case a.PesStreamType.AVC_video_stream:{const{profile_idc:e,constraints:r,level_idc:a}=t;return o(e,r,a)}default:throw new Error(`Cannot create codec string for stream type ${e}`)}}t.parseCodecString=i},9874:(e,t)=>{var r;function a(e){return e>=39&&e<=126}function s(e){return e>=128&&e<=255}Object.defineProperty(t,"__esModule",{value:!0}),t.TransportScramblingControl=t.AdaptationFieldControl=t.isUserPrivatePes=t.isH2220ReservedPes=t.TextStreamTypes=t.StreamTypeCodecMap=t.AudioStreamTypes=t.VideoStreamTypes=t.PesStreamType=t.ProgramAssociationTableId=t.EmptyArray=t.TransportStreamPacketLength=void 0,t.TransportStreamPacketLength=188,t.EmptyArray=new Uint8Array(0),t.ProgramAssociationTableId=0,function(e){e[e.ITU_T___ISO_IEC_Reserved=0]="ITU_T___ISO_IEC_Reserved",e[e.ISO_IEC_11172_2_Video=1]="ISO_IEC_11172_2_Video",e[e.Rec__ITU_T_H_262_video_stream=2]="Rec__ITU_T_H_262_video_stream",e[e.ISO_IEC_11172_3_Audio=3]="ISO_IEC_11172_3_Audio",e[e.ISO_IEC_13818_3_Audio=4]="ISO_IEC_13818_3_Audio",e[e.Rec__ITU_T_H_222_0_private_sections=5]="Rec__ITU_T_H_222_0_private_sections",e[e.Rec__ITU_T_H_222_0_private_data=6]="Rec__ITU_T_H_222_0_private_data",e[e.ISO_IEC_13522_MHEG=7]="ISO_IEC_13522_MHEG",e[e.Rec__ITU_T_H_222_0_Annex_A_DSM_CC=8]="Rec__ITU_T_H_222_0_Annex_A_DSM_CC",e[e.Rec__ITU_T_H_222_1=9]="Rec__ITU_T_H_222_1",e[e.ISO_IEC_13818_6_type_A=10]="ISO_IEC_13818_6_type_A",e[e.ISO_IEC_13818_6_type_B=11]="ISO_IEC_13818_6_type_B",e[e.ISO_IEC_13818_6_type_C=12]="ISO_IEC_13818_6_type_C",e[e.ISO_IEC_13818_6_type_D=13]="ISO_IEC_13818_6_type_D",e[e.Rec__ITU_T_H_222_0_auxiliary=14]="Rec__ITU_T_H_222_0_auxiliary",e[e.ISO_IEC_13818_7_Audio_with_ADTS=15]="ISO_IEC_13818_7_Audio_with_ADTS",e[e.ISO_IEC_14496_2_Visual=16]="ISO_IEC_14496_2_Visual",e[e.ISO_IEC_14496_3_Audio_with_the_LATM=17]="ISO_IEC_14496_3_Audio_with_the_LATM",e[e.ISO_IEC_14496_1_SL_packetized_stream___PES_packets=18]="ISO_IEC_14496_1_SL_packetized_stream___PES_packets",e[e.ISO_IEC_14496_1_SL_packetized_stream___ISO_IEC_14496_sections=19]="ISO_IEC_14496_1_SL_packetized_stream___ISO_IEC_14496_sections",e[e.ISO_IEC_13818_6_Synchronized_Download_Protocol=20]="ISO_IEC_13818_6_Synchronized_Download_Protocol",e[e.Metadata_in_PES_packets=21]="Metadata_in_PES_packets",e[e.Metadata_in_metadata_sections=22]="Metadata_in_metadata_sections",e[e.Metadata_in_Data_Carousel=23]="Metadata_in_Data_Carousel",e[e.Metadata_in_Object_Carousel=24]="Metadata_in_Object_Carousel",e[e.Metadata_in_Synchronized_Download_Protocol=25]="Metadata_in_Synchronized_Download_Protocol",e[e.MPEG_2_IPMP_stream=26]="MPEG_2_IPMP_stream",e[e.AVC_video_stream=27]="AVC_video_stream",e[e.ISO_IEC_14496_3_Audio_without_transport=28]="ISO_IEC_14496_3_Audio_without_transport",e[e.ISO_IEC_14496_17_Text=29]="ISO_IEC_14496_17_Text",e[e.Auxiliary_video_stream=30]="Auxiliary_video_stream",e[e.SVC_AVC_video_sub_bitstream=31]="SVC_AVC_video_sub_bitstream",e[e.MVC_AVC_video_sub_bitstream=32]="MVC_AVC_video_sub_bitstream",e[e.ITU_T_T_800_Video_stream=33]="ITU_T_T_800_Video_stream",e[e.Additional_H_262_view=34]="Additional_H_262_view",e[e.Additional_H_264_view=35]="Additional_H_264_view",e[e.HEVC_video_stream=36]="HEVC_video_stream",e[e.HEVC_temporal_video_subset__ITU_T_H_265_Annex_A=37]="HEVC_temporal_video_subset__ITU_T_H_265_Annex_A",e[e.MVCD_AVC_sub_bitstream__ITU_T_H_264_Annex_I=38]="MVCD_AVC_sub_bitstream__ITU_T_H_264_Annex_I",e[e.IPMP_stream=127]="IPMP_stream"}(r=t.PesStreamType||(t.PesStreamType={})),t.VideoStreamTypes=[r.ISO_IEC_11172_2_Video,r.Rec__ITU_T_H_262_video_stream,r.AVC_video_stream,r.Auxiliary_video_stream,r.SVC_AVC_video_sub_bitstream,r.MVC_AVC_video_sub_bitstream,r.ITU_T_T_800_Video_stream,r.Additional_H_262_view,r.Additional_H_264_view,r.HEVC_video_stream,r.HEVC_temporal_video_subset__ITU_T_H_265_Annex_A,r.MVCD_AVC_sub_bitstream__ITU_T_H_264_Annex_I],t.AudioStreamTypes=[r.ISO_IEC_11172_3_Audio,r.ISO_IEC_13818_3_Audio,r.ISO_IEC_13818_7_Audio_with_ADTS,r.ISO_IEC_14496_3_Audio_with_the_LATM,r.ISO_IEC_14496_3_Audio_without_transport],t.StreamTypeCodecMap={[r.ISO_IEC_11172_2_Video]:"mp1v",[r.Rec__ITU_T_H_262_video_stream]:"mp2v",[r.ISO_IEC_11172_3_Audio]:"mp1a",[r.ISO_IEC_13818_3_Audio]:"mp2a",[r.ISO_IEC_13818_7_Audio_with_ADTS]:"mp2a",[r.ISO_IEC_14496_2_Visual]:"mp4v",[r.ISO_IEC_14496_3_Audio_with_the_LATM]:"mp4a",[r.AVC_video_stream]:"avc1",[r.ISO_IEC_14496_3_Audio_without_transport]:"mp4a",[r.ISO_IEC_14496_17_Text]:"tx3g",[r.SVC_AVC_video_sub_bitstream]:"svc1",[r.MVC_AVC_video_sub_bitstream]:"mvc1",[r.ITU_T_T_800_Video_stream]:"mjp2"},t.TextStreamTypes=[r.ISO_IEC_14496_17_Text],t.isH2220ReservedPes=a,t.isUserPrivatePes=s,function(e){e[e.Reserved=0]="Reserved",e[e.PayloadOnly=1]="PayloadOnly",e[e.AdaptationOnly=2]="AdaptationOnly",e[e.AdaptationAndPayload=3]="AdaptationAndPayload"}(t.AdaptationFieldControl||(t.AdaptationFieldControl={})),function(e){e[e.NotScrambled=0]="NotScrambled",e[e.Reserved=1]="Reserved",e[e.ScrambledWithEvenKey=2]="ScrambledWithEvenKey",e[e.ScrambledWithOddKey=3]="ScrambledWithOddKey"}(t.TransportScramblingControl||(t.TransportScramblingControl={}))},3974:function(e,t,r){var a=this&&this.__awaiter||function(e,t,r,a){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function o(e){try{c(a.next(e))}catch(e){n(e)}}function i(e){try{c(a.throw(e))}catch(e){n(e)}}function c(e){e.done?r(e.value):s(e.value).then(o,i)}c((a=a.apply(e,t||[])).next())}))},s=this&&this.__asyncValues||function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},a("next"),a("throw"),a("return"),t[Symbol.asyncIterator]=function(){return this},t);function a(r){t[r]=e[r]&&function(t){return new Promise((function(a,n){s(a,n,(t=e[r](t)).done,t.value)}))}}function s(e,t,r,a){Promise.resolve(a).then((function(t){e({value:t,done:r})}),t)}};Object.defineProperty(t,"__esModule",{value:!0}),t.createTsParser=void 0;const n=r(1270),o=r(4809),i=r(158),c=r(2929),_=r(6275);function d(e){const t=[];for(const[r,a]of e){if(a.length<2)continue;const e=[];a.sort(((e,t)=>e.hasPts&&t.hasPts?e.pts-t.pts:0));for(let t=0;t<=a.length-2;t++){const r=a[t],s=a[t+1];r.hasPts&&s.hasPts&&e.push(s.pts-r.pts)}const r=e.reduce(((e,t)=>e+t),0),s=Math.round(r/e.length),n=a[0],o=a[a.length-1];if(!n.hasPts||!o.hasPts)throw new Error("Frames unexpectedly don't have a PTS");const i=(o.pts+s-n.pts)/9e4;t.push(i)}return Math.max(...t)}const u=(0,n.createTask)("ts-parser-processor",((e,t)=>a(void 0,void 0,void 0,(function*(){var r,a,n,i;const{state:u}=t.effects,{merge:p}=t.registry.get(o.CoreExportNames.Utils).TypedArrays,{Segments:m,DataStream:{createDataStreamAtom:l}}=t.registry.get(o.CoreExportNames.CoreStateAtoms),{createSegmentDataAtom:f,ContainerFormat:I}=m,P=[],y=(0,_.createPacketParserData)(P,e);try{for(var S,C=!0,k=s(e.input);!(r=(S=yield k.next()).done);){i=S.value,C=!1;try{const e=i;P.push(e),(0,c.tryParsePackets)(t,y)}finally{C=!0}}}catch(e){a={error:e}}finally{try{C||r||!(n=k.return)||(yield n.call(k))}finally{if(a)throw a.error}}const h=Array.from(y.containedMediaTypes.values()),T=d(y.frameTimings),v=l(t),E=f(t,{mediaTypes:h,fragments:v,containerFormat:I.TS});isFinite(T)&&u.dispatch(e.durationExtracted.trigger,T),u.dispatch(v.push,{data:p(P)}),u.dispatch(v.close),u.dispatch(e.output.push,E),u.dispatch(e.output.close)}))));function p(e){const{ContainerFormat:t}=e.registry.get(o.CoreExportNames.CoreStateAtoms).Segments;return{name:"ts-parser",type:e.registry.get(i.SegmentProcessingExportNames.SegmentProcessorType).Parser,container:t.TS,process:u}}t.createTsParser=p},9096:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createPacketParser=void 0;const r=(e,t)=>({match:e,parse:t});t.createPacketParser=r},9434:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IdentityPacketParser=void 0;const a=r(9096);t.IdentityPacketParser=(0,a.createPacketParser)((()=>!0),(e=>e))},2929:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tryParsePackets=t.PacketParsingError=void 0;const a=r(4809),s=r(158),n=r(9874),o=r(3143),i=r(9779),c=r(212),_=r(237),d=r(5278),u=r(9434),p=r(8656),m=r(2461),l=r(973);class f extends Error{constructor(){super(...arguments),this.name="PacketParsingError"}}t.PacketParsingError=f;const I=[p.PatPacketParser,l.PmtPacketParser,m.PesPacketParser,u.IdentityPacketParser];function P(e){return e.adaptationFieldControl===n.AdaptationFieldControl.AdaptationOnly}function y(e){return[n.AdaptationFieldControl.AdaptationAndPayload,n.AdaptationFieldControl.AdaptationOnly].includes(e.adaptationFieldControl)}function S(e,t){if(P(e))return e;if(y(e)){const r=(0,d.readUint8)(t.chunks,[e.cursor]);(0,d.skip)(r,d.ReaderUnit.Bytes,t.chunks,[e.cursor])}const r=I.find((r=>r.match(t,e)));if(void 0===r)throw new Error(`Could not resolve parser for packet with ID ${e.packetIdentifier}`);return r.parse(e,t.chunks)}function C(e,t){const{MediaType:r}=e.registry.get(a.CoreExportNames.Constants);return n.VideoStreamTypes.includes(t)?r.Video:n.AudioStreamTypes.includes(t)?r.Audio:n.TextStreamTypes.includes(t)?r.Subtitle:r.Unknown}function k(e,t){var r;const{state:a}=e.effects,{codecMap:s,pesPacketIds:n,codecsExtracted:o,pesStreamTypes:i,containedMediaTypes:c}=t;if(s.size!==n.size||0===n.size||void 0!==o.value)return;const _={};for(const[t,a]of s){const s=i.get(t);if(void 0===s)throw new Error(`stream_type is unexpectedly undefined for PES %${t}`);const n=C(e,s),o=null!==(r=_[n])&&void 0!==r?r:[];c.add(n),o.push(a),_[n]=o}a.dispatch(o.trigger,_)}function h(e,t){return{transportErrorIndicator:(8388608&e)>0,payloadUnitStartIndicator:(4194304&e)>0,transportPriority:(2097152&e)>0,packetIdentifier:(2096896&e)>>8,scramblingControl:(192&e)>>6,adaptationFieldControl:(48&e)>>4,continuityCounter:15&e,adaptation:n.EmptyArray,cursor:t}}function T(e,t){if(t>>24!=71){const{UnsupportedContainerFormatError:t}=e.registry.get(s.SegmentProcessingExportNames.SegmentProcessorErrors);throw new t("ts-parser")}}function v(e,t){const{chunkCursor:r,parsedPackets:a,chunks:s}=t;for(;(0,c.getRemainingBytes)(s,r)>=n.TransportStreamPacketLength;){const n=(0,_.fromChunkCursor)(r),u=(0,d.readUint32)(s,[n]);T(e,u);const p=S(h(u,n),t);a.push(p),(0,o.runPacketProcessors)(e,t,p),(0,i.runPesPayloadParsers)(t),(0,c.advanceToNextPacket)(s,r)}k(e,t)}t.tryParsePackets=v},6275:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createPacketParserData=void 0;const a=r(1981);function s(e,t){return{patPackets:[],pmtPacketIds:new Set,pmtPackets:[],pesPacketIds:new Set,pesStreamTypes:new Map,pesPackets:new Map,payloadParserData:new Map,packetCursors:new Map,codecMap:new Map,chunks:e,chunkCursor:(0,a.createChunkCursor)(0,0),parsedPackets:[],codecsExtracted:t.codecsExtracted,playbackTimeExtracted:t.playbackTimeExtracted,durationExtracted:t.durationExtracted,frameTimings:new Map,containedMediaTypes:new Set}}t.createPacketParserData=s},8656:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PatPacketParser=void 0;const a=r(9874),s=r(5278),n=r(9096),o=r(2929),i=r(4388);function c(e,t){return t.packetIdentifier===a.ProgramAssociationTableId}function _(e,t){if(!e.payloadUnitStartIndicator)throw new o.PacketParsingError("Encountered PAT without PUSI");const r=[],a=(0,i.parseSectionHeader)(t,e),n=(0,s.readUint16)(t,[e.cursor]);(0,s.skip)(3,s.ReaderUnit.Bytes,t,[e.cursor]);let c=a-9;for(;c>0;){const a=(0,s.readUint16)(t,[e.cursor]);if((0,s.skip)(3,s.ReaderUnit.Bits,t,[e.cursor]),0===a){const n=(0,s.read)(13,s.ReaderUnit.Bits,t,[e.cursor]);r.push({programNumber:a,networkPid:n})}else{const n=(0,s.read)(13,s.ReaderUnit.Bits,t,[e.cursor]);r.push({programNumber:a,programMapPid:n})}c-=4}return Object.assign(Object.assign({},e),{transportStreamId:n,programNumbers:r})}t.PatPacketParser=(0,n.createPacketParser)(c,_)},2461:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PesPacketParser=t.isPesPacket=void 0;const a=r(5278),s=r(9096),n=r(2929);var o;!function(e){e[e.program_stream_map=0]="program_stream_map",e[e.private_stream_1=1]="private_stream_1",e[e.padding_stream=2]="padding_stream",e[e.private_stream_2=3]="private_stream_2",e[e.ECM_stream=4]="ECM_stream",e[e.EMM_stream=5]="EMM_stream",e[e["Rec. ITU-T H.222.0 | ISO/IEC 13818-1 Annex A or ISO/IEC 13818-6_DSMCC_stream"]=6]="Rec. ITU-T H.222.0 | ISO/IEC 13818-1 Annex A or ISO/IEC 13818-6_DSMCC_stream",e[e["ISO/IEC_13522_stream"]=7]="ISO/IEC_13522_stream",e[e["Rec. ITU-T H.222.1 type A"]=8]="Rec. ITU-T H.222.1 type A",e[e["Rec. ITU-T H.222.1 type B"]=9]="Rec. ITU-T H.222.1 type B",e[e["Rec. ITU-T H.222.1 type C"]=10]="Rec. ITU-T H.222.1 type C",e[e["Rec. ITU-T H.222.1 type D"]=11]="Rec. ITU-T H.222.1 type D",e[e["Rec. ITU-T H.222.1 type E"]=12]="Rec. ITU-T H.222.1 type E",e[e.ancillary_stream=13]="ancillary_stream",e[e["ISO/IEC 14496-1_SL-packetized_stream"]=14]="ISO/IEC 14496-1_SL-packetized_stream",e[e["ISO/IEC 14496-1_FlexMux_stream"]=15]="ISO/IEC 14496-1_FlexMux_stream",e[e["metadata stream"]=16]="metadata stream",e[e.extended_stream_id=17]="extended_stream_id",e[e["reserved data stream"]=18]="reserved data stream",e[e.program_stream_directory=19]="program_stream_directory",e[e["ISO/IEC 13818-3 or ISO/IEC 11172-3 or ISO/IEC 13818-7 or ISO/IEC 14496-3 audio stream number x xxxx"]=20]="ISO/IEC 13818-3 or ISO/IEC 11172-3 or ISO/IEC 13818-7 or ISO/IEC 14496-3 audio stream number x xxxx",e[e["Rec. ITU-T H.262 | ISO/IEC 13818-2, ISO/IEC 11172-2, ISO/IEC 14496-2, Rec. ITU-T H.264 | ISO/IEC 14496-10 or Rec. ITU-T H.265 | ISO/IEC 23008-2 video stream number xxxx"]=21]="Rec. ITU-T H.262 | ISO/IEC 13818-2, ISO/IEC 11172-2, ISO/IEC 14496-2, Rec. ITU-T H.264 | ISO/IEC 14496-10 or Rec. ITU-T H.265 | ISO/IEC 23008-2 video stream number xxxx"}(o||(o={}));const i={[o.program_stream_map]:e=>188===e,[o.private_stream_1]:e=>189===e,[o.padding_stream]:e=>190===e,[o.private_stream_2]:e=>191===e,[o.ECM_stream]:e=>240===e,[o.EMM_stream]:e=>241===e,[o["Rec. ITU-T H.222.0 | ISO/IEC 13818-1 Annex A or ISO/IEC 13818-6_DSMCC_stream"]]:e=>242===e,[o["ISO/IEC_13522_stream"]]:e=>243===e,[o["Rec. ITU-T H.222.1 type A"]]:e=>244===e,[o["Rec. ITU-T H.222.1 type B"]]:e=>245===e,[o["Rec. ITU-T H.222.1 type C"]]:e=>246===e,[o["Rec. ITU-T H.222.1 type D"]]:e=>247===e,[o["Rec. ITU-T H.222.1 type E"]]:e=>248===e,[o.ancillary_stream]:e=>249===e,[o["ISO/IEC 14496-1_SL-packetized_stream"]]:e=>250===e,[o["ISO/IEC 14496-1_FlexMux_stream"]]:e=>251===e,[o["metadata stream"]]:e=>252===e,[o.extended_stream_id]:e=>253===e,[o["reserved data stream"]]:e=>254===e,[o.program_stream_directory]:e=>255===e,[o["ISO/IEC 13818-3 or ISO/IEC 11172-3 or ISO/IEC 13818-7 or ISO/IEC 14496-3 audio stream number x xxxx"]]:e=>192==(192&e),[o["Rec. ITU-T H.262 | ISO/IEC 13818-2, ISO/IEC 11172-2, ISO/IEC 14496-2, Rec. ITU-T H.264 | ISO/IEC 14496-10 or Rec. ITU-T H.265 | ISO/IEC 23008-2 video stream number xxxx"]]:e=>224==(224&e)};function c(e){return[o.program_stream_map,o.private_stream_2,o.ECM_stream,o.EMM_stream,o.program_stream_directory,o["Rec. ITU-T H.222.0 | ISO/IEC 13818-1 Annex A or ISO/IEC 13818-6_DSMCC_stream"],o["Rec. ITU-T H.222.1 type E"]].map((e=>i[e])).some((t=>t(e)))}function _(e){return i[o.padding_stream](e)}function d(e,t){const r=[(0,a.readUint8)(e,[t]),(0,a.readUint8)(e,[t]),(0,a.readUint8)(e,[t]),(0,a.readUint8)(e,[t]),(0,a.readUint8)(e,[t])];let s=(14&r[0])<<27|(255&r[1])<<20|(254&r[2])<<12|(255&r[3])<<5|(254&r[4])>>>3;return s*=4,s+=(6&r[4])>>>1,s}function u(e,t){return e.pesPacketIds.has(t.packetIdentifier)}function p(e,t){if(!e.payloadUnitStartIndicator)return Object.assign(Object.assign({},e),{payloadUnitStartIndicator:!1});(0,a.skip)(3,a.ReaderUnit.Bytes,t,[e.cursor]);const r=(0,a.readUint8)(t,[e.cursor]),s=_(r),o=c(r),i=(0,a.readUint16)(t,[e.cursor]);let u,p=0,m=0,l=!1,f=!1;if(s||o)if(o)u=i;else{if(!s)throw new n.PacketParsingError(`Encountered unsupported PES stream id: ${r}`);u=0,(0,a.skip)(i,a.ReaderUnit.Bytes,t,[e.cursor])}else{u=i,(0,a.skip)(1,a.ReaderUnit.Bytes,t,[e.cursor]);const r=(0,a.read)(2,a.ReaderUnit.Bits,t,[e.cursor]);(0,a.skip)(6,a.ReaderUnit.Bits,t,[e.cursor]);const s=(0,a.readUint8)(t,[e.cursor]);u-=3,u-=s;let n=s;2===r?(n-=5,l=!0,p=d(t,e.cursor)):3===r&&(n-=10,l=!0,p=d(t,e.cursor),f=!0,m=d(t,e.cursor)),(0,a.skip)(n,a.ReaderUnit.Bytes,t,[e.cursor])}return Object.assign(Object.assign({},e),{streamId:r,payloadLength:u,hasPts:l,pts:p,hasDts:f,dts:m})}t.isPesPacket=u,t.PesPacketParser=(0,s.createPacketParser)(u,p)},973:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PmtPacketParser=void 0;const a=r(5278),s=r(9096),n=r(2929),o=r(4388);function i(e,t){return e.pmtPacketIds.has(t.packetIdentifier)}function c(e,t){if(!e.payloadUnitStartIndicator)throw new n.PacketParsingError("Encountered PMT without PUSI");const r=[],s=(0,o.parseSectionHeader)(t,e),i=(0,a.readUint16)(t,[e.cursor]);(0,a.skip)(44,a.ReaderUnit.Bits,t,[e.cursor]);const c=(0,a.read)(12,a.ReaderUnit.Bits,t,[e.cursor]);(0,a.skip)(c,a.ReaderUnit.Bytes,t,[e.cursor]);let _=s-c-13;for(;_>0;){const s=(0,a.readUint8)(t,[e.cursor]);(0,a.skip)(3,a.ReaderUnit.Bits,t,[e.cursor]);const n=(0,a.read)(13,a.ReaderUnit.Bits,t,[e.cursor]);(0,a.skip)(4,a.ReaderUnit.Bits,t,[e.cursor]);const o=(0,a.read)(12,a.ReaderUnit.Bits,t,[e.cursor]);_-=o+5,r.push({type:s,elementaryPid:n}),(0,a.skip)(o,a.ReaderUnit.Bytes,t,[e.cursor])}return Object.assign(Object.assign({},e),{programNumber:i,streams:r})}t.PmtPacketParser=(0,s.createPacketParser)(i,c)},4388:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseSectionHeader=void 0;const a=r(5278);function s(e,t){const r=(0,a.read)(8,a.ReaderUnit.Bits,e,[t.cursor]);return(0,a.skip)(r,a.ReaderUnit.Bytes,e,[t.cursor]),(0,a.skip)(12,a.ReaderUnit.Bits,e,[t.cursor]),(0,a.read)(12,a.ReaderUnit.Bits,e,[t.cursor])}t.parseSectionHeader=s},648:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createPacketProcessor=void 0;const r=(e,t)=>({match:e,process:t});t.createPacketProcessor=r},8051:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PatPacketProcessor=void 0;const a=r(9874),s=r(648);function n(e,t,r){return r.packetIdentifier===a.ProgramAssociationTableId}function o(e,t,r){for(const e of r.programNumbers)0!==e.programNumber&&t.pmtPacketIds.add(e.programMapPid)}t.PatPacketProcessor=(0,s.createPacketProcessor)(n,o)},1071:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PesPacketProcessor=void 0;const a=r(2929),s=r(648);function n(e,t,r){return t.pesPacketIds.has(r.packetIdentifier)}function o({hasPts:e,pts:t,hasDts:r,dts:a}){return{hasPts:e,pts:t,hasDts:r,dts:a}}function i(e,t,r){var s,n,i,c;const{state:_}=e.effects,{pesStreamTypes:d,packetCursors:u,pesPackets:p,frameTimings:m,playbackTimeExtracted:l}=t,f=r.packetIdentifier,I=d.get(f);if(void 0===I)throw new a.PacketParsingError(`Could not determine stream type for PES packet ${f}`);const P=null!==(s=u.get(r.packetIdentifier))&&void 0!==s?s:[],y=null!==(n=p.get(f))&&void 0!==n?n:new Map,S=null!==(i=y.get(I))&&void 0!==i?i:[],C=null!==(c=m.get(f))&&void 0!==c?c:[],k=r.payloadUnitStartIndicator;k&&r.hasPts&&void 0===l.value&&_.dispatch(l.trigger,r.pts/9e4),k&&C.push(o(r)),m.set(f,C),y.set(I,S),p.set(f,y),P.push(r.cursor),u.set(r.packetIdentifier,P),S.push(r)}t.PesPacketProcessor=(0,s.createPacketProcessor)(n,i)},1191:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PmtPacketProcessor=void 0;const a=r(648);function s(e,t,r){return t.pmtPacketIds.has(r.packetIdentifier)}function n(e,t,r){for(const{elementaryPid:e,type:a}of r.streams)t.pesStreamTypes.set(e,a),t.pesPacketIds.add(e)}t.PmtPacketProcessor=(0,a.createPacketProcessor)(s,n)},3143:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.runPacketProcessors=void 0;const a=r(8051),s=r(1071),n=r(1191),o=[a.PatPacketProcessor,n.PmtPacketProcessor,s.PesPacketProcessor];function i(e,t,r){for(const a of o){const{match:s,process:n}=a;if(s(e,t,r)){n(e,t,r);break}}}t.runPacketProcessors=i},3494:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createPayloadParserDefinition=void 0;const r=(e,t,r)=>({streamTypes:e,createContext:t,resolveParser:r});t.createPayloadParserDefinition=r},9779:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.runPesPayloadParsers=t.Parsers=void 0;const a=r(5278),s=r(3764),n=r(3922);function o(e){return t.Parsers.find((t=>t.streamTypes.includes(e)))}function i(e,t,r,a,s){var n,o;const{payloadParserData:i}=e,c=null!==(n=i.get(t))&&void 0!==n?n:new Map,_=null!==(o=c.get(r))&&void 0!==o?o:{context:a.createContext(e,t,s),currentSteps:[]};return i.set(t,c),c.set(r,_),_}function c(e){for(;e.currentSteps.length>0;){(0,e.currentSteps[0])(e.context),e.currentSteps.shift()}}function _(e,t){try{for(;;)c(t),t.currentSteps=[...e.resolveParser(t.context)]}catch(e){if(!(e instanceof a.PacketReaderError))throw e}}function d(e,{codecMap:t}){return!t.has(e)}function u(e){for(const[t,r]of e.pesPackets)if(d(t,e))for(const[a,s]of r){const r=o(a);if(!r)continue;_(r,i(e,t,a,r,s))}}t.Parsers=[n.default,s.default],t.runPesPayloadParsers=u},3764:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const a=r(5681),s=r(9874),n=r(5278),o=r(3494),i=12,c=()=>({version:0,protectionAbsent:!1,profile:-1,samplingFrequencyIndex:-1,channelConfiguration:-1,originality:0,home:0,copyrightIdBit:0,copyrightIdStart:0,frameLength:-1,bufferFullness:-1,numberOfFrames:-1}),_=({chunks:e,codecMap:t},r,a)=>({codecMap:t,packetId:r,chunks:e,packets:a,currentFrame:c(),parsedFrames:[]});function d(){return[e=>{const{chunks:t,packets:r}=e,a=(0,n.read)(i,n.ReaderUnit.Bits,t,r);if(a!==Math.pow(2,i)-1)throw new Error(`Could not parse syncword while trying to parse ADTS header (${a})`);const s=c();e.currentFrame=s,e.parsedFrames.push(s)},({chunks:e,packets:t,currentFrame:r})=>{r.version=(0,n.read)(1,n.ReaderUnit.Bits,e,t)},({chunks:e,packets:t})=>{const r=(0,n.read)(2,n.ReaderUnit.Bits,e,t);if(0!==r)throw new Error(`ADTS layer is unexpectedly non-zero (${r})`)},({chunks:e,packets:t,currentFrame:r})=>{r.protectionAbsent=1===(0,n.read)(1,n.ReaderUnit.Bits,e,t)},({chunks:e,packets:t,currentFrame:r})=>{r.profile=(0,n.read)(2,n.ReaderUnit.Bits,e,t)+1},({chunks:e,packets:t,currentFrame:r})=>{r.samplingFrequencyIndex=(0,n.read)(4,n.ReaderUnit.Bits,e,t)},({chunks:e,packets:t})=>{(0,n.skip)(1,n.ReaderUnit.Bits,e,t)},({chunks:e,packets:t,currentFrame:r})=>{r.channelConfiguration=(0,n.read)(3,n.ReaderUnit.Bits,e,t)},({chunks:e,packets:t,currentFrame:r})=>{r.originality=(0,n.read)(1,n.ReaderUnit.Bits,e,t)},({chunks:e,packets:t,currentFrame:r})=>{r.home=(0,n.read)(1,n.ReaderUnit.Bits,e,t)},({chunks:e,packets:t,currentFrame:r})=>{r.copyrightIdBit=(0,n.read)(1,n.ReaderUnit.Bits,e,t)},({chunks:e,packets:t,currentFrame:r})=>{r.copyrightIdStart=(0,n.read)(1,n.ReaderUnit.Bits,e,t)},({chunks:e,packets:t,currentFrame:r})=>{r.frameLength=(0,n.read)(13,n.ReaderUnit.Bits,e,t)},({chunks:e,packets:t,currentFrame:r})=>{r.bufferFullness=(0,n.read)(11,n.ReaderUnit.Bits,e,t)},({chunks:e,packets:t,currentFrame:r})=>{r.numberOfFrames=(0,n.read)(2,n.ReaderUnit.Bits,e,t)+1},({chunks:e,packets:t,currentFrame:r})=>{r.protectionAbsent||(r.crc=(0,n.read)(2,n.ReaderUnit.Bytes,e,t))},({chunks:e,packets:t,currentFrame:r,codecMap:o,packetId:i})=>{const c=r.protectionAbsent?7:9,{profile:_}=r,d=(0,a.parseCodecString)(s.PesStreamType.ISO_IEC_13818_7_Audio_with_ADTS,{profile:_});o.set(i,d),(0,n.skip)(r.frameLength-c,n.ReaderUnit.Bytes,e,t)}]}t.default=(0,o.createPayloadParserDefinition)([s.PesStreamType.ISO_IEC_13818_7_Audio_with_ADTS],_,d)},5293:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultNalUnitParser=void 0;const a=r(5278),s=1;t.DefaultNalUnitParser=[e=>{const{chunks:t,packets:r}=e;for(e.currentNal=void 0;e.last3bytes!==s;){const s=(0,a.read)(1,a.ReaderUnit.Bytes,t,r);e.last3bytes=(65535&e.last3bytes)<<8|s}e.last3bytes=3735928559},e=>{const{chunks:t,packets:r}=e,s=(0,a.read)(1,a.ReaderUnit.Bytes,t,r);if(0!==(128&s)>>7)throw new Error("forbidden_zero_bit is in fact not 🫣");const n={nal_ref_idc:(96&s)>>5,nal_unit_type:31&s};e.currentNal=n,e.parsedNals.push(n)}]},3922:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const a=r(9874),s=r(3494),n=r(5293),o=r(3783);function i({chunks:e,codecMap:t},r,a){return{chunks:e,packets:a,codecMap:t,packetId:r,currentNal:void 0,parsedNals:[],last3bytes:3735928559,currentParsingSteps:[]}}function c(e){var t;const r=e.currentNal;return r&&null!==(t=o.NalUnitParserMap[r.nal_unit_type])&&void 0!==t?t:n.DefaultNalUnitParser}t.default=(0,s.createPayloadParserDefinition)([a.PesStreamType.AVC_video_stream],i,c)},3783:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NalUnitParserMap=void 0;const a=r(8655);t.NalUnitParserMap={7:a.SeqParameterSetParser}},8655:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SeqParameterSetParser=void 0;const a=r(5681),s=r(9874),n=r(5278);t.SeqParameterSetParser=[({currentNal:e,chunks:t,packets:r})=>{e.profile_idc=(0,n.read)(1,n.ReaderUnit.Bytes,t,r)},({chunks:e,packets:t,currentNal:r})=>{r.constraints=(0,n.read)(1,n.ReaderUnit.Bytes,e,t)},({currentNal:e,chunks:t,packets:r})=>{e.level_idc=(0,n.read)(1,n.ReaderUnit.Bytes,t,r)},e=>{const{packetId:t,codecMap:r,currentNal:n}=e,{profile_idc:o,constraints:i,level_idc:c}=n,_=(0,a.parseCodecString)(s.PesStreamType.AVC_video_stream,{profile_idc:o,constraints:i,level_idc:c});r.set(t,_),e.currentNal=void 0}]},1981:(e,t)=>{function r(e,t){return{chunkIndex:e,intraChunkByteOffset:t}}Object.defineProperty(t,"__esModule",{value:!0}),t.createChunkCursor=void 0,t.createChunkCursor=r},212:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.advanceToNextPacket=t.getRemainingBytes=void 0;const a=r(9874);function s(e,t){let r=-t.intraChunkByteOffset;for(let a=t.chunkIndex;a<e.length;a++)r+=e[a].byteLength;return Math.max(0,r)}function n(e,t){for(t.intraChunkByteOffset+=a.TransportStreamPacketLength;t.intraChunkByteOffset>0&&t.intraChunkByteOffset>=e[t.chunkIndex].byteLength;)t.intraChunkByteOffset-=e[t.chunkIndex].byteLength,t.chunkIndex++}t.getRemainingBytes=s,t.advanceToNextPacket=n},237:(e,t)=>{function r(e,t,r){return{chunkIndex:e,intraChunkBitOffset:t,relativeBitOffset:r}}function a(e){return r(e.chunkIndex,8*e.intraChunkByteOffset,0)}Object.defineProperty(t,"__esModule",{value:!0}),t.fromChunkCursor=t.createPacketCursor=void 0,t.createPacketCursor=r,t.fromChunkCursor=a},5278:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.readUint32=t.readUint16=t.readUint8=t.skip=t.read=t.canRead=t.ReaderUnit=t.PacketReaderError=void 0;const a=8*r(9874).TransportStreamPacketLength;class s extends Error{constructor(){super(...arguments),this.name="PacketReaderError"}}var n;function o(e){return 8*e}function i(e){return"relativeBitOffset"in e}function c(e){return i(e)?e:e.cursor}function _(e,t,r){for(;e>0&&r.length>0;){const a=c(r[0]),s=d(a);if(s<=e)r.shift(),e-=s,a.relativeBitOffset+=s;else for(a.relativeBitOffset+=e;e>0;){const r=u(t[a.chunkIndex],a);r<=e?(a.chunkIndex++,a.intraChunkBitOffset=0,e-=r):(a.intraChunkBitOffset+=e,e=0)}}}function d(e){return a-c(e).relativeBitOffset}function u(e,t){return o(e.byteLength)-c(t).intraChunkBitOffset}function p(e,t,r){if(0===r.length)return!1;let a=0,s=t===n.Bytes?o(e):e;for(;s>0&&a<r.length;){const e=d(r[a]);if(!(e<=s))return!0;a++,s-=e}return 0===s}function m(e,t,r,a){if(!p(e,t,a))throw new s(`Out of bounds - cannot read ${e} ${t}`);let i=0,m=t===n.Bytes?o(e):e;for(;m>0&&a.length>0;){const e=c(a[0]),t=r[e.chunkIndex],s=d(e),n=u(t,e),o=Math.min(m,s,n);let p=0,l=0;for(;p<o;){const s=Math.floor(e.intraChunkBitOffset/8),n=e.intraChunkBitOffset%8,i=8-n,c=Math.min(o-p,i),d=255>>n,u=i-c;l=l<<c|(t[s]&d)>>u,p+=c,_(c,r,a)}i=i<<p|l,m-=p}return i}function l(e,t,r,a){if(!p(e,t,a))throw new s(`Out of bounds - cannot skip ${e} ${t}`);_(t===n.Bits?e:o(e),r,a)}function f(e,t){return m(1,n.Bytes,e,t)}function I(e,t){return m(2,n.Bytes,e,t)}function P(e,t){return m(4,n.Bytes,e,t)}t.PacketReaderError=s,function(e){e.Bits="bits",e.Bytes="bytes"}(n=t.ReaderUnit||(t.ReaderUnit={})),t.canRead=p,t.read=m,t.skip=l,t.readUint8=f,t.readUint16=I,t.readUint32=P},4809:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CoreExportNames=void 0,function(e){e.Utils="utils",e.Constants="constants",e.CoreEffects="core-effects",e.CoreStateAtoms="core-state-atoms"}(t.CoreExportNames||(t.CoreExportNames={}))},158:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentProcessorType=t.SegmentProcessingExportNames=void 0,function(e){e.SegmentProcessingComponent="segment-processing-component",e.SegmentProcessorType="segment-processor-type",e.SegmentProcessorErrors="segment-processor-errors"}(t.SegmentProcessingExportNames||(t.SegmentProcessingExportNames={})),function(e){e.Decryptor="decryptor",e.Parser="parser",e.Preprocessor="preprocessor",e.Transmuxer="transmuxer",e.Postprocessor="postprocessor"}(t.SegmentProcessorType||(t.SegmentProcessorType={}))},7269:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SourceExportNames=void 0,function(e){e.CreateSourceStateAtom="create-source-state-atom",e.CreateSourceReference="create-source-reference",e.SourceReferences="source-references",e.SourceState="source-state-atom"}(t.SourceExportNames||(t.SourceExportNames={}))}},t={};function r(a){var s=t[a];if(void 0!==s)return s.exports;var n=t[a]={exports:{}};return e[a].call(n.exports,n,n.exports,r),n.exports}return r(7445)})()));