Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mpd-parser

Package Overview
Dependencies
Maintainers
15
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mpd-parser - npm Package Compare versions

Comparing version 0.17.0 to 0.18.0

test/manifests/multiperiod-segment-template.js

18

CHANGELOG.md

@@ -0,1 +1,19 @@

<a name="0.18.0"></a>
# [0.18.0](https://github.com/videojs/mpd-parser/compare/v0.17.0...v0.18.0) (2021-07-28)
### Features
* add Period[@start](https://github.com/start) attribute when missing ([#137](https://github.com/videojs/mpd-parser/issues/137)) ([f118a8b](https://github.com/videojs/mpd-parser/commit/f118a8b))
* add presentationTime as an attribute on each SegmentTemplate segment ([#139](https://github.com/videojs/mpd-parser/issues/139)) ([a972b8c](https://github.com/videojs/mpd-parser/commit/a972b8c))
### Bug Fixes
* generate proper number of segments for multiperiod content that uses segment template ([#138](https://github.com/videojs/mpd-parser/issues/138)) ([39109d0](https://github.com/videojs/mpd-parser/commit/39109d0))
### Code Refactoring
* default MPD[@type](https://github.com/type) to static when missing ([#136](https://github.com/videojs/mpd-parser/issues/136)) ([281e035](https://github.com/videojs/mpd-parser/commit/281e035))
* rename master manifest to main manifest ([#141](https://github.com/videojs/mpd-parser/issues/141)) ([5720fbd](https://github.com/videojs/mpd-parser/commit/5720fbd))
* rename SegmentInfo property from timeline to segmentTimeline ([#140](https://github.com/videojs/mpd-parser/issues/140)) ([1601467](https://github.com/videojs/mpd-parser/commit/1601467))
<a name="0.17.0"></a>

@@ -2,0 +20,0 @@ # [0.17.0](https://github.com/videojs/mpd-parser/compare/v0.16.0...v0.17.0) (2021-05-28)

4

dist/mpd-parser.min.js

@@ -1,2 +0,2 @@

/*! @name mpd-parser @version 0.17.0 @license Apache-2.0 */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("global/window"),require("xmldom")):"function"==typeof define&&define.amd?define(["exports","global/window","xmldom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).mpdParser={},e.window,e.window)}(this,(function(e,t,r){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=n(t),a=function(e){return!!e&&"object"==typeof e},o=function e(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return r.reduce((function(t,r){return"object"!=typeof r||Object.keys(r).forEach((function(n){Array.isArray(t[n])&&Array.isArray(r[n])?t[n]=t[n].concat(r[n]):a(t[n])&&a(r[n])?t[n]=e(t[n],r[n]):t[n]=r[n]})),t}),{})},u=function(e){return e.reduce((function(e,t){return e.concat(t)}),[])},s=function(e){if(!e.length)return[];for(var t=[],r=0;r<e.length;r++)t.push(e[r]);return t},c="INVALID_NUMBER_OF_PERIOD",d="DASH_EMPTY_MANIFEST",l="DASH_INVALID_XML",f="NO_BASE_URL",m="SEGMENT_TIME_UNSPECIFIED",p="UNSUPPORTED_UTC_TIMING_SCHEME";var h=function(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}((function(e,t){var r,n,i,a,o;r=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,n=/^([^\/?#]*)([^]*)$/,i=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(e,t,r){if(r=r||{},e=e.trim(),!(t=t.trim())){if(!r.alwaysNormalize)return e;var i=o.parseURL(e);if(!i)throw new Error("Error trying to parse base URL.");return i.path=o.normalizePath(i.path),o.buildURLFromParts(i)}var a=o.parseURL(t);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return r.alwaysNormalize?(a.path=o.normalizePath(a.path),o.buildURLFromParts(a)):t;var u=o.parseURL(e);if(!u)throw new Error("Error trying to parse base URL.");if(!u.netLoc&&u.path&&"/"!==u.path[0]){var s=n.exec(u.path);u.netLoc=s[1],u.path=s[2]}u.netLoc&&!u.path&&(u.path="/");var c={scheme:u.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(c.netLoc=u.netLoc,"/"!==a.path[0]))if(a.path){var d=u.path,l=d.substring(0,d.lastIndexOf("/")+1)+a.path;c.path=o.normalizePath(l)}else c.path=u.path,a.params||(c.params=u.params,a.query||(c.query=u.query));return null===c.path&&(c.path=r.alwaysNormalize?o.normalizePath(a.path):a.path),o.buildURLFromParts(c)},parseURL:function(e){var t=r.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(i,"");e.length!==(e=e.replace(a,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}},e.exports=o})),v="http://example.com",g=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=i.default.location&&i.default.location.href||"");var r="function"==typeof i.default.URL,n=/^\/\//.test(e),a=!i.default.location&&!/\/\//i.test(e);if(r?e=new i.default.URL(e,i.default.location||v):/\/\//i.test(e)||(e=h.buildAbsoluteURL(i.default.location&&i.default.location.href||"",e)),r){var o=new URL(t,e);return a?o.href.slice(v.length):n?o.href.slice(o.protocol.length):o.href}return h.buildAbsoluteURL(e,t)},b=function(e){var t=e.baseUrl,r=void 0===t?"":t,n=e.source,i=void 0===n?"":n,a=e.range,o=void 0===a?"":a,u=e.indexRange,s=void 0===u?"":u,c={uri:i,resolvedUri:g(r||"",i)};if(o||s){var d=(o||s).split("-"),l=parseInt(d[0],10),f=parseInt(d[1],10);c.byterange={length:f-l+1,offset:l}}return c},y=function(e){return e&&"number"!=typeof e&&(e=parseInt(e,10)),isNaN(e)?null:e},U={static:function(e){var t=e.duration,r=e.timescale,n=void 0===r?1:r,i=e.sourceDuration,a=y(e.endNumber);return{start:0,end:"number"==typeof a?a:Math.ceil(i/(t/n))}},dynamic:function(e){var t=e.NOW,r=e.clientOffset,n=e.availabilityStartTime,i=e.timescale,a=void 0===i?1:i,o=e.duration,u=e.start,s=void 0===u?0:u,c=e.minimumUpdatePeriod,d=void 0===c?0:c,l=e.timeShiftBufferDepth,f=void 0===l?1/0:l,m=y(e.endNumber),p=(t+r)/1e3,h=n+s,v=p+d-h,g=Math.ceil(v*a/o),b=Math.floor((p-h-f)*a/o),U=Math.floor((p-h)*a/o);return{start:Math.max(0,b),end:"number"==typeof m?m:Math.min(g,U)}}},I=function(e){var t=e.type,r=void 0===t?"static":t,n=e.duration,i=e.timescale,a=void 0===i?1:i,o=e.sourceDuration,u=U[r](e),s=function(e,t){for(var r=[],n=e;n<t;n++)r.push(n);return r}(u.start,u.end).map(function(e){return function(t,r){var n=e.duration,i=e.timescale,a=void 0===i?1:i,o=e.periodIndex,u=e.startNumber;return{number:(void 0===u?1:u)+t,duration:n/a,timeline:o,time:r*n}}}(e));if("static"===r){var c=s.length-1;s[c].duration=o-n/a*c}return s},D=function(e){var t=e.baseUrl,r=e.initialization,n=void 0===r?{}:r,i=e.sourceDuration,a=e.indexRange,o=void 0===a?"":a,u=e.duration;if(!t)throw new Error(f);var s=b({baseUrl:t,source:n.sourceURL,range:n.range}),c=b({baseUrl:t,source:t,indexRange:o});if(c.map=s,u){var d=I(e);d.length&&(c.duration=d[0].duration,c.timeline=d[0].timeline)}else i&&(c.duration=i,c.timeline=0);return c.number=0,[c]},R=function(e,t,r){for(var n=e.sidx.map?e.sidx.map:null,i=e.sidx.duration,a=e.timeline||0,o=e.sidx.byterange,u=o.offset+o.length,s=t.timescale,c=t.references.filter((function(e){return 1!==e.referenceType})),d=[],l=u+t.firstOffset,f=0;f<c.length;f++){var m=t.references[f],p=m.referencedSize,h=m.subsegmentDuration,v=D({baseUrl:r,timescale:s,timeline:a,periodIndex:a,duration:h,sourceDuration:i,indexRange:l+"-"+(l+p-1)})[0];n&&(v.map=n),d.push(v),l+=p}return e.segments=d,e},L=function(e){return e&&e.uri+"-"+(t=e.byterange,r=t.offset+t.length-1,t.offset+"-"+r);var t,r},T=function(e){var t;return(t=e.reduce((function(e,t){var r,n=t.attributes.id+(t.attributes.lang||"");return e[n]?(t.segments[0]&&(t.segments[0].discontinuity=!0),(r=e[n].segments).push.apply(r,t.segments),t.attributes.contentProtection&&(e[n].attributes.contentProtection=t.attributes.contentProtection)):e[n]=t,e}),{}),Object.keys(t).map((function(e){return t[e]}))).map((function(e){var t,r;return e.discontinuityStarts=(t=e.segments,r="discontinuity",t.reduce((function(e,t,n){return t[r]&&e.push(n),e}),[])),e}))},w=function(e,t){var r=L(e.sidx),n=r&&t[r]&&t[r].sidx;return n&&R(e,n,e.sidx.resolvedUri),e},E=function(e,t){if(void 0===t&&(t={}),!Object.keys(t).length)return e;for(var r in e)e[r]=w(e[r],t);return e},x=function(e){var t,r=e.attributes,n=e.segments,i=e.sidx,a={attributes:(t={NAME:r.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:r.width,height:r.height},CODECS:r.codecs,BANDWIDTH:r.bandwidth},t["PROGRAM-ID"]=1,t),uri:"",endList:"static"===(r.type||"static"),timeline:r.periodIndex,resolvedUri:"",targetDuration:r.duration,segments:n,mediaSequence:n.length?n[0].number:1};return r.contentProtection&&(a.contentProtection=r.contentProtection),i&&(a.sidx=i),a},S=function(e){var t=e.attributes;return"video/mp4"===t.mimeType||"video/webm"===t.mimeType||"video"===t.contentType},P=function(e){var t=e.attributes;return"audio/mp4"===t.mimeType||"audio/webm"===t.mimeType||"audio"===t.contentType},O=function(e){var t=e.attributes;return"text/vtt"===t.mimeType||"text"===t.contentType},N=function(e,t,r){var n;if(void 0===r&&(r={}),!e.length)return{};var i=e[0].attributes,a=i.sourceDuration,o=i.type,u=void 0===o?"static":o,s=i.suggestedPresentationDelay,c=i.minimumUpdatePeriod,d=T(e.filter(S)).map(x),l=T(e.filter(P)),f=e.filter(O),m=e.map((function(e){return e.attributes.captionServices})).filter(Boolean),p={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(n={AUDIO:{},VIDEO:{}},n["CLOSED-CAPTIONS"]={},n.SUBTITLES={},n),uri:"",duration:a,playlists:E(d,r)};c>=0&&(p.minimumUpdatePeriod=1e3*c),t&&(p.locations=t),"dynamic"===u&&(p.suggestedPresentationDelay=s);var h=0===p.playlists.length;return l.length&&(p.mediaGroups.AUDIO.audio=function(e,t,r){var n;void 0===t&&(t={}),void 0===r&&(r=!1);var i=e.reduce((function(e,i){var a=i.attributes.role&&i.attributes.role.value||"",o=i.attributes.lang||"",u=i.attributes.label||"main";if(o&&!i.attributes.label){var s=a?" ("+a+")":"";u=""+i.attributes.lang+s}e[u]||(e[u]={language:o,autoselect:!0,default:"main"===a,playlists:[],uri:""});var c=w(function(e,t){var r,n=e.attributes,i=e.segments,a=e.sidx,o={attributes:(r={NAME:n.id,BANDWIDTH:n.bandwidth,CODECS:n.codecs},r["PROGRAM-ID"]=1,r),uri:"",endList:"static"===(n.type||"static"),timeline:n.periodIndex,resolvedUri:"",targetDuration:n.duration,segments:i,mediaSequence:i.length?i[0].number:1};return n.contentProtection&&(o.contentProtection=n.contentProtection),a&&(o.sidx=a),t&&(o.attributes.AUDIO="audio",o.attributes.SUBTITLES="subs"),o}(i,r),t);return e[u].playlists.push(c),void 0===n&&"main"===a&&((n=i).default=!0),e}),{});return n||(i[Object.keys(i)[0]].default=!0),i}(l,r,h)),f.length&&(p.mediaGroups.SUBTITLES.subs=function(e,t){return void 0===t&&(t={}),e.reduce((function(e,r){var n=r.attributes.lang||"text";return e[n]||(e[n]={language:n,default:!1,autoselect:!1,playlists:[],uri:""}),e[n].playlists.push(w(function(e){var t,r=e.attributes,n=e.segments;void 0===n&&(n=[{uri:r.baseUrl,timeline:r.periodIndex,resolvedUri:r.baseUrl||"",duration:r.sourceDuration,number:0}],r.duration=r.sourceDuration);var i=((t={NAME:r.id,BANDWIDTH:r.bandwidth})["PROGRAM-ID"]=1,t);return r.codecs&&(i.CODECS=r.codecs),{attributes:i,uri:"",endList:"static"===(r.type||"static"),timeline:r.periodIndex,resolvedUri:r.baseUrl||"",targetDuration:r.duration,segments:n,mediaSequence:n.length?n[0].number:1}}(r),t)),e}),{})}(f,r)),m.length&&(p.mediaGroups["CLOSED-CAPTIONS"].cc=m.reduce((function(e,t){return t?(t.forEach((function(t){var r=t.channel,n=t.language;e[n]={autoselect:!1,default:!1,instreamId:r,language:n},t.hasOwnProperty("aspectRatio")&&(e[n].aspectRatio=t.aspectRatio),t.hasOwnProperty("easyReader")&&(e[n].easyReader=t.easyReader),t.hasOwnProperty("3D")&&(e[n]["3D"]=t["3D"])})),e):e}),{})),p},A=function(e,t,r){var n=e.NOW,i=e.clientOffset,a=e.availabilityStartTime,o=e.timescale,u=void 0===o?1:o,s=e.start,c=void 0===s?0:s,d=e.minimumUpdatePeriod,l=(n+i)/1e3+(void 0===d?0:d)-(a+c);return Math.ceil((l*u-t)/r)},M=function(e,t){for(var r=e.type,n=void 0===r?"static":r,i=e.minimumUpdatePeriod,a=void 0===i?0:i,o=e.media,u=void 0===o?"":o,s=e.sourceDuration,c=e.timescale,d=void 0===c?1:c,l=e.startNumber,f=void 0===l?1:l,m=e.periodIndex,p=[],h=-1,v=0;v<t.length;v++){var g=t[v],b=g.d,y=g.r||0,U=g.t||0;h<0&&(h=U),U&&U>h&&(h=U);var I=void 0;if(y<0){var D=v+1;I=D===t.length?"dynamic"===n&&a>0&&u.indexOf("$Number$")>0?A(e,h,b):(s*d-h)/b:(t[D].t-h)/b}else I=y+1;for(var R=f+p.length+I,L=f+p.length;L<R;)p.push({number:L,duration:b/d,time:h,timeline:m}),h+=b,L++}return p},C=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,z=function(e,t){return e.replace(C,function(e){return function(t,r,n,i){if("$$"===t)return"$";if(void 0===e[r])return t;var a=""+e[r];return"RepresentationID"===r?a:(i=n?parseInt(i,10):1,a.length>=i?a:""+new Array(i-a.length+1).join("0")+a)}}(t))},B=function(e,t){var r={RepresentationID:e.id,Bandwidth:e.bandwidth||0},n=e.initialization,i=void 0===n?{sourceURL:"",range:""}:n,a=b({baseUrl:e.baseUrl,source:z(i.sourceURL,r),range:i.range});return function(e,t){return e.duration||t?e.duration?I(e):M(e,t):[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodIndex}]}(e,t).map((function(t){r.Number=t.number,r.Time=t.time;var n=z(e.media||"",r),i={uri:n,timeline:t.timeline,duration:t.duration,resolvedUri:g(e.baseUrl||"",n),map:a,number:t.number};return e.presentationTimeOffset&&(i.presentationTimeOffset=e.presentationTimeOffset),i}))},F=function(e,t){var r=e.duration,n=e.segmentUrls,i=void 0===n?[]:n;if(!r&&!t||r&&t)throw new Error(m);var a,o=i.map((function(t){return function(e,t){var r=e.baseUrl,n=e.initialization,i=void 0===n?{}:n,a=b({baseUrl:r,source:i.sourceURL,range:i.range}),o=b({baseUrl:r,source:t.media,range:t.mediaRange});return o.map=a,o}(e,t)}));return r&&(a=I(e)),t&&(a=M(e,t)),a.map((function(e,t){if(o[t]){var r=o[t];return r.timeline=e.timeline,r.duration=e.duration,r.number=e.number,r}})).filter((function(e){return e}))},_=function(e){var t,r,n=e.attributes,i=e.segmentInfo;i.template?(r=B,t=o(n,i.template),i.template.presentationTimeOffset&&(t.presentationTimeOffset=i.template.presentationTimeOffset/i.template.timescale)):i.base?(r=D,t=o(n,i.base)):i.list&&(r=F,t=o(n,i.list));var a={attributes:n};if(!r)return a;var u=r(t,i.timeline);if(t.duration){var s=t,c=s.duration,d=s.timescale,l=void 0===d?1:d;t.duration=c/l}else u.length?t.duration=u.reduce((function(e,t){return Math.max(e,Math.ceil(t.duration))}),0):t.duration=0;return a.attributes=t,a.segments=u,i.base&&t.indexRange&&(a.sidx=u[0],a.segments=[]),a},j=function(e){return e.map(_)},q=function(e,t){return s(e.childNodes).filter((function(e){return e.tagName===t}))},$=function(e){return e.textContent.trim()},k=function(e){var t=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e);if(!t)return 0;var r=t.slice(1),n=r[0],i=r[1],a=r[2],o=r[3],u=r[4],s=r[5];return 31536e3*parseFloat(n||0)+2592e3*parseFloat(i||0)+86400*parseFloat(a||0)+3600*parseFloat(o||0)+60*parseFloat(u||0)+parseFloat(s||0)},G={mediaPresentationDuration:function(e){return k(e)},availabilityStartTime:function(e){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(t=e)&&(t+="Z"),Date.parse(t)/1e3;var t},minimumUpdatePeriod:function(e){return k(e)},suggestedPresentationDelay:function(e){return k(e)},type:function(e){return e},timeShiftBufferDepth:function(e){return k(e)},start:function(e){return k(e)},width:function(e){return parseInt(e,10)},height:function(e){return parseInt(e,10)},bandwidth:function(e){return parseInt(e,10)},startNumber:function(e){return parseInt(e,10)},timescale:function(e){return parseInt(e,10)},presentationTimeOffset:function(e){return parseInt(e,10)},duration:function(e){var t=parseInt(e,10);return isNaN(t)?k(e):t},d:function(e){return parseInt(e,10)},t:function(e){return parseInt(e,10)},r:function(e){return parseInt(e,10)},DEFAULT:function(e){return e}},H=function(e){return e&&e.attributes?s(e.attributes).reduce((function(e,t){var r=G[t.name]||G.DEFAULT;return e[t.name]=r(t.value),e}),{}):{}};function W(e){for(var t,r=(t=e,i.default.atob?i.default.atob(t):Buffer.from(t,"base64").toString("binary")),n=new Uint8Array(r.length),a=0;a<r.length;a++)n[a]=r.charCodeAt(a);return n}var V={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"},X=function(e,t){return t.length?u(e.map((function(e){return t.map((function(t){return g(e,$(t))}))}))):e},Y=function(e){var t=q(e,"SegmentTemplate")[0],r=q(e,"SegmentList")[0],n=r&&q(r,"SegmentURL").map((function(e){return o({tag:"SegmentURL"},H(e))})),i=q(e,"SegmentBase")[0],a=r||t,u=a&&q(a,"SegmentTimeline")[0],s=r||i||t,c=s&&q(s,"Initialization")[0],d=t&&H(t);d&&c?d.initialization=c&&H(c):d&&d.initialization&&(d.initialization={sourceURL:d.initialization});var l={template:d,timeline:u&&q(u,"S").map((function(e){return H(e)})),list:r&&o(H(r),{segmentUrls:n,initialization:H(c)}),base:i&&o(H(i),{initialization:H(c)})};return Object.keys(l).forEach((function(e){l[e]||delete l[e]})),l},Z=function(e,t,r){return function(n){var i,a=H(n),s=X(t,q(n,"BaseURL")),c=q(n,"Role")[0],d={role:H(c)},l=o(e,a,d),f=q(n,"Accessibility")[0],m="urn:scte:dash:cc:cea-608:2015"===(i=H(f)).schemeIdUri?i.value.split(";").map((function(e){var t,r;if(r=e,/^CC\d=/.test(e)){var n=e.split("=");t=n[0],r=n[1]}else/^CC\d$/.test(e)&&(t=e);return{channel:t,language:r}})):"urn:scte:dash:cc:cea-708:2015"===i.schemeIdUri?i.value.split(";").map((function(e){var t={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){var r=e.split("="),n=r[0],i=r[1],a=void 0===i?"":i;t.channel=n,t.language=e,a.split(",").forEach((function(e){var r=e.split(":"),n=r[0],i=r[1];"lang"===n?t.language=i:"er"===n?t.easyReader=Number(i):"war"===n?t.aspectRatio=Number(i):"3D"===n&&(t["3D"]=Number(i))}))}else t.language=e;return t.channel&&(t.channel="SERVICE"+t.channel),t})):void 0;m&&(l=o(l,{captionServices:m}));var p=q(n,"Label")[0];if(p&&p.childNodes.length){var h=p.childNodes[0].nodeValue.trim();l=o(l,{label:h})}var v=q(n,"ContentProtection").reduce((function(e,t){var r=H(t),n=V[r.schemeIdUri];if(n){e[n]={attributes:r};var i=q(t,"cenc:pssh")[0];if(i){var a=$(i),o=a&&W(a);e[n].pssh=o}}return e}),{});Object.keys(v).length&&(l=o(l,{contentProtection:v}));var g=Y(n),b=q(n,"Representation"),y=o(r,g);return u(b.map(function(e,t,r){return function(n){var i=q(n,"BaseURL"),a=X(t,i),u=o(e,H(n)),s=Y(n);return a.map((function(e){return{segmentInfo:o(r,s),attributes:o(u,{baseUrl:e})}}))}}(l,s,y)))}},K=function(e,t){return function(r,n){var a=X(t,q(r,"BaseURL")),s=H(r),c=parseInt(s.id,10),d=i.default.isNaN(c)?n:c,l=o(e,{periodIndex:d}),f=q(r,"AdaptationSet"),m=Y(r);return u(f.map(Z(l,a,m)))}},J=function(e,t){void 0===t&&(t={});var r=t,n=r.manifestUri,i=void 0===n?"":n,a=r.NOW,o=void 0===a?Date.now():a,s=r.clientOffset,d=void 0===s?0:s,l=q(e,"Period");if(!l.length)throw new Error(c);var f=q(e,"Location"),m=H(e),p=X([i],q(e,"BaseURL"));return m.sourceDuration=m.mediaPresentationDuration||0,m.NOW=o,m.clientOffset=d,f.length&&(m.locations=f.map($)),{locations:m.locations,representationInfo:u(l.map(K(m,p)))}},Q=function(e){if(""===e)throw new Error(d);var t,n,i=new r.DOMParser;try{n=(t=i.parseFromString(e,"application/xml"))&&"MPD"===t.documentElement.tagName?t.documentElement:null}catch(e){}if(!n||n&&n.getElementsByTagName("parsererror").length>0)throw new Error(l);return n};e.VERSION="0.17.0",e.addSidxSegmentsToPlaylist=R,e.generateSidxKey=L,e.inheritAttributes=J,e.parse=function(e,t){void 0===t&&(t={});var r=J(Q(e),t),n=j(r.representationInfo);return N(n,r.locations,t.sidxMapping)},e.parseUTCTiming=function(e){return function(e){var t=q(e,"UTCTiming")[0];if(!t)return null;var r=H(t);switch(r.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":r.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":r.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":r.method="DIRECT",r.value=Date.parse(r.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(p)}return r}(Q(e))},e.stringToMpdXml=Q,e.toM3u8=N,e.toPlaylists=j,Object.defineProperty(e,"__esModule",{value:!0})}));
/*! @name mpd-parser @version 0.18.0 @license Apache-2.0 */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("global/window"),require("xmldom")):"function"==typeof define&&define.amd?define(["exports","global/window","xmldom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).mpdParser={},e.window,e.window)}(this,(function(e,t,r){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=n(t),a=function(e){return!!e&&"object"==typeof e},o=function e(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return r.reduce((function(t,r){return"object"!=typeof r||Object.keys(r).forEach((function(n){Array.isArray(t[n])&&Array.isArray(r[n])?t[n]=t[n].concat(r[n]):a(t[n])&&a(r[n])?t[n]=e(t[n],r[n]):t[n]=r[n]})),t}),{})},u=function(e){return e.reduce((function(e,t){return e.concat(t)}),[])},s=function(e){if(!e.length)return[];for(var t=[],r=0;r<e.length;r++)t.push(e[r]);return t},c="INVALID_NUMBER_OF_PERIOD",d="DASH_EMPTY_MANIFEST",l="DASH_INVALID_XML",f="NO_BASE_URL",m="SEGMENT_TIME_UNSPECIFIED",p="UNSUPPORTED_UTC_TIMING_SCHEME";var h=function(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}((function(e,t){var r,n,i,a,o;r=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,n=/^([^\/?#]*)([^]*)$/,i=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(e,t,r){if(r=r||{},e=e.trim(),!(t=t.trim())){if(!r.alwaysNormalize)return e;var i=o.parseURL(e);if(!i)throw new Error("Error trying to parse base URL.");return i.path=o.normalizePath(i.path),o.buildURLFromParts(i)}var a=o.parseURL(t);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return r.alwaysNormalize?(a.path=o.normalizePath(a.path),o.buildURLFromParts(a)):t;var u=o.parseURL(e);if(!u)throw new Error("Error trying to parse base URL.");if(!u.netLoc&&u.path&&"/"!==u.path[0]){var s=n.exec(u.path);u.netLoc=s[1],u.path=s[2]}u.netLoc&&!u.path&&(u.path="/");var c={scheme:u.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(c.netLoc=u.netLoc,"/"!==a.path[0]))if(a.path){var d=u.path,l=d.substring(0,d.lastIndexOf("/")+1)+a.path;c.path=o.normalizePath(l)}else c.path=u.path,a.params||(c.params=u.params,a.query||(c.query=u.query));return null===c.path&&(c.path=r.alwaysNormalize?o.normalizePath(a.path):a.path),o.buildURLFromParts(c)},parseURL:function(e){var t=r.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(i,"");e.length!==(e=e.replace(a,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}},e.exports=o})),v="http://example.com",b=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=i.default.location&&i.default.location.href||"");var r="function"==typeof i.default.URL,n=/^\/\//.test(e),a=!i.default.location&&!/\/\//i.test(e);if(r?e=new i.default.URL(e,i.default.location||v):/\/\//i.test(e)||(e=h.buildAbsoluteURL(i.default.location&&i.default.location.href||"",e)),r){var o=new URL(t,e);return a?o.href.slice(v.length):n?o.href.slice(o.protocol.length):o.href}return h.buildAbsoluteURL(e,t)},g=function(e){var t=e.baseUrl,r=void 0===t?"":t,n=e.source,i=void 0===n?"":n,a=e.range,o=void 0===a?"":a,u=e.indexRange,s=void 0===u?"":u,c={uri:i,resolvedUri:b(r||"",i)};if(o||s){var d=(o||s).split("-"),l=parseInt(d[0],10),f=parseInt(d[1],10);c.byterange={length:f-l+1,offset:l}}return c},y=function(e){return e&&"number"!=typeof e&&(e=parseInt(e,10)),isNaN(e)?null:e},U={static:function(e){var t=e.duration,r=e.timescale,n=void 0===r?1:r,i=e.sourceDuration,a=e.periodDuration,o=y(e.endNumber),u=t/n;return"number"==typeof o?{start:0,end:o}:"number"==typeof a?{start:0,end:a/u}:{start:0,end:i/u}},dynamic:function(e){var t=e.NOW,r=e.clientOffset,n=e.availabilityStartTime,i=e.timescale,a=void 0===i?1:i,o=e.duration,u=e.start,s=void 0===u?0:u,c=e.minimumUpdatePeriod,d=void 0===c?0:c,l=e.timeShiftBufferDepth,f=void 0===l?1/0:l,m=y(e.endNumber),p=(t+r)/1e3,h=n+s,v=p+d-h,b=Math.ceil(v*a/o),g=Math.floor((p-h-f)*a/o),U=Math.floor((p-h)*a/o);return{start:Math.max(0,g),end:"number"==typeof m?m:Math.min(b,U)}}},D=function(e){var t=e.type,r=e.duration,n=e.timescale,i=void 0===n?1:n,a=e.periodDuration,o=e.sourceDuration,u=U[t](e),s=function(e,t){for(var r=[],n=e;n<t;n++)r.push(n);return r}(u.start,u.end).map(function(e){return function(t,r){var n=e.duration,i=e.timescale,a=void 0===i?1:i,o=e.periodIndex,u=e.startNumber;return{number:(void 0===u?1:u)+t,duration:n/a,timeline:o,time:r*n}}}(e));if("static"===t){var c=s.length-1,d="number"==typeof a?a:o;s[c].duration=d-r/i*c}return s},I=function(e){var t=e.baseUrl,r=e.initialization,n=void 0===r?{}:r,i=e.sourceDuration,a=e.indexRange,o=void 0===a?"":a,u=e.duration;if(!t)throw new Error(f);var s=g({baseUrl:t,source:n.sourceURL,range:n.range}),c=g({baseUrl:t,source:t,indexRange:o});if(c.map=s,u){var d=D(e);d.length&&(c.duration=d[0].duration,c.timeline=d[0].timeline)}else i&&(c.duration=i,c.timeline=0);return c.number=0,[c]},T=function(e,t,r){for(var n=e.sidx.map?e.sidx.map:null,i=e.sidx.duration,a=e.timeline||0,o=e.sidx.byterange,u=o.offset+o.length,s=t.timescale,c=t.references.filter((function(e){return 1!==e.referenceType})),d=[],l=e.endList?"static":"dynamic",f=u+t.firstOffset,m=0;m<c.length;m++){var p=t.references[m],h=p.referencedSize,v=p.subsegmentDuration,b=I({baseUrl:r,timescale:s,timeline:a,periodIndex:a,duration:v,sourceDuration:i,indexRange:f+"-"+(f+h-1),type:l})[0];n&&(b.map=n),d.push(b),f+=h}return e.segments=d,e},R=function(e){return e&&e.uri+"-"+(t=e.byterange,r=t.offset+t.length-1,t.offset+"-"+r);var t,r},L=function(e){var t;return(t=e.reduce((function(e,t){var r,n=t.attributes.id+(t.attributes.lang||"");return e[n]?(t.segments[0]&&(t.segments[0].discontinuity=!0),(r=e[n].segments).push.apply(r,t.segments),t.attributes.contentProtection&&(e[n].attributes.contentProtection=t.attributes.contentProtection)):e[n]=t,e}),{}),Object.keys(t).map((function(e){return t[e]}))).map((function(e){var t,r;return e.discontinuityStarts=(t=e.segments,r="discontinuity",t.reduce((function(e,t,n){return t[r]&&e.push(n),e}),[])),e}))},w=function(e,t){var r=R(e.sidx),n=r&&t[r]&&t[r].sidx;return n&&T(e,n,e.sidx.resolvedUri),e},E=function(e,t){if(void 0===t&&(t={}),!Object.keys(t).length)return e;for(var r in e)e[r]=w(e[r],t);return e},S=function(e){var t,r=e.attributes,n=e.segments,i=e.sidx,a={attributes:(t={NAME:r.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:r.width,height:r.height},CODECS:r.codecs,BANDWIDTH:r.bandwidth},t["PROGRAM-ID"]=1,t),uri:"",endList:"static"===r.type,timeline:r.periodIndex,resolvedUri:"",targetDuration:r.duration,segments:n,mediaSequence:n.length?n[0].number:1};return r.contentProtection&&(a.contentProtection=r.contentProtection),i&&(a.sidx=i),a},P=function(e){var t=e.attributes;return"video/mp4"===t.mimeType||"video/webm"===t.mimeType||"video"===t.contentType},x=function(e){var t=e.attributes;return"audio/mp4"===t.mimeType||"audio/webm"===t.mimeType||"audio"===t.contentType},O=function(e){var t=e.attributes;return"text/vtt"===t.mimeType||"text"===t.contentType},N=function(e,t,r){var n;if(void 0===r&&(r={}),!e.length)return{};var i=e[0].attributes,a=i.sourceDuration,o=i.type,u=i.suggestedPresentationDelay,s=i.minimumUpdatePeriod,c=L(e.filter(P)).map(S),d=L(e.filter(x)),l=e.filter(O),f=e.map((function(e){return e.attributes.captionServices})).filter(Boolean),m={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(n={AUDIO:{},VIDEO:{}},n["CLOSED-CAPTIONS"]={},n.SUBTITLES={},n),uri:"",duration:a,playlists:E(c,r)};s>=0&&(m.minimumUpdatePeriod=1e3*s),t&&(m.locations=t),"dynamic"===o&&(m.suggestedPresentationDelay=u);var p=0===m.playlists.length;return d.length&&(m.mediaGroups.AUDIO.audio=function(e,t,r){var n;void 0===t&&(t={}),void 0===r&&(r=!1);var i=e.reduce((function(e,i){var a=i.attributes.role&&i.attributes.role.value||"",o=i.attributes.lang||"",u=i.attributes.label||"main";if(o&&!i.attributes.label){var s=a?" ("+a+")":"";u=""+i.attributes.lang+s}e[u]||(e[u]={language:o,autoselect:!0,default:"main"===a,playlists:[],uri:""});var c=w(function(e,t){var r,n=e.attributes,i=e.segments,a=e.sidx,o={attributes:(r={NAME:n.id,BANDWIDTH:n.bandwidth,CODECS:n.codecs},r["PROGRAM-ID"]=1,r),uri:"",endList:"static"===n.type,timeline:n.periodIndex,resolvedUri:"",targetDuration:n.duration,segments:i,mediaSequence:i.length?i[0].number:1};return n.contentProtection&&(o.contentProtection=n.contentProtection),a&&(o.sidx=a),t&&(o.attributes.AUDIO="audio",o.attributes.SUBTITLES="subs"),o}(i,r),t);return e[u].playlists.push(c),void 0===n&&"main"===a&&((n=i).default=!0),e}),{});return n||(i[Object.keys(i)[0]].default=!0),i}(d,r,p)),l.length&&(m.mediaGroups.SUBTITLES.subs=function(e,t){return void 0===t&&(t={}),e.reduce((function(e,r){var n=r.attributes.lang||"text";return e[n]||(e[n]={language:n,default:!1,autoselect:!1,playlists:[],uri:""}),e[n].playlists.push(w(function(e){var t,r=e.attributes,n=e.segments;void 0===n&&(n=[{uri:r.baseUrl,timeline:r.periodIndex,resolvedUri:r.baseUrl||"",duration:r.sourceDuration,number:0}],r.duration=r.sourceDuration);var i=((t={NAME:r.id,BANDWIDTH:r.bandwidth})["PROGRAM-ID"]=1,t);return r.codecs&&(i.CODECS=r.codecs),{attributes:i,uri:"",endList:"static"===r.type,timeline:r.periodIndex,resolvedUri:r.baseUrl||"",targetDuration:r.duration,segments:n,mediaSequence:n.length?n[0].number:1}}(r),t)),e}),{})}(l,r)),f.length&&(m.mediaGroups["CLOSED-CAPTIONS"].cc=f.reduce((function(e,t){return t?(t.forEach((function(t){var r=t.channel,n=t.language;e[n]={autoselect:!1,default:!1,instreamId:r,language:n},t.hasOwnProperty("aspectRatio")&&(e[n].aspectRatio=t.aspectRatio),t.hasOwnProperty("easyReader")&&(e[n].easyReader=t.easyReader),t.hasOwnProperty("3D")&&(e[n]["3D"]=t["3D"])})),e):e}),{})),m},A=function(e,t,r){var n=e.NOW,i=e.clientOffset,a=e.availabilityStartTime,o=e.timescale,u=void 0===o?1:o,s=e.start,c=void 0===s?0:s,d=e.minimumUpdatePeriod,l=(n+i)/1e3+(void 0===d?0:d)-(a+c);return Math.ceil((l*u-t)/r)},M=function(e,t){for(var r=e.type,n=e.minimumUpdatePeriod,i=void 0===n?0:n,a=e.media,o=void 0===a?"":a,u=e.sourceDuration,s=e.timescale,c=void 0===s?1:s,d=e.startNumber,l=void 0===d?1:d,f=e.periodIndex,m=[],p=-1,h=0;h<t.length;h++){var v=t[h],b=v.d,g=v.r||0,y=v.t||0;p<0&&(p=y),y&&y>p&&(p=y);var U=void 0;if(g<0){var D=h+1;U=D===t.length?"dynamic"===r&&i>0&&o.indexOf("$Number$")>0?A(e,p,b):(u*c-p)/b:(t[D].t-p)/b}else U=g+1;for(var I=l+m.length+U,T=l+m.length;T<I;)m.push({number:T,duration:b/c,time:p,timeline:f}),p+=b,T++}return m},C=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,z=function(e,t){return e.replace(C,function(e){return function(t,r,n,i){if("$$"===t)return"$";if(void 0===e[r])return t;var a=""+e[r];return"RepresentationID"===r?a:(i=n?parseInt(i,10):1,a.length>=i?a:""+new Array(i-a.length+1).join("0")+a)}}(t))},B=function(e,t){var r={RepresentationID:e.id,Bandwidth:e.bandwidth||0},n=e.initialization,i=void 0===n?{sourceURL:"",range:""}:n,a=g({baseUrl:e.baseUrl,source:z(i.sourceURL,r),range:i.range});return function(e,t){return e.duration||t?e.duration?D(e):M(e,t):[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodIndex}]}(e,t).map((function(t){r.Number=t.number,r.Time=t.time;var n=z(e.media||"",r),i=e.timescale||1,o=e.presentationTimeOffset||0,u=e.periodStart+t.time/i-o,s={uri:n,timeline:t.timeline,duration:t.duration,resolvedUri:b(e.baseUrl||"",n),map:a,number:t.number,presentationTime:u};return e.presentationTimeOffset&&(s.presentationTimeOffset=e.presentationTimeOffset),s}))},F=function(e,t){var r=e.duration,n=e.segmentUrls,i=void 0===n?[]:n;if(!r&&!t||r&&t)throw new Error(m);var a,o=i.map((function(t){return function(e,t){var r=e.baseUrl,n=e.initialization,i=void 0===n?{}:n,a=g({baseUrl:r,source:i.sourceURL,range:i.range}),o=g({baseUrl:r,source:t.media,range:t.mediaRange});return o.map=a,o}(e,t)}));return r&&(a=D(e)),t&&(a=M(e,t)),a.map((function(e,t){if(o[t]){var r=o[t];return r.timeline=e.timeline,r.duration=e.duration,r.number=e.number,r}})).filter((function(e){return e}))},_=function(e){var t,r,n=e.attributes,i=e.segmentInfo;i.template?(r=B,t=o(n,i.template),i.template.presentationTimeOffset&&(t.presentationTimeOffset=i.template.presentationTimeOffset/i.template.timescale)):i.base?(r=I,t=o(n,i.base)):i.list&&(r=F,t=o(n,i.list));var a={attributes:n};if(!r)return a;var u=r(t,i.segmentTimeline);if(t.duration){var s=t,c=s.duration,d=s.timescale,l=void 0===d?1:d;t.duration=c/l}else u.length?t.duration=u.reduce((function(e,t){return Math.max(e,Math.ceil(t.duration))}),0):t.duration=0;return a.attributes=t,a.segments=u,i.base&&t.indexRange&&(a.sidx=u[0],a.segments=[]),a},j=function(e){return e.map(_)},q=function(e,t){return s(e.childNodes).filter((function(e){return e.tagName===t}))},$=function(e){return e.textContent.trim()},k=function(e){var t=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e);if(!t)return 0;var r=t.slice(1),n=r[0],i=r[1],a=r[2],o=r[3],u=r[4],s=r[5];return 31536e3*parseFloat(n||0)+2592e3*parseFloat(i||0)+86400*parseFloat(a||0)+3600*parseFloat(o||0)+60*parseFloat(u||0)+parseFloat(s||0)},G={mediaPresentationDuration:function(e){return k(e)},availabilityStartTime:function(e){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(t=e)&&(t+="Z"),Date.parse(t)/1e3;var t},minimumUpdatePeriod:function(e){return k(e)},suggestedPresentationDelay:function(e){return k(e)},type:function(e){return e},timeShiftBufferDepth:function(e){return k(e)},start:function(e){return k(e)},width:function(e){return parseInt(e,10)},height:function(e){return parseInt(e,10)},bandwidth:function(e){return parseInt(e,10)},startNumber:function(e){return parseInt(e,10)},timescale:function(e){return parseInt(e,10)},presentationTimeOffset:function(e){return parseInt(e,10)},duration:function(e){var t=parseInt(e,10);return isNaN(t)?k(e):t},d:function(e){return parseInt(e,10)},t:function(e){return parseInt(e,10)},r:function(e){return parseInt(e,10)},DEFAULT:function(e){return e}},H=function(e){return e&&e.attributes?s(e.attributes).reduce((function(e,t){var r=G[t.name]||G.DEFAULT;return e[t.name]=r(t.value),e}),{}):{}};function W(e){for(var t,r=(t=e,i.default.atob?i.default.atob(t):Buffer.from(t,"base64").toString("binary")),n=new Uint8Array(r.length),a=0;a<r.length;a++)n[a]=r.charCodeAt(a);return n}var V={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"},X=function(e,t){return t.length?u(e.map((function(e){return t.map((function(t){return b(e,$(t))}))}))):e},Y=function(e){var t=q(e,"SegmentTemplate")[0],r=q(e,"SegmentList")[0],n=r&&q(r,"SegmentURL").map((function(e){return o({tag:"SegmentURL"},H(e))})),i=q(e,"SegmentBase")[0],a=r||t,u=a&&q(a,"SegmentTimeline")[0],s=r||i||t,c=s&&q(s,"Initialization")[0],d=t&&H(t);d&&c?d.initialization=c&&H(c):d&&d.initialization&&(d.initialization={sourceURL:d.initialization});var l={template:d,segmentTimeline:u&&q(u,"S").map((function(e){return H(e)})),list:r&&o(H(r),{segmentUrls:n,initialization:H(c)}),base:i&&o(H(i),{initialization:H(c)})};return Object.keys(l).forEach((function(e){l[e]||delete l[e]})),l},Z=function(e,t,r){return function(n){var i,a=H(n),s=X(t,q(n,"BaseURL")),c=q(n,"Role")[0],d={role:H(c)},l=o(e,a,d),f=q(n,"Accessibility")[0],m="urn:scte:dash:cc:cea-608:2015"===(i=H(f)).schemeIdUri?i.value.split(";").map((function(e){var t,r;if(r=e,/^CC\d=/.test(e)){var n=e.split("=");t=n[0],r=n[1]}else/^CC\d$/.test(e)&&(t=e);return{channel:t,language:r}})):"urn:scte:dash:cc:cea-708:2015"===i.schemeIdUri?i.value.split(";").map((function(e){var t={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){var r=e.split("="),n=r[0],i=r[1],a=void 0===i?"":i;t.channel=n,t.language=e,a.split(",").forEach((function(e){var r=e.split(":"),n=r[0],i=r[1];"lang"===n?t.language=i:"er"===n?t.easyReader=Number(i):"war"===n?t.aspectRatio=Number(i):"3D"===n&&(t["3D"]=Number(i))}))}else t.language=e;return t.channel&&(t.channel="SERVICE"+t.channel),t})):void 0;m&&(l=o(l,{captionServices:m}));var p=q(n,"Label")[0];if(p&&p.childNodes.length){var h=p.childNodes[0].nodeValue.trim();l=o(l,{label:h})}var v=q(n,"ContentProtection").reduce((function(e,t){var r=H(t),n=V[r.schemeIdUri];if(n){e[n]={attributes:r};var i=q(t,"cenc:pssh")[0];if(i){var a=$(i),o=a&&W(a);e[n].pssh=o}}return e}),{});Object.keys(v).length&&(l=o(l,{contentProtection:v}));var b=Y(n),g=q(n,"Representation"),y=o(r,b);return u(g.map(function(e,t,r){return function(n){var i=q(n,"BaseURL"),a=X(t,i),u=o(e,H(n)),s=Y(n);return a.map((function(e){return{segmentInfo:o(r,s),attributes:o(u,{baseUrl:e})}}))}}(l,s,y)))}},K=function(e,t){return function(r,n){var a=X(t,q(r.node,"BaseURL")),s=parseInt(r.attributes.id,10),c=i.default.isNaN(s)?n:s,d=o(e,{periodIndex:c,periodStart:r.attributes.start});"number"==typeof r.attributes.duration&&(d.periodDuration=r.attributes.duration);var l=q(r.node,"AdaptationSet"),f=Y(r.node);return u(l.map(Z(d,a,f)))}},J=function(e,t){void 0===t&&(t={});var r=t,n=r.manifestUri,i=void 0===n?"":n,a=r.NOW,o=void 0===a?Date.now():a,s=r.clientOffset,d=void 0===s?0:s,l=q(e,"Period");if(!l.length)throw new Error(c);var f=q(e,"Location"),m=H(e),p=X([i],q(e,"BaseURL"));m.type=m.type||"static",m.sourceDuration=m.mediaPresentationDuration||0,m.NOW=o,m.clientOffset=d,f.length&&(m.locations=f.map($));var h=[];return l.forEach((function(e,t){var r=H(e),n=h[t-1];r.start=function(e){var t=e.attributes,r=e.priorPeriodAttributes,n=e.mpdType;return"number"==typeof t.start?t.start:r&&"number"==typeof r.start&&"number"==typeof r.duration?r.start+r.duration:r||"static"!==n?null:0}({attributes:r,priorPeriodAttributes:n?n.attributes:null,mpdType:m.type}),h.push({node:e,attributes:r})})),{locations:m.locations,representationInfo:u(h.map(K(m,p)))}},Q=function(e){if(""===e)throw new Error(d);var t,n,i=new r.DOMParser;try{n=(t=i.parseFromString(e,"application/xml"))&&"MPD"===t.documentElement.tagName?t.documentElement:null}catch(e){}if(!n||n&&n.getElementsByTagName("parsererror").length>0)throw new Error(l);return n};e.VERSION="0.18.0",e.addSidxSegmentsToPlaylist=T,e.generateSidxKey=R,e.inheritAttributes=J,e.parse=function(e,t){void 0===t&&(t={});var r=J(Q(e),t),n=j(r.representationInfo);return N(n,r.locations,t.sidxMapping)},e.parseUTCTiming=function(e){return function(e){var t=q(e,"UTCTiming")[0];if(!t)return null;var r=H(t);switch(r.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":r.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":r.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":r.method="DIRECT",r.value=Date.parse(r.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(p)}return r}(Q(e))},e.stringToMpdXml=Q,e.toM3u8=N,e.toPlaylists=j,Object.defineProperty(e,"__esModule",{value:!0})}));
{
"name": "mpd-parser",
"version": "0.17.0",
"version": "0.18.0",
"description": "mpd parser",

@@ -5,0 +5,0 @@ "main": "dist/mpd-parser.cjs.js",

@@ -45,3 +45,3 @@ import window from 'global/window';

* Contains the attributes for the SegmentTemplate node
* @property {Object[]|undefined} timeline
* @property {Object[]|undefined} segmentTimeline
* Contains a list of atrributes for each S node within the SegmentTimeline node

@@ -94,3 +94,3 @@ * @property {Object|undefined} list

template,
timeline: segmentTimeline &&
segmentTimeline: segmentTimeline &&
findChildren(segmentTimeline, 'S').map(s => parseAttributes(s)),

@@ -355,9 +355,19 @@ list: segmentList && merge(

/**
* Maps an Period node to a list of Representation inforamtion objects for all
* AdaptationSet nodes contained within the Period
* Contains all period information for mapping nodes onto adaptation sets.
*
* @typedef {Object} PeriodInformation
* @property {Node} period.node
* Period node from the mpd
* @property {Object} period.attributes
* Parsed period attributes from node plus any added
*/
/**
* Maps a PeriodInformation object to a list of Representation information objects for all
* AdaptationSet nodes contained within the Period.
*
* @name toAdaptationSetsCallback
* @function
* @param {Node} period
* Period node from the mpd
* @param {PeriodInformation} period
* Period object containing necessary period information
* @param {number} periodIndex

@@ -381,11 +391,17 @@ * Index of the Period within the mpd

export const toAdaptationSets = (mpdAttributes, mpdBaseUrls) => (period, index) => {
const periodBaseUrls = buildBaseUrls(mpdBaseUrls, findChildren(period, 'BaseURL'));
const periodAtt = parseAttributes(period);
const parsedPeriodId = parseInt(periodAtt.id, 10);
const periodBaseUrls = buildBaseUrls(mpdBaseUrls, findChildren(period.node, 'BaseURL'));
const parsedPeriodId = parseInt(period.attributes.id, 10);
// fallback to mapping index if Period@id is not a number
const periodIndex = window.isNaN(parsedPeriodId) ? index : parsedPeriodId;
const periodAttributes = merge(mpdAttributes, { periodIndex });
const adaptationSets = findChildren(period, 'AdaptationSet');
const periodSegmentInfo = getSegmentInformation(period);
const periodAttributes = merge(mpdAttributes, {
periodIndex,
periodStart: period.attributes.start
});
if (typeof period.attributes.duration === 'number') {
periodAttributes.periodDuration = period.attributes.duration;
}
const adaptationSets = findChildren(period.node, 'AdaptationSet');
const periodSegmentInfo = getSegmentInformation(period.node);
return flatten(adaptationSets.map(toRepresentations(periodAttributes, periodBaseUrls, periodSegmentInfo)));

@@ -395,2 +411,58 @@ };

/**
* Gets Period@start property for a given period.
*
* @param {Object} options
* Options object
* @param {Object} options.attributes
* Period attributes
* @param {Object} [options.priorPeriodAttributes]
* Prior period attributes (if prior period is available)
* @param {string} options.mpdType
* The MPD@type these periods came from
* @return {number|null}
* The period start, or null if it's an early available period or error
*/
export const getPeriodStart = ({ attributes, priorPeriodAttributes, mpdType }) => {
// Summary of period start time calculation from DASH spec section 5.3.2.1
//
// A period's start is the first period's start + time elapsed after playing all
// prior periods to this one. Periods continue one after the other in time (without
// gaps) until the end of the presentation.
//
// The value of Period@start should be:
// 1. if Period@start is present: value of Period@start
// 2. if previous period exists and it has @duration: previous Period@start +
// previous Period@duration
// 3. if this is first period and MPD@type is 'static': 0
// 4. in all other cases, consider the period an "early available period" (note: not
// currently supported)
// (1)
if (typeof attributes.start === 'number') {
return attributes.start;
}
// (2)
if (priorPeriodAttributes &&
typeof priorPeriodAttributes.start === 'number' &&
typeof priorPeriodAttributes.duration === 'number') {
return priorPeriodAttributes.start + priorPeriodAttributes.duration;
}
// (3)
if (!priorPeriodAttributes && mpdType === 'static') {
return 0;
}
// (4)
// There is currently no logic for calculating the Period@start value if there is
// no Period@start or prior Period@start and Period@duration available. This is not made
// explicit by the DASH interop guidelines or the DASH spec, however, since there's
// nothing about any other resolution strategies, it's implied. Thus, this case should
// be considered an early available period, or error, and null should suffice for both
// of those cases.
return null;
};
/**
* Traverses the mpd xml tree to generate a list of Representation information objects

@@ -418,5 +490,5 @@ * that have inherited attributes from parent nodes

} = options;
const periods = findChildren(mpd, 'Period');
const periodNodes = findChildren(mpd, 'Period');
if (!periods.length) {
if (!periodNodes.length) {
throw new Error(errors.INVALID_NUMBER_OF_PERIOD);

@@ -430,2 +502,4 @@ }

// See DASH spec section 5.3.1.2, Semantics of MPD element. Default type to 'static'.
mpdAttributes.type = mpdAttributes.type || 'static';
mpdAttributes.sourceDuration = mpdAttributes.mediaPresentationDuration || 0;

@@ -439,2 +513,26 @@ mpdAttributes.NOW = NOW;

const periods = [];
// Since toAdaptationSets acts on individual periods right now, the simplest approach to
// adding properties that require looking at prior periods is to parse attributes and add
// missing ones before toAdaptationSets is called. If more such properties are added, it
// may be better to refactor toAdaptationSets.
periodNodes.forEach((node, index) => {
const attributes = parseAttributes(node);
// Use the last modified prior period, as it may contain added information necessary
// for this period.
const priorPeriod = periods[index - 1];
attributes.start = getPeriodStart({
attributes,
priorPeriodAttributes: priorPeriod ? priorPeriod.attributes : null,
mpdType: mpdAttributes.type
});
periods.push({
node,
attributes
});
});
return {

@@ -441,0 +539,0 @@ locations: mpdAttributes.locations,

@@ -42,10 +42,17 @@ import { range } from '../utils/list';

timescale = 1,
sourceDuration
sourceDuration,
periodDuration
} = attributes;
const endNumber = parseEndNumber(attributes.endNumber);
const segmentDuration = duration / timescale;
return {
start: 0,
end: typeof endNumber === 'number' ? endNumber : Math.ceil(sourceDuration / (duration / timescale))
};
if (typeof endNumber === 'number') {
return { start: 0, end: endNumber };
}
if (typeof periodDuration === 'number') {
return { start: 0, end: periodDuration / segmentDuration };
}
return { start: 0, end: sourceDuration / segmentDuration };
},

@@ -140,5 +147,6 @@

const {
type = 'static',
type,
duration,
timescale = 1,
periodDuration,
sourceDuration

@@ -152,5 +160,8 @@ } = attributes;

const index = segments.length - 1;
// section is either a period or the full source
const sectionDuration =
typeof periodDuration === 'number' ? periodDuration : sourceDuration;
// final segment may be less than full segment duration
segments[index].duration = sourceDuration - (duration / timescale * index);
segments[index].duration = sectionDuration - (duration / timescale * index);
}

@@ -157,0 +168,0 @@

@@ -73,3 +73,3 @@ import errors from '../errors';

const initSegment = playlist.sidx.map ? playlist.sidx.map : null;
// Retain source duration from initial master manifest parsing
// Retain source duration from initial main manifest parsing
const sourceDuration = playlist.sidx.duration;

@@ -85,2 +85,3 @@ // Retain source timeline

const segments = [];
const type = playlist.endList ? 'static' : 'dynamic';

@@ -109,3 +110,4 @@ // firstOffset is the offset from the end of the sidx box

sourceDuration,
indexRange
indexRange,
type
};

@@ -112,0 +114,0 @@

@@ -160,2 +160,12 @@ import resolveUrl from '@videojs/vhs-utils/es/resolve-url';

const uri = constructTemplateUrl(attributes.media || '', templateValues);
// See DASH spec section 5.3.9.2.2
// - if timescale isn't present on any level, default to 1.
const timescale = attributes.timescale || 1;
// - if presentationTimeOffset isn't present on any level, default to 0
const presentationTimeOffset = attributes.presentationTimeOffset || 0;
// presentationTimeOffset has already been adjusted by the timescale
const presentationTime =
// Even if the @t attribute is not specified for the segment, segment.time is
// calculated in mpd-parser prior to this, so it's assumed to be available.
attributes.periodStart + (segment.time / timescale) - presentationTimeOffset;

@@ -168,3 +178,4 @@ const map = {

map: mapSegment,
number: segment.number
number: segment.number,
presentationTime
};

@@ -171,0 +182,0 @@

@@ -48,3 +48,3 @@ /**

const {
type = 'static',
type,
minimumUpdatePeriod = 0,

@@ -51,0 +51,0 @@ media = '',

@@ -78,3 +78,3 @@ import { values } from './utils/object';

uri: '',
endList: (attributes.type || 'static') === 'static',
endList: attributes.type === 'static',
timeline: attributes.periodIndex,

@@ -129,3 +129,3 @@ resolvedUri: '',

uri: '',
endList: (attributes.type || 'static') === 'static',
endList: attributes.type === 'static',
timeline: attributes.periodIndex,

@@ -254,3 +254,3 @@ resolvedUri: attributes.baseUrl || '',

uri: '',
endList: (attributes.type || 'static') === 'static',
endList: attributes.type === 'static',
timeline: attributes.periodIndex,

@@ -286,6 +286,6 @@ resolvedUri: '',

// grab all master attributes
// grab all main manifest attributes
const {
sourceDuration: duration,
type = 'static',
type,
suggestedPresentationDelay,

@@ -300,3 +300,3 @@ minimumUpdatePeriod

const master = {
const manifest = {
allowCache: true,

@@ -318,28 +318,29 @@ discontinuityStarts: [],

if (minimumUpdatePeriod >= 0) {
master.minimumUpdatePeriod = minimumUpdatePeriod * 1000;
manifest.minimumUpdatePeriod = minimumUpdatePeriod * 1000;
}
if (locations) {
master.locations = locations;
manifest.locations = locations;
}
if (type === 'dynamic') {
master.suggestedPresentationDelay = suggestedPresentationDelay;
manifest.suggestedPresentationDelay = suggestedPresentationDelay;
}
const isAudioOnly = master.playlists.length === 0;
const isAudioOnly = manifest.playlists.length === 0;
if (audioPlaylists.length) {
master.mediaGroups.AUDIO.audio = organizeAudioPlaylists(audioPlaylists, sidxMapping, isAudioOnly);
manifest.mediaGroups.AUDIO.audio =
organizeAudioPlaylists(audioPlaylists, sidxMapping, isAudioOnly);
}
if (vttPlaylists.length) {
master.mediaGroups.SUBTITLES.subs = organizeVttPlaylists(vttPlaylists, sidxMapping);
manifest.mediaGroups.SUBTITLES.subs = organizeVttPlaylists(vttPlaylists, sidxMapping);
}
if (captions.length) {
master.mediaGroups['CLOSED-CAPTIONS'].cc = organizeCaptionServices(captions);
manifest.mediaGroups['CLOSED-CAPTIONS'].cc = organizeCaptionServices(captions);
}
return master;
return manifest;
};

@@ -35,3 +35,3 @@ import { merge } from './utils/object';

const segments = segmentsFn(segmentAttributes, segmentInfo.timeline);
const segments = segmentsFn(segmentAttributes, segmentInfo.segmentTimeline);

@@ -38,0 +38,0 @@ // The @duration attribute will be used to determin the playlist's targetDuration which

@@ -17,2 +17,3 @@ import { parse, VERSION } from '../src';

import webmsegments from './manifests/webmsegments.mpd';
import multiperiodSegmentTemplate from './manifests/multiperiod-segment-template.mpd';
import multiperiodDynamic from './manifests/multiperiod-dynamic.mpd';

@@ -42,2 +43,5 @@ import audioOnly from './manifests/audio-only.mpd';

import {
parsedManifest as multiperiodSegmentTemplateManifest
} from './manifests/multiperiod-segment-template.js';
import {
parsedManifest as multiperiodDynamicManifest

@@ -99,2 +103,6 @@ } from './manifests/multiperiod-dynamic.js';

}, {
name: 'multiperiod_segment_template',
input: multiperiodSegmentTemplate,
expected: multiperiodSegmentTemplateManifest
}, {
name: 'multiperiod_dynamic',

@@ -101,0 +109,0 @@ input: multiperiodDynamic,

@@ -5,3 +5,4 @@ import {

parseCaptionServiceMetadata,
getSegmentInformation
getSegmentInformation,
getPeriodStart
} from '../src/inheritAttributes';

@@ -78,2 +79,74 @@ import { stringToMpdXml } from '../src/stringToMpdXml';

QUnit.module('getPeriodStart');
QUnit.test('gets period start when available', function(assert) {
assert.equal(
getPeriodStart({
attributes: { start: 11 },
priorPeriodAttributes: null,
mpdType: 'static'
}),
11,
'returned period start value'
);
});
QUnit.test('gets period start when prior period and duration', function(assert) {
assert.equal(
getPeriodStart({
attributes: {},
priorPeriodAttributes: { start: 11, duration: 20 },
mpdType: 'static'
}),
31,
'returned correct period start value'
);
});
QUnit.test('gets period start when no prior period and static', function(assert) {
assert.equal(
getPeriodStart({
attributes: {},
priorPeriodAttributes: null,
mpdType: 'static'
}),
0,
'returned correct period start value'
);
});
QUnit.test('null when static and prior period but missing attributes', function(assert) {
assert.equal(
getPeriodStart({
attributes: {},
priorPeriodAttributes: { start: 11 },
mpdType: 'static'
}),
null,
'null when no duration in prior period'
);
assert.equal(
getPeriodStart({
attributes: {},
priorPeriodAttributes: { duration: 20 },
mpdType: 'static'
}),
null,
'null when no start in prior period'
);
});
QUnit.test('null when dynamic, no prior period, and no start attribute', function(assert) {
assert.equal(
getPeriodStart({
attributes: {},
priorPeriodAttributes: null,
mpdType: 'dyanmic'
}),
null,
'null when no dynamic, no start attribute, and no prior period'
);
});
QUnit.module('getSegmentInformation');

@@ -171,3 +244,3 @@

template: { media: 'video.mp4' },
timeline: [{ d: 10 }, { d: 5 }, { d: 7 }]
segmentTimeline: [{ d: 10 }, { d: 5 }, { d: 7 }]
};

@@ -487,2 +560,3 @@

periodIndex: 0,
periodStart: 0,
role: {

@@ -492,2 +566,3 @@ value: 'main'

sourceDuration: 30,
type: 'static',
width: 720,

@@ -509,4 +584,6 @@ NOW,

periodIndex: 0,
periodStart: 0,
role: {},
sourceDuration: 30,
type: 'static',
NOW,

@@ -523,2 +600,170 @@ clientOffset: 0

QUnit.test('end to end - basic dynamic', function(assert) {
const NOW = Date.now();
const actual = inheritAttributes(stringToMpdXml(`
<MPD type="dyanmic">
<BaseURL>https://www.example.com/base/</BaseURL>
<Period start="PT0S">
<AdaptationSet mimeType="video/mp4">
<Role value="main"></Role>
<SegmentTemplate></SegmentTemplate>
<Representation
bandwidth="5000000"
codecs="avc1.64001e"
height="404"
id="test"
width="720">
</Representation>
</AdaptationSet>
<AdaptationSet mimeType="text/vtt" lang="en">
<Representation bandwidth="256" id="en">
<BaseURL>https://example.com/en.vtt</BaseURL>
</Representation>
</AdaptationSet>
</Period>
</MPD>
`), { NOW });
const expected = {
locations: undefined,
representationInfo: [{
attributes: {
bandwidth: 5000000,
baseUrl: 'https://www.example.com/base/',
codecs: 'avc1.64001e',
height: 404,
id: 'test',
mimeType: 'video/mp4',
periodIndex: 0,
periodStart: 0,
role: {
value: 'main'
},
sourceDuration: 0,
type: 'dyanmic',
width: 720,
NOW,
clientOffset: 0
},
segmentInfo: {
template: {}
}
}, {
attributes: {
bandwidth: 256,
baseUrl: 'https://example.com/en.vtt',
id: 'en',
lang: 'en',
mimeType: 'text/vtt',
periodIndex: 0,
periodStart: 0,
role: {},
sourceDuration: 0,
type: 'dyanmic',
NOW,
clientOffset: 0
},
segmentInfo: {}
}]
};
assert.equal(actual.representationInfo.length, 2);
assert.deepEqual(actual, expected);
});
QUnit.test('end to end - basic multiperiod', function(assert) {
const NOW = Date.now();
// no start time attributes on either period, should be inferred
const actual = inheritAttributes(stringToMpdXml(`
<MPD mediaPresentationDuration="PT60S" >
<BaseURL>https://www.example.com/base/</BaseURL>
<Period duration="PT30S">
<AdaptationSet mimeType="video/mp4" >
<Role value="main"></Role>
<SegmentTemplate></SegmentTemplate>
<Representation
bandwidth="5000000"
codecs="avc1.64001e"
height="404"
id="test"
width="720">
</Representation>
</AdaptationSet>
</Period>
<Period>
<AdaptationSet mimeType="video/mp4" >
<Role value="main"></Role>
<SegmentTemplate></SegmentTemplate>
<Representation
bandwidth="5000000"
codecs="avc1.64001e"
height="404"
id="test"
width="720">
</Representation>
</AdaptationSet>
</Period>
</MPD>
`), { NOW });
const expected = {
locations: undefined,
representationInfo: [{
attributes: {
bandwidth: 5000000,
baseUrl: 'https://www.example.com/base/',
codecs: 'avc1.64001e',
height: 404,
id: 'test',
mediaPresentationDuration: 60,
mimeType: 'video/mp4',
periodIndex: 0,
periodDuration: 30,
// inferred start
periodStart: 0,
role: {
value: 'main'
},
sourceDuration: 60,
type: 'static',
width: 720,
NOW,
clientOffset: 0
},
segmentInfo: {
template: {}
}
}, {
attributes: {
bandwidth: 5000000,
baseUrl: 'https://www.example.com/base/',
codecs: 'avc1.64001e',
height: 404,
id: 'test',
mediaPresentationDuration: 60,
mimeType: 'video/mp4',
periodIndex: 1,
// inferred start
periodStart: 30,
role: {
value: 'main'
},
sourceDuration: 60,
type: 'static',
width: 720,
NOW,
clientOffset: 0
},
segmentInfo: {
template: {}
}
}]
};
assert.equal(actual.representationInfo.length, 2);
assert.deepEqual(actual, expected);
});
QUnit.test('end to end - inherits BaseURL from all levels', function(assert) {

@@ -567,2 +812,3 @@ const NOW = Date.now();

periodIndex: 0,
periodStart: 0,
role: {

@@ -572,2 +818,3 @@ value: 'main'

sourceDuration: 30,
type: 'static',
width: 720,

@@ -588,4 +835,6 @@ NOW

periodIndex: 0,
periodStart: 0,
role: {},
sourceDuration: 30,
type: 'static',
NOW,

@@ -643,2 +892,3 @@ clientOffset: 0

periodIndex: 0,
periodStart: 0,
role: {

@@ -648,2 +898,3 @@ value: 'main'

sourceDuration: 30,
type: 'static',
width: 720,

@@ -666,2 +917,3 @@ NOW,

periodIndex: 0,
periodStart: 0,
role: {

@@ -671,2 +923,3 @@ value: 'main'

sourceDuration: 30,
type: 'static',
width: 720,

@@ -689,2 +942,3 @@ NOW,

periodIndex: 0,
periodStart: 0,
role: {

@@ -694,2 +948,3 @@ value: 'main'

sourceDuration: 30,
type: 'static',
width: 720,

@@ -712,2 +967,3 @@ NOW,

periodIndex: 0,
periodStart: 0,
role: {

@@ -717,2 +973,3 @@ value: 'main'

sourceDuration: 30,
type: 'static',
width: 720,

@@ -734,4 +991,6 @@ NOW,

periodIndex: 0,
periodStart: 0,
role: {},
sourceDuration: 30,
type: 'static',
NOW,

@@ -750,4 +1009,6 @@ clientOffset: 0

periodIndex: 0,
periodStart: 0,
role: {},
sourceDuration: 30,
type: 'static',
NOW,

@@ -814,2 +1075,3 @@ clientOffset: 0

periodIndex: 0,
periodStart: 0,
role: {

@@ -819,2 +1081,3 @@ value: 'main'

sourceDuration: 30,
type: 'static',
width: 720,

@@ -839,2 +1102,3 @@ NOW,

periodIndex: 0,
periodStart: 0,
height: 545,

@@ -845,2 +1109,3 @@ role: {

sourceDuration: 30,
type: 'static',
NOW,

@@ -867,4 +1132,6 @@ clientOffset: 0

periodIndex: 0,
periodStart: 0,
role: {},
sourceDuration: 30,
type: 'static',
NOW,

@@ -928,2 +1195,4 @@ clientOffset: 0

periodIndex: 0,
periodDuration: 280.414,
periodStart: 0,
role: {

@@ -933,2 +1202,3 @@ value: 'main'

sourceDuration: 30,
type: 'static',
width: 720,

@@ -953,2 +1223,4 @@ NOW,

periodIndex: 0,
periodDuration: 280.414,
periodStart: 0,
height: 545,

@@ -959,2 +1231,3 @@ role: {

sourceDuration: 30,
type: 'static',
NOW,

@@ -981,4 +1254,7 @@ clientOffset: 0

periodIndex: 0,
periodDuration: 280.414,
periodStart: 0,
role: {},
sourceDuration: 30,
type: 'static',
NOW,

@@ -1011,3 +1287,3 @@ clientOffset: 0

<BaseURL>https://www.example.com/base/</BaseURL>
<Period duration= "PT0H4M40.414S" >
<Period>
<AdaptationSet mimeType= "video/mp4" >

@@ -1051,2 +1327,3 @@ <Role value= "main" ></Role>

periodIndex: 0,
periodStart: 0,
role: {

@@ -1056,2 +1333,3 @@ value: 'main'

sourceDuration: 30,
type: 'static',
width: 720,

@@ -1077,2 +1355,3 @@ NOW,

periodIndex: 0,
periodStart: 0,
height: 545,

@@ -1083,2 +1362,3 @@ role: {

sourceDuration: 30,
type: 'static',
NOW,

@@ -1105,4 +1385,6 @@ clientOffset: 0

periodIndex: 0,
periodStart: 0,
role: {},
sourceDuration: 30,
type: 'static',
NOW,

@@ -1131,3 +1413,3 @@ clientOffset: 0

<BaseURL>https://www.example.com/base</BaseURL>
<Period duration= "PT0H4M40.414S" >
<Period>
<AdaptationSet

@@ -1185,2 +1467,3 @@ mimeType= "video/mp4"

periodIndex: 0,
periodStart: 0,
startNumber: 0,

@@ -1198,2 +1481,3 @@ timescale: 48000,

sourceDuration: 30,
type: 'static',
width: 720,

@@ -1211,3 +1495,4 @@ startWithSAP: '1'

uri: '125000/es/0.m4f',
number: 0
number: 0,
presentationTime: 0
}, {

@@ -1222,3 +1507,4 @@ duration: 1.984,

uri: '125000/es/1.m4f',
number: 1
number: 1,
presentationTime: 1.984
}, {

@@ -1233,3 +1519,4 @@ duration: 1.984,

uri: '125000/es/2.m4f',
number: 2
number: 2,
presentationTime: 3.968
}, {

@@ -1244,3 +1531,4 @@ duration: 1.984,

uri: '125000/es/3.m4f',
number: 3
number: 3,
presentationTime: 5.952
}, {

@@ -1255,3 +1543,4 @@ duration: 1.984,

uri: '125000/es/4.m4f',
number: 4
number: 4,
presentationTime: 7.936
}, {

@@ -1266,3 +1555,4 @@ duration: 1.984,

uri: '125000/es/5.m4f',
number: 5
number: 5,
presentationTime: 9.92
}, {

@@ -1277,3 +1567,4 @@ duration: 1.984,

uri: '125000/es/6.m4f',
number: 6
number: 6,
presentationTime: 11.904
}, {

@@ -1288,3 +1579,4 @@ duration: 1.984,

uri: '125000/es/7.m4f',
number: 7
number: 7,
presentationTime: 13.888
}, {

@@ -1299,3 +1591,4 @@ duration: 1.984,

uri: '125000/es/8.m4f',
number: 8
number: 8,
presentationTime: 15.872
}, {

@@ -1310,3 +1603,4 @@ duration: 1.984,

uri: '125000/es/9.m4f',
number: 9
number: 9,
presentationTime: 17.856
}, {

@@ -1321,3 +1615,4 @@ duration: 1.984,

uri: '125000/es/10.m4f',
number: 10
number: 10,
presentationTime: 19.84
}, {

@@ -1332,3 +1627,4 @@ duration: 1.984,

uri: '125000/es/11.m4f',
number: 11
number: 11,
presentationTime: 21.824
}, {

@@ -1343,3 +1639,4 @@ duration: 1.984,

uri: '125000/es/12.m4f',
number: 12
number: 12,
presentationTime: 23.808
}, {

@@ -1354,3 +1651,4 @@ duration: 1.984,

uri: '125000/es/13.m4f',
number: 13
number: 13,
presentationTime: 25.792
}, {

@@ -1365,3 +1663,4 @@ duration: 1.984,

uri: '125000/es/14.m4f',
number: 14
number: 14,
presentationTime: 27.776
}, {

@@ -1376,3 +1675,4 @@ duration: 0.240000000000002,

uri: '125000/es/15.m4f',
number: 15
number: 15,
presentationTime: 29.76
}]

@@ -1390,2 +1690,3 @@ }, {

periodIndex: 0,
periodStart: 0,
role: {

@@ -1396,2 +1697,3 @@ value: 'main'

sourceDuration: 30,
type: 'static',
startWithSAP: '1',

@@ -1415,3 +1717,4 @@ clientOffset: 0,

uri: '125000/es/0.m4f',
number: 0
number: 0,
presentationTime: 0
}, {

@@ -1426,3 +1729,4 @@ duration: 1.984,

uri: '125000/es/1.m4f',
number: 1
number: 1,
presentationTime: 1.984
}, {

@@ -1437,3 +1741,4 @@ duration: 1.984,

uri: '125000/es/2.m4f',
number: 2
number: 2,
presentationTime: 3.968
}, {

@@ -1448,3 +1753,4 @@ duration: 1.984,

uri: '125000/es/3.m4f',
number: 3
number: 3,
presentationTime: 5.952
}, {

@@ -1459,3 +1765,4 @@ duration: 1.984,

uri: '125000/es/4.m4f',
number: 4
number: 4,
presentationTime: 7.936
}, {

@@ -1470,3 +1777,4 @@ duration: 1.984,

uri: '125000/es/5.m4f',
number: 5
number: 5,
presentationTime: 9.92
}, {

@@ -1481,3 +1789,4 @@ duration: 1.984,

uri: '125000/es/6.m4f',
number: 6
number: 6,
presentationTime: 11.904
}, {

@@ -1492,3 +1801,4 @@ duration: 1.984,

uri: '125000/es/7.m4f',
number: 7
number: 7,
presentationTime: 13.888
}, {

@@ -1503,3 +1813,4 @@ duration: 1.984,

uri: '125000/es/8.m4f',
number: 8
number: 8,
presentationTime: 15.872
}, {

@@ -1514,3 +1825,4 @@ duration: 1.984,

uri: '125000/es/9.m4f',
number: 9
number: 9,
presentationTime: 17.856
}, {

@@ -1525,3 +1837,4 @@ duration: 1.984,

uri: '125000/es/10.m4f',
number: 10
number: 10,
presentationTime: 19.84
}, {

@@ -1536,3 +1849,4 @@ duration: 1.984,

uri: '125000/es/11.m4f',
number: 11
number: 11,
presentationTime: 21.824
}, {

@@ -1547,3 +1861,4 @@ duration: 1.984,

uri: '125000/es/12.m4f',
number: 12
number: 12,
presentationTime: 23.808
}, {

@@ -1558,3 +1873,4 @@ duration: 1.984,

uri: '125000/es/13.m4f',
number: 13
number: 13,
presentationTime: 25.792
}, {

@@ -1569,3 +1885,4 @@ duration: 1.984,

uri: '125000/es/14.m4f',
number: 14
number: 14,
presentationTime: 27.776
}, {

@@ -1580,3 +1897,4 @@ duration: 0.240000000000002,

uri: '125000/es/15.m4f',
number: 15
number: 15,
presentationTime: 29.76
}]

@@ -1601,3 +1919,3 @@ }];

<BaseURL>https://www.example.com/base</BaseURL>
<Period duration= "PT0H4M40.414S" >
<Period>
<AdaptationSet

@@ -1656,2 +1974,3 @@ mimeType= "video/mp4"

periodIndex: 0,
periodStart: 0,
role: {

@@ -1662,2 +1981,3 @@ value: 'main'

sourceDuration: 30,
type: 'static',
width: 720,

@@ -1677,3 +1997,4 @@ startWithSAP: '1',

uri: '125000/es/0.m4f',
number: 0
number: 0,
presentationTime: 0
}, {

@@ -1688,3 +2009,4 @@ duration: 1.984,

uri: '125000/es/1.m4f',
number: 1
number: 1,
presentationTime: 1.984
}, {

@@ -1699,3 +2021,4 @@ duration: 1.984,

uri: '125000/es/2.m4f',
number: 2
number: 2,
presentationTime: 3.968
}, {

@@ -1710,3 +2033,4 @@ duration: 1.984,

uri: '125000/es/3.m4f',
number: 3
number: 3,
presentationTime: 5.952
}, {

@@ -1721,3 +2045,4 @@ duration: 1.984,

uri: '125000/es/4.m4f',
number: 4
number: 4,
presentationTime: 7.936
}, {

@@ -1732,3 +2057,4 @@ duration: 1.984,

uri: '125000/es/5.m4f',
number: 5
number: 5,
presentationTime: 9.92
}, {

@@ -1743,3 +2069,4 @@ duration: 1.984,

uri: '125000/es/6.m4f',
number: 6
number: 6,
presentationTime: 11.904
}, {

@@ -1754,3 +2081,4 @@ duration: 1.984,

uri: '125000/es/7.m4f',
number: 7
number: 7,
presentationTime: 13.888
}, {

@@ -1765,3 +2093,4 @@ duration: 1.984,

uri: '125000/es/8.m4f',
number: 8
number: 8,
presentationTime: 15.872
}, {

@@ -1776,3 +2105,4 @@ duration: 1.984,

uri: '125000/es/9.m4f',
number: 9
number: 9,
presentationTime: 17.856
}, {

@@ -1787,3 +2117,4 @@ duration: 1.984,

uri: '125000/es/10.m4f',
number: 10
number: 10,
presentationTime: 19.84
}, {

@@ -1798,3 +2129,4 @@ duration: 1.984,

uri: '125000/es/11.m4f',
number: 11
number: 11,
presentationTime: 21.824
}, {

@@ -1809,3 +2141,4 @@ duration: 1.984,

uri: '125000/es/12.m4f',
number: 12
number: 12,
presentationTime: 23.808
}, {

@@ -1820,3 +2153,4 @@ duration: 1.984,

uri: '125000/es/13.m4f',
number: 13
number: 13,
presentationTime: 25.792
}, {

@@ -1831,3 +2165,4 @@ duration: 1.984,

uri: '125000/es/14.m4f',
number: 14
number: 14,
presentationTime: 27.776
}, {

@@ -1842,3 +2177,4 @@ duration: 0.240000000000002,

uri: '125000/es/15.m4f',
number: 15
number: 15,
presentationTime: 29.76
}]

@@ -1850,2 +2186,1 @@ }];

});

@@ -36,3 +36,4 @@ export const parsedManifest = {

},
number: 0
number: 0,
presentationTime: 0
},

@@ -48,3 +49,4 @@ {

},
number: 1
number: 1,
presentationTime: 1.984
},

@@ -60,3 +62,4 @@ {

},
number: 2
number: 2,
presentationTime: 3.968
},

@@ -72,3 +75,4 @@ {

},
number: 3
number: 3,
presentationTime: 5.952
}

@@ -108,3 +112,4 @@ ],

},
number: 0
number: 0,
presentationTime: 0
},

@@ -120,3 +125,4 @@ {

},
number: 1
number: 1,
presentationTime: 1.984
},

@@ -132,3 +138,4 @@ {

},
number: 2
number: 2,
presentationTime: 3.968
},

@@ -144,3 +151,4 @@ {

},
number: 3
number: 3,
presentationTime: 5.952
}

@@ -188,3 +196,4 @@ ],

},
number: 0
number: 0,
presentationTime: 0
},

@@ -200,3 +209,4 @@ {

},
number: 1
number: 1,
presentationTime: 1.984
},

@@ -212,3 +222,4 @@ {

},
number: 2
number: 2,
presentationTime: 3.968
},

@@ -224,3 +235,4 @@ {

},
number: 3
number: 3,
presentationTime: 5.952
}

@@ -260,3 +272,4 @@ ],

},
number: 0
number: 0,
presentationTime: 0
},

@@ -272,3 +285,4 @@ {

},
number: 1
number: 1,
presentationTime: 1.984
},

@@ -284,3 +298,4 @@ {

},
number: 2
number: 2,
presentationTime: 3.968
},

@@ -296,3 +311,4 @@ {

},
number: 3
number: 3,
presentationTime: 5.952
}

@@ -413,3 +429,4 @@ ],

},
number: 0
number: 0,
presentationTime: 0
},

@@ -425,3 +442,4 @@ {

},
number: 1
number: 1,
presentationTime: 1.9185833333333333
},

@@ -437,3 +455,4 @@ {

},
number: 2
number: 2,
presentationTime: 3.8371666666666666
},

@@ -449,3 +468,4 @@ {

},
number: 3
number: 3,
presentationTime: 5.75575
}

@@ -491,3 +511,4 @@ ],

},
number: 0
number: 0,
presentationTime: 0
},

@@ -503,3 +524,4 @@ {

},
number: 1
number: 1,
presentationTime: 1.9185833333333333
},

@@ -515,3 +537,4 @@ {

},
number: 2
number: 2,
presentationTime: 3.8371666666666666
},

@@ -527,3 +550,4 @@ {

},
number: 3
number: 3,
presentationTime: 5.75575
}

@@ -530,0 +554,0 @@ ],

@@ -36,2 +36,3 @@ export const parsedManifest = {

},
presentationTime: 0,
number: 0

@@ -48,2 +49,3 @@ },

},
presentationTime: 1.9969160997732427,
number: 1

@@ -60,2 +62,3 @@ },

},
presentationTime: 3.9938321995464854,
number: 2

@@ -72,2 +75,3 @@ },

},
presentationTime: 5.972633333,
number: 3,

@@ -85,2 +89,3 @@ discontinuity: true

},
presentationTime: 7.969549432773243,
number: 4

@@ -97,2 +102,3 @@ },

},
presentationTime: 9.966465532546486,
number: 5

@@ -109,2 +115,3 @@ },

},
presentationTime: 10.810799998,
number: 6,

@@ -122,2 +129,3 @@ discontinuity: true

},
presentationTime: 12.807716097773243,
number: 7

@@ -134,2 +142,3 @@ },

},
presentationTime: 14.804632197546486,
number: 8

@@ -146,2 +155,3 @@ },

},
presentationTime: 16.801548297319727,
number: 9

@@ -158,2 +168,3 @@ },

},
presentationTime: 18.79846439709297,
number: 10

@@ -170,2 +181,3 @@ },

},
presentationTime: 20.795380496866215,
number: 11

@@ -182,2 +194,3 @@ },

},
presentationTime: 22.792296596639456,
number: 12

@@ -194,2 +207,3 @@ },

},
presentationTime: 24.789212696412697,
number: 13

@@ -206,2 +220,3 @@ },

},
presentationTime: 19.938462809458052,
number: 14,

@@ -220,2 +235,3 @@ presentationTimeOffset: 4.85297052154195,

},
presentationTime: 21.099460541884355,
number: 15,

@@ -233,2 +249,3 @@ presentationTimeOffset: 4.85297052154195

},
presentationTime: 27.949347162000002,
number: 16,

@@ -246,2 +263,3 @@ discontinuity: true

},
presentationTime: 29.946263261773247,
number: 17

@@ -258,2 +276,3 @@ },

},
presentationTime: 31.943179361546488,
number: 18

@@ -270,2 +289,3 @@ },

},
presentationTime: 33.94009546131973,
number: 19

@@ -306,2 +326,3 @@ }

},
presentationTime: 0,
number: 0

@@ -318,2 +339,3 @@ },

},
presentationTime: 1.9969160997732427,
number: 1

@@ -330,2 +352,3 @@ },

},
presentationTime: 3.9938321995464854,
number: 2

@@ -342,2 +365,3 @@ },

},
presentationTime: 5.972633333,
number: 3,

@@ -355,2 +379,3 @@ discontinuity: true

},
presentationTime: 7.969549432773243,
number: 4

@@ -367,2 +392,3 @@ },

},
presentationTime: 9.966465532546486,
number: 5

@@ -379,2 +405,3 @@ },

},
presentationTime: 10.810799998,
number: 6,

@@ -392,2 +419,3 @@ discontinuity: true

},
presentationTime: 12.807716097773243,
number: 7

@@ -404,2 +432,3 @@ },

},
presentationTime: 14.804632197546486,
number: 8

@@ -416,2 +445,3 @@ },

},
presentationTime: 16.801548297319727,
number: 9

@@ -428,2 +458,3 @@ },

},
presentationTime: 18.79846439709297,
number: 10

@@ -440,2 +471,3 @@ },

},
presentationTime: 20.795380496866215,
number: 11

@@ -452,2 +484,3 @@ },

},
presentationTime: 22.792296596639456,
number: 12

@@ -464,2 +497,3 @@ },

},
presentationTime: 24.789212696412697,
number: 13

@@ -476,2 +510,3 @@ },

},
presentationTime: 19.938462809458052,
number: 14,

@@ -490,2 +525,3 @@ presentationTimeOffset: 4.85297052154195,

},
presentationTime: 21.099460541884355,
number: 15,

@@ -503,2 +539,3 @@ presentationTimeOffset: 4.85297052154195

},
presentationTime: 27.949347162000002,
number: 16,

@@ -516,2 +553,3 @@ discontinuity: true

},
presentationTime: 29.946263261773247,
number: 17

@@ -528,2 +566,3 @@ },

},
presentationTime: 31.943179361546488,
number: 18

@@ -540,2 +579,3 @@ },

},
presentationTime: 33.94009546131973,
number: 19

@@ -594,2 +634,3 @@ }

},
presentationTime: 0,
number: 0

@@ -606,2 +647,3 @@ },

},
presentationTime: 2.002,
number: 1

@@ -618,2 +660,3 @@ },

},
presentationTime: 4.004,
number: 2

@@ -630,2 +673,3 @@ },

},
presentationTime: 5.972633333,
number: 3,

@@ -643,2 +687,3 @@ discontinuity: true

},
presentationTime: 7.907899999666666,
number: 4

@@ -655,2 +700,3 @@ },

},
presentationTime: 9.843166666333333,
number: 5

@@ -667,2 +713,3 @@ },

},
presentationTime: 10.810799998,
number: 6,

@@ -680,2 +727,3 @@ discontinuity: true

},
presentationTime: 12.812799998,
number: 7

@@ -692,2 +740,3 @@ },

},
presentationTime: 14.814799998,
number: 8

@@ -704,2 +753,3 @@ },

},
presentationTime: 16.816799998,
number: 9

@@ -716,2 +766,3 @@ },

},
presentationTime: 18.818799998,
number: 10

@@ -728,2 +779,3 @@ },

},
presentationTime: 20.820799998,
number: 11

@@ -740,2 +792,3 @@ },

},
presentationTime: 22.822799998,
number: 12

@@ -752,2 +805,3 @@ },

},
presentationTime: 19.953266664333334,
number: 13,

@@ -766,2 +820,3 @@ presentationTimeOffset: 4.838166666666667,

},
presentationTime: 20.920899997666666,
number: 14,

@@ -779,2 +834,3 @@ presentationTimeOffset: 4.838166666666667

},
presentationTime: 22.856166664333333,
number: 15,

@@ -792,2 +848,3 @@ presentationTimeOffset: 4.838166666666667

},
presentationTime: 27.949347162000002,
number: 16,

@@ -805,2 +862,3 @@ discontinuity: true

},
presentationTime: 29.951347162,
number: 17

@@ -817,2 +875,3 @@ },

},
presentationTime: 31.953347162,
number: 18

@@ -829,2 +888,3 @@ },

},
presentationTime: 33.955347162,
number: 19

@@ -871,2 +931,3 @@ }

},
presentationTime: 0,
number: 0

@@ -883,2 +944,3 @@ },

},
presentationTime: 2.002,
number: 1

@@ -895,2 +957,3 @@ },

},
presentationTime: 4.004,
number: 2

@@ -907,2 +970,3 @@ },

},
presentationTime: 5.972633333,
number: 3,

@@ -920,2 +984,3 @@ discontinuity: true

},
presentationTime: 7.907899999666666,
number: 4

@@ -932,2 +997,3 @@ },

},
presentationTime: 9.843166666333333,
number: 5

@@ -944,2 +1010,3 @@ },

},
presentationTime: 10.810799998,
number: 6,

@@ -957,2 +1024,3 @@ discontinuity: true

},
presentationTime: 12.812799998,
number: 7

@@ -969,2 +1037,3 @@ },

},
presentationTime: 14.814799998,
number: 8

@@ -981,2 +1050,3 @@ },

},
presentationTime: 16.816799998,
number: 9

@@ -993,2 +1063,3 @@ },

},
presentationTime: 18.818799998,
number: 10

@@ -1005,2 +1076,3 @@ },

},
presentationTime: 20.820799998,
number: 11

@@ -1017,2 +1089,3 @@ },

},
presentationTime: 22.822799998,
number: 12

@@ -1029,2 +1102,3 @@ },

},
presentationTime: 19.953266664333334,
number: 13,

@@ -1043,2 +1117,3 @@ presentationTimeOffset: 4.838166666666667,

},
presentationTime: 20.920899997666666,
number: 14,

@@ -1056,2 +1131,3 @@ presentationTimeOffset: 4.838166666666667

},
presentationTime: 22.856166664333333,
number: 15,

@@ -1069,2 +1145,3 @@ presentationTimeOffset: 4.838166666666667

},
presentationTime: 27.949347162000002,
number: 16,

@@ -1082,2 +1159,3 @@ discontinuity: true

},
presentationTime: 29.951347162,
number: 17

@@ -1094,2 +1172,3 @@ },

},
presentationTime: 31.953347162,
number: 18

@@ -1106,2 +1185,3 @@ },

},
presentationTime: 33.955347162,
number: 19

@@ -1148,2 +1228,3 @@ }

},
presentationTime: 0,
number: 0

@@ -1160,2 +1241,3 @@ },

},
presentationTime: 2.002,
number: 1

@@ -1172,2 +1254,3 @@ },

},
presentationTime: 4.004,
number: 2

@@ -1184,2 +1267,3 @@ },

},
presentationTime: 5.972633333,
number: 3,

@@ -1197,2 +1281,3 @@ discontinuity: true

},
presentationTime: 7.907899999666666,
number: 4

@@ -1209,2 +1294,3 @@ },

},
presentationTime: 9.843166666333333,
number: 5

@@ -1221,2 +1307,3 @@ },

},
presentationTime: 10.810799998,
number: 6,

@@ -1234,2 +1321,3 @@ discontinuity: true

},
presentationTime: 12.812799998,
number: 7

@@ -1246,2 +1334,3 @@ },

},
presentationTime: 14.814799998,
number: 8

@@ -1258,2 +1347,3 @@ },

},
presentationTime: 16.816799998,
number: 9

@@ -1270,2 +1360,3 @@ },

},
presentationTime: 18.818799998,
number: 10

@@ -1282,2 +1373,3 @@ },

},
presentationTime: 20.820799998,
number: 11

@@ -1294,2 +1386,3 @@ },

},
presentationTime: 22.822799998,
number: 12

@@ -1306,2 +1399,3 @@ },

},
presentationTime: 19.953266664333334,
number: 13,

@@ -1320,2 +1414,3 @@ presentationTimeOffset: 4.838166666666667,

},
presentationTime: 20.920899997666666,
number: 14,

@@ -1333,2 +1428,3 @@ presentationTimeOffset: 4.838166666666667

},
presentationTime: 22.856166664333333,
number: 15,

@@ -1346,2 +1442,3 @@ presentationTimeOffset: 4.838166666666667

},
presentationTime: 27.949347162000002,
number: 16,

@@ -1359,2 +1456,3 @@ discontinuity: true

},
presentationTime: 29.951347162,
number: 17

@@ -1371,2 +1469,3 @@ },

},
presentationTime: 31.953347162,
number: 18

@@ -1383,2 +1482,3 @@ },

},
presentationTime: 33.955347162,
number: 19

@@ -1385,0 +1485,0 @@ }

@@ -36,2 +36,3 @@ export const parsedManifest = {

},
presentationTime: 0,
number: 0

@@ -48,2 +49,3 @@ },

},
presentationTime: 1.9969160997732427,
number: 1

@@ -60,2 +62,3 @@ },

},
presentationTime: 3.9938321995464854,
number: 2

@@ -72,2 +75,3 @@ },

},
presentationTime: 5.972633333,
number: 3,

@@ -85,2 +89,3 @@ discontinuity: true

},
presentationTime: 7.969549432773243,
number: 4

@@ -97,2 +102,3 @@ },

},
presentationTime: 9.966465532546486,
number: 5

@@ -109,2 +115,3 @@ },

},
presentationTime: 10.810799998,
number: 6,

@@ -122,2 +129,3 @@ discontinuity: true

},
presentationTime: 12.807716097773243,
number: 7

@@ -134,2 +142,3 @@ },

},
presentationTime: 14.804632197546486,
number: 8

@@ -146,2 +155,3 @@ },

},
presentationTime: 16.801548297319727,
number: 9

@@ -158,2 +168,3 @@ },

},
presentationTime: 18.79846439709297,
number: 10

@@ -170,2 +181,3 @@ },

},
presentationTime: 20.795380496866215,
number: 11

@@ -182,2 +194,3 @@ },

},
presentationTime: 22.792296596639456,
number: 12

@@ -194,2 +207,3 @@ },

},
presentationTime: 24.789212696412697,
number: 13

@@ -206,2 +220,3 @@ },

},
presentationTime: 19.938462809458052,
number: 14,

@@ -220,2 +235,3 @@ presentationTimeOffset: 4.85297052154195,

},
presentationTime: 21.099460541884355,
number: 15,

@@ -233,2 +249,3 @@ presentationTimeOffset: 4.85297052154195

},
presentationTime: 27.949347162000002,
number: 16,

@@ -246,2 +263,3 @@ discontinuity: true

},
presentationTime: 29.946263261773247,
number: 17

@@ -258,2 +276,3 @@ },

},
presentationTime: 31.943179361546488,
number: 18

@@ -270,2 +289,3 @@ },

},
presentationTime: 33.94009546131973,
number: 19

@@ -306,2 +326,3 @@ }

},
presentationTime: 0,
number: 0

@@ -318,2 +339,3 @@ },

},
presentationTime: 1.9969160997732427,
number: 1

@@ -330,2 +352,3 @@ },

},
presentationTime: 3.9938321995464854,
number: 2

@@ -342,2 +365,3 @@ },

},
presentationTime: 5.972633333,
number: 3,

@@ -355,2 +379,3 @@ discontinuity: true

},
presentationTime: 7.969549432773243,
number: 4

@@ -367,2 +392,3 @@ },

},
presentationTime: 9.966465532546486,
number: 5

@@ -379,2 +405,3 @@ },

},
presentationTime: 10.810799998,
number: 6,

@@ -392,2 +419,3 @@ discontinuity: true

},
presentationTime: 12.807716097773243,
number: 7

@@ -404,2 +432,3 @@ },

},
presentationTime: 14.804632197546486,
number: 8

@@ -416,2 +445,3 @@ },

},
presentationTime: 16.801548297319727,
number: 9

@@ -428,2 +458,3 @@ },

},
presentationTime: 18.79846439709297,
number: 10

@@ -440,2 +471,3 @@ },

},
presentationTime: 20.795380496866215,
number: 11

@@ -452,2 +484,3 @@ },

},
presentationTime: 22.792296596639456,
number: 12

@@ -464,2 +497,3 @@ },

},
presentationTime: 24.789212696412697,
number: 13

@@ -476,2 +510,3 @@ },

},
presentationTime: 19.938462809458052,
number: 14,

@@ -490,2 +525,3 @@ presentationTimeOffset: 4.85297052154195,

},
presentationTime: 21.099460541884355,
number: 15,

@@ -503,2 +539,3 @@ presentationTimeOffset: 4.85297052154195

},
presentationTime: 27.949347162000002,
number: 16,

@@ -516,2 +553,3 @@ discontinuity: true

},
presentationTime: 29.946263261773247,
number: 17

@@ -528,2 +566,3 @@ },

},
presentationTime: 31.943179361546488,
number: 18

@@ -540,2 +579,3 @@ },

},
presentationTime: 33.94009546131973,
number: 19

@@ -594,2 +634,3 @@ }

},
presentationTime: 0,
number: 0

@@ -606,2 +647,3 @@ },

},
presentationTime: 2.002,
number: 1

@@ -618,2 +660,3 @@ },

},
presentationTime: 4.004,
number: 2

@@ -630,2 +673,3 @@ },

},
presentationTime: 5.972633333,
number: 3,

@@ -643,2 +687,3 @@ discontinuity: true

},
presentationTime: 7.907899999666666,
number: 4

@@ -655,2 +700,3 @@ },

},
presentationTime: 9.843166666333333,
number: 5

@@ -667,2 +713,3 @@ },

},
presentationTime: 10.810799998,
number: 6,

@@ -680,2 +727,3 @@ discontinuity: true

},
presentationTime: 12.812799998,
number: 7

@@ -692,2 +740,3 @@ },

},
presentationTime: 14.814799998,
number: 8

@@ -704,2 +753,3 @@ },

},
presentationTime: 16.816799998,
number: 9

@@ -716,2 +766,3 @@ },

},
presentationTime: 18.818799998,
number: 10

@@ -728,2 +779,3 @@ },

},
presentationTime: 20.820799998,
number: 11

@@ -740,2 +792,3 @@ },

},
presentationTime: 22.822799998,
number: 12

@@ -752,2 +805,3 @@ },

},
presentationTime: 19.953266664333334,
number: 13,

@@ -766,2 +820,3 @@ presentationTimeOffset: 4.838166666666667,

},
presentationTime: 20.920899997666666,
number: 14,

@@ -779,2 +834,3 @@ presentationTimeOffset: 4.838166666666667

},
presentationTime: 22.856166664333333,
number: 15,

@@ -792,2 +848,3 @@ presentationTimeOffset: 4.838166666666667

},
presentationTime: 27.949347162000002,
number: 16,

@@ -805,2 +862,3 @@ discontinuity: true

},
presentationTime: 29.951347162,
number: 17

@@ -817,2 +875,3 @@ },

},
presentationTime: 31.953347162,
number: 18

@@ -829,2 +888,3 @@ },

},
presentationTime: 33.955347162,
number: 19

@@ -871,2 +931,3 @@ }

},
presentationTime: 0,
number: 0

@@ -883,2 +944,3 @@ },

},
presentationTime: 2.002,
number: 1

@@ -895,2 +957,3 @@ },

},
presentationTime: 4.004,
number: 2

@@ -907,2 +970,3 @@ },

},
presentationTime: 5.972633333,
number: 3,

@@ -920,2 +984,3 @@ discontinuity: true

},
presentationTime: 7.907899999666666,
number: 4

@@ -932,2 +997,3 @@ },

},
presentationTime: 9.843166666333333,
number: 5

@@ -944,2 +1010,3 @@ },

},
presentationTime: 10.810799998,
number: 6,

@@ -957,2 +1024,3 @@ discontinuity: true

},
presentationTime: 12.812799998,
number: 7

@@ -969,2 +1037,3 @@ },

},
presentationTime: 14.814799998,
number: 8

@@ -981,2 +1050,3 @@ },

},
presentationTime: 16.816799998,
number: 9

@@ -993,2 +1063,3 @@ },

},
presentationTime: 18.818799998,
number: 10

@@ -1005,2 +1076,3 @@ },

},
presentationTime: 20.820799998,
number: 11

@@ -1017,2 +1089,3 @@ },

},
presentationTime: 22.822799998,
number: 12

@@ -1029,2 +1102,3 @@ },

},
presentationTime: 19.953266664333334,
number: 13,

@@ -1043,2 +1117,3 @@ presentationTimeOffset: 4.838166666666667,

},
presentationTime: 20.920899997666666,
number: 14,

@@ -1056,2 +1131,3 @@ presentationTimeOffset: 4.838166666666667

},
presentationTime: 22.856166664333333,
number: 15,

@@ -1069,2 +1145,3 @@ presentationTimeOffset: 4.838166666666667

},
presentationTime: 27.949347162000002,
number: 16,

@@ -1082,2 +1159,3 @@ discontinuity: true

},
presentationTime: 29.951347162,
number: 17

@@ -1094,2 +1172,3 @@ },

},
presentationTime: 31.953347162,
number: 18

@@ -1106,2 +1185,3 @@ },

},
presentationTime: 33.955347162,
number: 19

@@ -1148,2 +1228,3 @@ }

},
presentationTime: 0,
number: 0

@@ -1160,2 +1241,3 @@ },

},
presentationTime: 2.002,
number: 1

@@ -1172,2 +1254,3 @@ },

},
presentationTime: 4.004,
number: 2

@@ -1184,2 +1267,3 @@ },

},
presentationTime: 5.972633333,
number: 3,

@@ -1197,2 +1281,3 @@ discontinuity: true

},
presentationTime: 7.907899999666666,
number: 4

@@ -1209,2 +1294,3 @@ },

},
presentationTime: 9.843166666333333,
number: 5

@@ -1221,2 +1307,3 @@ },

},
presentationTime: 10.810799998,
number: 6,

@@ -1234,2 +1321,3 @@ discontinuity: true

},
presentationTime: 12.812799998,
number: 7

@@ -1246,2 +1334,3 @@ },

},
presentationTime: 14.814799998,
number: 8

@@ -1258,2 +1347,3 @@ },

},
presentationTime: 16.816799998,
number: 9

@@ -1270,2 +1360,3 @@ },

},
presentationTime: 18.818799998,
number: 10

@@ -1282,2 +1373,3 @@ },

},
presentationTime: 20.820799998,
number: 11

@@ -1294,2 +1386,3 @@ },

},
presentationTime: 22.822799998,
number: 12

@@ -1306,2 +1399,3 @@ },

},
presentationTime: 19.953266664333334,
number: 13,

@@ -1320,2 +1414,3 @@ presentationTimeOffset: 4.838166666666667,

},
presentationTime: 20.920899997666666,
number: 14,

@@ -1333,2 +1428,3 @@ presentationTimeOffset: 4.838166666666667

},
presentationTime: 22.856166664333333,
number: 15,

@@ -1346,2 +1442,3 @@ presentationTimeOffset: 4.838166666666667

},
presentationTime: 27.949347162000002,
number: 16,

@@ -1359,2 +1456,3 @@ discontinuity: true

},
presentationTime: 29.951347162,
number: 17

@@ -1371,2 +1469,3 @@ },

},
presentationTime: 31.953347162,
number: 18

@@ -1383,2 +1482,3 @@ },

},
presentationTime: 33.955347162,
number: 19

@@ -1385,0 +1485,0 @@ }

@@ -36,3 +36,4 @@ export const parsedManifest = {

},
number: 0
number: 0,
presentationTime: 0
},

@@ -48,3 +49,4 @@ {

},
number: 1
number: 1,
presentationTime: 1.984
},

@@ -60,3 +62,4 @@ {

},
number: 2
number: 2,
presentationTime: 3.968
},

@@ -72,3 +75,4 @@ {

},
number: 3
number: 3,
presentationTime: 5.952
}

@@ -108,3 +112,4 @@ ],

},
number: 0
number: 0,
presentationTime: 0
},

@@ -120,3 +125,4 @@ {

},
number: 1
number: 1,
presentationTime: 1.984
},

@@ -132,3 +138,4 @@ {

},
number: 2
number: 2,
presentationTime: 3.968
},

@@ -144,3 +151,4 @@ {

},
number: 3
number: 3,
presentationTime: 5.952
}

@@ -188,3 +196,4 @@ ],

},
number: 0
number: 0,
presentationTime: 0
},

@@ -200,3 +209,4 @@ {

},
number: 1
number: 1,
presentationTime: 1.984
},

@@ -212,3 +222,4 @@ {

},
number: 2
number: 2,
presentationTime: 3.968
},

@@ -224,3 +235,4 @@ {

},
number: 3
number: 3,
presentationTime: 5.952
}

@@ -260,3 +272,4 @@ ],

},
number: 0
number: 0,
presentationTime: 0
},

@@ -272,3 +285,4 @@ {

},
number: 1
number: 1,
presentationTime: 1.984
},

@@ -284,3 +298,4 @@ {

},
number: 2
number: 2,
presentationTime: 3.968
},

@@ -296,3 +311,4 @@ {

},
number: 3
number: 3,
presentationTime: 5.952
}

@@ -414,3 +430,4 @@ ],

},
number: 0
number: 0,
presentationTime: 0
},

@@ -426,3 +443,4 @@ {

},
number: 1
number: 1,
presentationTime: 1.9185833333333333
},

@@ -438,3 +456,4 @@ {

},
number: 2
number: 2,
presentationTime: 3.8371666666666666
},

@@ -450,3 +469,4 @@ {

},
number: 3
number: 3,
presentationTime: 5.75575
}

@@ -492,3 +512,4 @@ ],

},
number: 0
number: 0,
presentationTime: 0
},

@@ -504,3 +525,4 @@ {

},
number: 1
number: 1,
presentationTime: 1.9185833333333333
},

@@ -516,3 +538,4 @@ {

},
number: 2
number: 2,
presentationTime: 3.8371666666666666
},

@@ -528,3 +551,4 @@ {

},
number: 3
number: 3,
presentationTime: 5.75575
}

@@ -531,0 +555,0 @@ ],

@@ -36,3 +36,4 @@ export const parsedManifest = {

},
number: 0
number: 0,
presentationTime: 0
},

@@ -48,3 +49,4 @@ {

},
number: 1
number: 1,
presentationTime: 4
},

@@ -60,3 +62,4 @@ {

},
number: 2
number: 2,
presentationTime: 8
},

@@ -72,3 +75,4 @@ {

},
number: 3
number: 3,
presentationTime: 12
}

@@ -118,3 +122,4 @@ ],

},
number: 0
number: 0,
presentationTime: 0
},

@@ -130,3 +135,4 @@ {

},
number: 1
number: 1,
presentationTime: 4
},

@@ -142,3 +148,4 @@ {

},
number: 2
number: 2,
presentationTime: 8
},

@@ -154,3 +161,4 @@ {

},
number: 3
number: 3,
presentationTime: 12
}

@@ -157,0 +165,0 @@ ],

@@ -13,3 +13,4 @@ import QUnit from 'qunit';

baseUrl: 'http://www.example.com/i.fmp4',
initialization: { sourceURL: 'http://www.example.com/init.fmp4' }
initialization: { sourceURL: 'http://www.example.com/init.fmp4' },
type: 'static'
};

@@ -32,3 +33,4 @@

initialization: { sourceURL: 'http://www.example.com/init.fmp4' },
sourceDuration: 10
sourceDuration: 10,
type: 'static'
};

@@ -61,3 +63,4 @@

sourceDuration: 10,
timescale: 2
timescale: 2,
type: 'static'
};

@@ -84,3 +87,4 @@

initialization: { sourceURL: 'http://www.example.com/init.fmp4' },
periodIndex: 0
periodIndex: 0,
type: 'static'
};

@@ -108,3 +112,4 @@

initialization: { sourceURL: 'http://www.example.com/init.fmp4' },
periodIndex: 0
periodIndex: 0,
type: 'static'
};

@@ -135,3 +140,4 @@

},
periodIndex: 0
periodIndex: 0,
type: 'static'
};

@@ -178,3 +184,4 @@

},
segments: []
segments: [],
endList: true
};

@@ -181,0 +188,0 @@ const sidx = {

@@ -25,3 +25,4 @@ import QUnit from 'qunit';

startNumber: 1,
baseUrl: 'http://example.com/'
baseUrl: 'http://example.com/',
type: 'static'
};

@@ -106,3 +107,4 @@

startNumber: 1,
baseUrl: 'http://example.com/'
baseUrl: 'http://example.com/',
type: 'static'
};

@@ -158,3 +160,4 @@

startNumber: 1,
baseUrl: 'http://example.com/'
baseUrl: 'http://example.com/',
type: 'static'
};

@@ -240,3 +243,4 @@

sourceDuration: 50,
baseUrl: 'http://example.com/'
baseUrl: 'http://example.com/',
type: 'static'
};

@@ -316,3 +320,4 @@

sourceDuration: 25,
baseUrl: 'http://example.com/'
baseUrl: 'http://example.com/',
type: 'static'
};

@@ -386,3 +391,4 @@

sourceDuration: 15,
baseUrl: 'http://example.com/'
baseUrl: 'http://example.com/',
type: 'static'
};

@@ -428,3 +434,4 @@

sourceDuration: 20,
baseUrl: 'http://example.com/'
baseUrl: 'http://example.com/',
type: 'static'
};

@@ -478,3 +485,4 @@

sourceDuration: 20,
baseUrl: 'http://example.com/'
baseUrl: 'http://example.com/',
type: 'static'
};

@@ -507,3 +515,4 @@

sourceDuration: 20,
baseUrl: 'http://example.com/'
baseUrl: 'http://example.com/',
type: 'static'
};

@@ -530,3 +539,4 @@

sourceDuration: 20,
baseUrl: 'http://example.com/'
baseUrl: 'http://example.com/',
type: 'static'
};

@@ -533,0 +543,0 @@

@@ -124,3 +124,5 @@ import QUnit from 'qunit';

sourceDuration: 42,
periodIndex: 1
periodIndex: 1,
type: 'static',
periodStart: 0
};

@@ -142,3 +144,5 @@

duration: 6000,
periodIndex: 1
periodIndex: 1,
type: 'static',
periodStart: 0
};

@@ -178,3 +182,5 @@

duration: 6000,
periodIndex: 1
periodIndex: 1,
type: 'static',
periodStart: 0
};

@@ -212,3 +218,5 @@

duration: '4',
periodIndex: 1
periodIndex: 1,
type: 'static',
periodStart: 0
};

@@ -247,3 +255,5 @@

periodIndex: 1,
endNumber: '2'
endNumber: '2',
type: 'static',
periodStart: 0
};

@@ -276,3 +286,5 @@

timescale: 1000,
periodIndex: 1
periodIndex: 1,
type: 'static',
periodStart: 0
};

@@ -332,3 +344,5 @@ const segmentTimeline = [

timescale: 1000,
periodIndex: 1
periodIndex: 1,
type: 'static',
periodStart: 0
};

@@ -386,3 +400,5 @@ const segmentTimeline = [

sourceDuration: 11,
periodIndex: 1
periodIndex: 1,
type: 'static',
periodStart: 0
};

@@ -442,3 +458,5 @@ const segmentTimeline = [

timescale: 1000,
periodIndex: 1
periodIndex: 1,
type: 'static',
periodStart: 0
};

@@ -497,3 +515,5 @@ const segmentTimeline = [

timescale: 1000,
periodIndex: 1
periodIndex: 1,
type: 'static',
periodStart: 0
};

@@ -553,3 +573,5 @@ const segmentTimeline = [

timescale: 1000,
periodIndex: 1
periodIndex: 1,
type: 'static',
periodStart: 0
};

@@ -628,3 +650,5 @@ const segmentTimeline = [

timescale: 1000,
periodIndex: 1
periodIndex: 1,
type: 'static',
periodStart: 0
};

@@ -704,3 +728,5 @@ const segmentTimeline = [

timescale: 1000,
periodIndex: 1
periodIndex: 1,
type: 'static',
periodStart: 0
};

@@ -771,3 +797,4 @@ const segmentTimeline = [

duration: 2,
periodIndex: 1
periodIndex: 1,
periodStart: 0
};

@@ -786,3 +813,4 @@

timeline: 1,
uri: 'n-1.m4s'
uri: 'n-1.m4s',
presentationTime: 0
}, {

@@ -797,3 +825,4 @@ duration: 2,

timeline: 1,
uri: 'n-2.m4s'
uri: 'n-2.m4s',
presentationTime: 2
}, {

@@ -808,3 +837,4 @@ duration: 2,

timeline: 1,
uri: 'n-3.m4s'
uri: 'n-3.m4s',
presentationTime: 4
}, {

@@ -819,3 +849,4 @@ duration: 2,

timeline: 1,
uri: 'n-4.m4s'
uri: 'n-4.m4s',
presentationTime: 6
}, {

@@ -830,3 +861,4 @@ duration: 2,

timeline: 1,
uri: 'n-5.m4s'
uri: 'n-5.m4s',
presentationTime: 8
}],

@@ -847,3 +879,4 @@ 'segments correctly with basic settings'

timeline: 1,
uri: 'n-10.m4s'
uri: 'n-10.m4s',
presentationTime: 0
}, {

@@ -858,3 +891,4 @@ duration: 2,

timeline: 1,
uri: 'n-11.m4s'
uri: 'n-11.m4s',
presentationTime: 2
}, {

@@ -869,3 +903,4 @@ duration: 2,

timeline: 1,
uri: 'n-12.m4s'
uri: 'n-12.m4s',
presentationTime: 4
}, {

@@ -880,3 +915,4 @@ duration: 2,

timeline: 1,
uri: 'n-13.m4s'
uri: 'n-13.m4s',
presentationTime: 6
}, {

@@ -891,3 +927,4 @@ duration: 2,

timeline: 1,
uri: 'n-14.m4s'
uri: 'n-14.m4s',
presentationTime: 8
}],

@@ -911,3 +948,4 @@ 'segments adjusted correctly based on @startNumber'

timeline: 1,
uri: 'n-1.m4s'
uri: 'n-1.m4s',
presentationTime: 0
}, {

@@ -922,3 +960,4 @@ duration: 2,

timeline: 1,
uri: 'n-2.m4s'
uri: 'n-2.m4s',
presentationTime: 2
}, {

@@ -933,3 +972,4 @@ duration: 2,

timeline: 1,
uri: 'n-3.m4s'
uri: 'n-3.m4s',
presentationTime: 4
}],

@@ -953,3 +993,4 @@ 'segments correct with @availabilityStartTime set'

timeline: 1,
uri: 'n-1.m4s'
uri: 'n-1.m4s',
presentationTime: 0
}, {

@@ -964,3 +1005,4 @@ duration: 2,

timeline: 1,
uri: 'n-2.m4s'
uri: 'n-2.m4s',
presentationTime: 2
}],

@@ -984,3 +1026,4 @@ 'segments correct with @availabilityStartTime and @start set'

timeline: 1,
uri: 'n-4.m4s'
uri: 'n-4.m4s',
presentationTime: 0
}, {

@@ -995,3 +1038,4 @@ duration: 2,

timeline: 1,
uri: 'n-5.m4s'
uri: 'n-5.m4s',
presentationTime: 2
}],

@@ -1015,3 +1059,4 @@ 'segments correct with @timeShiftBufferDepth set'

timeline: 1,
uri: 'n-1.m4s'
uri: 'n-1.m4s',
presentationTime: 0
}, {

@@ -1026,3 +1071,4 @@ duration: 2,

timeline: 1,
uri: 'n-2.m4s'
uri: 'n-2.m4s',
presentationTime: 2
}, {

@@ -1037,3 +1083,4 @@ duration: 2,

timeline: 1,
uri: 'n-3.m4s'
uri: 'n-3.m4s',
presentationTime: 4
}, {

@@ -1048,3 +1095,4 @@ duration: 2,

timeline: 1,
uri: 'n-4.m4s'
uri: 'n-4.m4s',
presentationTime: 6
}],

@@ -1068,3 +1116,4 @@ 'segments correct with given clientOffset'

timeline: 1,
uri: 'n-1.m4s'
uri: 'n-1.m4s',
presentationTime: 0
}, {

@@ -1079,3 +1128,4 @@ duration: 2,

timeline: 1,
uri: 'n-2.m4s'
uri: 'n-2.m4s',
presentationTime: 2
}, {

@@ -1090,3 +1140,4 @@ duration: 2,

timeline: 1,
uri: 'n-3.m4s'
uri: 'n-3.m4s',
presentationTime: 4
}, {

@@ -1101,3 +1152,4 @@ duration: 2,

timeline: 1,
uri: 'n-4.m4s'
uri: 'n-4.m4s',
presentationTime: 6
}],

@@ -1119,3 +1171,4 @@ 'segments correct with endNumber'

startNumber: 1,
periodIndex: 1
periodIndex: 1,
periodStart: 0
};

@@ -1146,3 +1199,4 @@

timeline: 1,
uri: 'n-1.m4s'
uri: 'n-1.m4s',
presentationTime: 0
}, {

@@ -1157,3 +1211,4 @@ duration: 2,

timeline: 1,
uri: 'n-2.m4s'
uri: 'n-2.m4s',
presentationTime: 2
}, {

@@ -1168,3 +1223,4 @@ duration: 2,

timeline: 1,
uri: 'n-3.m4s'
uri: 'n-3.m4s',
presentationTime: 4
}, {

@@ -1179,3 +1235,4 @@ duration: 2,

timeline: 1,
uri: 'n-4.m4s'
uri: 'n-4.m4s',
presentationTime: 6
}, {

@@ -1190,3 +1247,4 @@ duration: 2,

timeline: 1,
uri: 'n-5.m4s'
uri: 'n-5.m4s',
presentationTime: 8
}],

@@ -1207,3 +1265,4 @@ 'segments should fill until current time when r = -1 and @minimumUpdatePeriod > 0'

timeline: 1,
uri: 'n-1.m4s'
uri: 'n-1.m4s',
presentationTime: 0
}, {

@@ -1218,3 +1277,4 @@ duration: 2,

timeline: 1,
uri: 'n-2.m4s'
uri: 'n-2.m4s',
presentationTime: 2
}, {

@@ -1229,3 +1289,4 @@ duration: 2,

timeline: 1,
uri: 'n-3.m4s'
uri: 'n-3.m4s',
presentationTime: 4
}, {

@@ -1240,3 +1301,4 @@ duration: 2,

timeline: 1,
uri: 'n-4.m4s'
uri: 'n-4.m4s',
presentationTime: 6
}],

@@ -1269,3 +1331,4 @@ 'segments should fill correctly when taking client offset into account'

timeline: 1,
uri: 'n-1.m4s'
uri: 'n-1.m4s',
presentationTime: 2
}, {

@@ -1280,3 +1343,4 @@ duration: 2,

timeline: 1,
uri: 'n-2.m4s'
uri: 'n-2.m4s',
presentationTime: 4
}, {

@@ -1291,3 +1355,4 @@ duration: 2,

timeline: 1,
uri: 'n-3.m4s'
uri: 'n-3.m4s',
presentationTime: 6
}, {

@@ -1302,3 +1367,4 @@ duration: 2,

timeline: 1,
uri: 'n-4.m4s'
uri: 'n-4.m4s',
presentationTime: 8
}],

@@ -1322,3 +1388,4 @@ 'segments take into account different time value for first segment'

timeline: 1,
uri: 'n-1.m4s'
uri: 'n-1.m4s',
presentationTime: 1
}, {

@@ -1333,3 +1400,4 @@ duration: 1,

timeline: 1,
uri: 'n-2.m4s'
uri: 'n-2.m4s',
presentationTime: 2
}, {

@@ -1344,3 +1412,4 @@ duration: 1,

timeline: 1,
uri: 'n-3.m4s'
uri: 'n-3.m4s',
presentationTime: 3
}, {

@@ -1355,3 +1424,4 @@ duration: 1,

timeline: 1,
uri: 'n-4.m4s'
uri: 'n-4.m4s',
presentationTime: 4
}, {

@@ -1366,3 +1436,4 @@ duration: 1,

timeline: 1,
uri: 'n-5.m4s'
uri: 'n-5.m4s',
presentationTime: 5
}, {

@@ -1377,3 +1448,4 @@ duration: 1,

timeline: 1,
uri: 'n-6.m4s'
uri: 'n-6.m4s',
presentationTime: 6
}, {

@@ -1388,3 +1460,4 @@ duration: 1,

timeline: 1,
uri: 'n-7.m4s'
uri: 'n-7.m4s',
presentationTime: 7
}, {

@@ -1399,3 +1472,4 @@ duration: 1,

timeline: 1,
uri: 'n-8.m4s'
uri: 'n-8.m4s',
presentationTime: 8
}, {

@@ -1410,3 +1484,4 @@ duration: 1,

timeline: 1,
uri: 'n-9.m4s'
uri: 'n-9.m4s',
presentationTime: 9
}],

@@ -1432,3 +1507,5 @@ 'segments take into account different time value for first segment with timescale'

periodIndex: 1,
baseUrl: 'https://example.com/'
baseUrl: 'https://example.com/',
type: 'static',
periodStart: 0
};

@@ -1445,3 +1522,4 @@ const segments = [

uri: 'Rep1/100/000-00000.mp4',
number: 0
number: 0,
presentationTime: 0
},

@@ -1457,3 +1535,4 @@ {

uri: 'Rep1/100/001-06000.mp4',
number: 1
number: 1,
presentationTime: 6
},

@@ -1469,3 +1548,4 @@ {

uri: 'Rep1/100/002-12000.mp4',
number: 2
number: 2,
presentationTime: 12
}

@@ -1494,3 +1574,5 @@ ];

periodIndex: 1,
baseUrl: 'https://example.com/'
baseUrl: 'https://example.com/',
type: 'static',
periodStart: 0
};

@@ -1511,3 +1593,4 @@ const segments = [

uri: 'Rep1/100/000-00000.mp4',
number: 0
number: 0,
presentationTime: 0
},

@@ -1527,3 +1610,4 @@ {

uri: 'Rep1/100/001-06000.mp4',
number: 1
number: 1,
presentationTime: 6
},

@@ -1543,3 +1627,4 @@ {

uri: 'Rep1/100/002-12000.mp4',
number: 2
number: 2,
presentationTime: 12
}

@@ -1553,1 +1638,41 @@ ];

});
QUnit.test('multiperiod uses periodDuration when available', function(assert) {
const attributes = {
startNumber: 0,
duration: 6000,
sourceDuration: 12,
timescale: 1000,
bandwidth: 100,
id: 'Rep1',
initialization: {
sourceURL: '$RepresentationID$/$Bandwidth$/init.mp4'
},
media: '$RepresentationID$/$Bandwidth$/$Number%03d$-$Time%05d$.mp4',
periodIndex: 1,
// 6 second period should mean a single 6 second segment
periodDuration: 6,
baseUrl: 'https://example.com/',
type: 'static',
periodStart: 0
};
const segments = [
{
duration: 6,
map: {
resolvedUri: 'https://example.com/Rep1/100/init.mp4',
uri: 'Rep1/100/init.mp4'
},
resolvedUri: 'https://example.com/Rep1/100/000-00000.mp4',
timeline: 1,
uri: 'Rep1/100/000-00000.mp4',
number: 0,
presentationTime: 0
}
];
assert.deepEqual(
segmentsFromTemplate(attributes, void 0), segments,
'creates segments from template'
);
});

@@ -15,3 +15,4 @@ import { toM3u8, generateSidxKey } from '../src/toM3u8';

periodIndex: 1,
mimeType: 'audio/mp4'
mimeType: 'audio/mp4',
type: 'static'
},

@@ -27,3 +28,4 @@ segments: []

periodIndex: 1,
mimeType: 'audio/mp4'
mimeType: 'audio/mp4',
type: 'static'
},

@@ -41,3 +43,4 @@ segments: []

periodIndex: 1,
mimeType: 'video/mp4'
mimeType: 'video/mp4',
type: 'static'
},

@@ -52,2 +55,3 @@ segments: []

mimeType: 'text/vtt',
type: 'static',
baseUrl: 'https://www.example.com/vtt'

@@ -62,2 +66,3 @@ }

mimeType: 'text/vtt',
type: 'static',
baseUrl: 'https://www.example.com/vtt'

@@ -202,3 +207,4 @@ }

periodIndex: 1,
mimeType: 'audio/mp4'
mimeType: 'audio/mp4',
type: 'static'
},

@@ -234,3 +240,4 @@ segments: [{

periodIndex: 1,
mimeType: 'audio/mp4'
mimeType: 'audio/mp4',
type: 'static'
},

@@ -268,3 +275,4 @@ segments: [{

periodIndex: 1,
mimeType: 'video/mp4'
mimeType: 'video/mp4',
type: 'static'
},

@@ -300,2 +308,3 @@ segments: [{

mimeType: 'text/vtt',
type: 'static',
baseUrl: 'https://www.example.com/vtt'

@@ -332,2 +341,3 @@ },

mimeType: 'text/vtt',
type: 'static',
baseUrl: 'https://www.example.com/vtt'

@@ -582,3 +592,4 @@ },

periodIndex: 1,
mimeType: 'video/mp4'
mimeType: 'video/mp4',
type: 'static'
},

@@ -671,3 +682,4 @@ segments: [],

periodIndex: 1,
mimeType: 'video/mp4'
mimeType: 'video/mp4',
type: 'static'
},

@@ -702,2 +714,3 @@ segments: [],

mimeType: 'video/mp4',
type: 'static',
minimumUpdatePeriod: 0

@@ -733,2 +746,3 @@ },

mimeType: 'video/mp4',
type: 'static',
minimumUpdatePeriod: 2

@@ -778,3 +792,4 @@ },

periodIndex: 1,
mimeType: 'audio/mp4'
mimeType: 'audio/mp4',
type: 'static'
},

@@ -792,3 +807,4 @@ segments: []

periodIndex: 1,
mimeType: 'video/mp4'
mimeType: 'video/mp4',
type: 'static'
},

@@ -803,2 +819,3 @@ segments: []

mimeType: 'text/vtt',
type: 'static',
baseUrl: 'https://www.example.com/vtt'

@@ -813,2 +830,3 @@ }

mimeType: 'text/vtt',
type: 'static',
baseUrl: 'https://www.example.com/vtt'

@@ -847,3 +865,4 @@ }

periodIndex: 1,
mimeType: 'audio/mp4'
mimeType: 'audio/mp4',
type: 'static'
},

@@ -861,3 +880,4 @@ segments: []

periodIndex: 1,
mimeType: 'video/mp4'
mimeType: 'video/mp4',
type: 'static'
},

@@ -905,3 +925,4 @@ segments: []

periodIndex: 1,
mimeType: 'audio/mp4'
mimeType: 'audio/mp4',
type: 'static'
},

@@ -919,3 +940,4 @@ segments: []

periodIndex: 1,
mimeType: 'video/mp4'
mimeType: 'video/mp4',
type: 'static'
},

@@ -922,0 +944,0 @@ segments: []

@@ -14,3 +14,9 @@ import {

const representations = [{
attributes: { baseUrl: 'http://example.com/', periodIndex: 0, sourceDuration: 2 },
attributes: {
baseUrl: 'http://example.com/',
periodIndex: 0,
sourceDuration: 2,
type: 'static',
periodStart: 0
},
segmentInfo: {

@@ -25,4 +31,6 @@ template: { }

periodIndex: 0,
periodStart: 0,
sourceDuration: 2,
duration: 2
duration: 2,
type: 'static'
},

@@ -38,3 +46,4 @@ segments: [{

},
number: 1
number: 1,
presentationTime: 0
}]

@@ -48,3 +57,8 @@ }];

const representations = [{
attributes: { baseUrl: 'http://example.com/', periodIndex: 0, sourceDuration: 2 },
attributes: {
baseUrl: 'http://example.com/',
periodIndex: 0,
sourceDuration: 2,
type: 'static'
},
segmentInfo: {

@@ -60,3 +74,4 @@ base: true

sourceDuration: 2,
duration: 2
duration: 2,
type: 'static'
},

@@ -85,3 +100,4 @@ segments: [{

sourceDuration: 2,
indexRange: '10-19'
indexRange: '10-19',
type: 'static'
},

@@ -99,3 +115,4 @@ segmentInfo: {

duration: 2,
indexRange: '10-19'
indexRange: '10-19',
type: 'static'
},

@@ -129,3 +146,4 @@ segments: [],

sourceDuration: 11,
periodIndex: 0
periodIndex: 0,
type: 'static'
},

@@ -153,3 +171,4 @@ segmentInfo: {

}],
periodIndex: 0
periodIndex: 0,
type: 'static'
},

@@ -184,3 +203,9 @@ segments: [{

const representations = [{
attributes: { baseUrl: 'http://example.com/', periodIndex: 0, sourceDuration: 2 },
attributes: {
baseUrl: 'http://example.com/',
periodIndex: 0,
sourceDuration: 2,
type: 'static',
periodStart: 25
},
segmentInfo: {

@@ -201,6 +226,8 @@ template: {

periodIndex: 0,
periodStart: 25,
sourceDuration: 2,
duration: 2,
presentationTimeOffset: 25,
timescale: 4
timescale: 4,
type: 'static'
},

@@ -211,2 +238,3 @@ segments: [{

duration: 2,
presentationTime: 0,
presentationTimeOffset: 25,

@@ -213,0 +241,0 @@ resolvedUri: 'http://example.com/',

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc