Repository navigation
Releases
Releases · streaming-video-technology-alliance/common-media-library
@svta/cml-utils v1.8.0
Added
decodeUtf8converts UTF-8 bytes in aDataViewor aUint8Arrayto a string. Its bundle is smaller than the bundle ofdecodeText.
Fixed
- Without
TextDecoder,decodeTextreplaces each invalid UTF-8 byte sequence with U+FFFD, likeTextDecoder. Before, some sequences gave other characters, and a code point above U+10FFFF threw aRangeError. - The TSDoc of
encodeTextstates that the function needsTextEncoder.
@svta/cml-utils v1.7.1
Changed
- The README and the
homepagefield ofpackage.jsonnow link to the package page on the website, cml.svta.org/packages/utils.
Fixed
@svta/cml-structured-field-values v1.1.8
Changed
parseByteSequencethrows a parse error instead of aTypeErrorwhen the byte sequence contains a line break. Every other input reports the same error as before.- The README now has a When to use section. The section names the tasks that the package covers and the entry point of each task.
- The README and the
homepagefield ofpackage.jsonnow link to the package page on the website, cml.svta.org/packages/structured-field-values.
Fixed
- The encoders now round every Decimal tie to the even digit, as RFC 9651 section 4.1.5 requires.
encodeSfItem(2.0005)returns2.0instead of2.001. The fix is inroundToEvenof@svta/cml-utils, so install@svta/cml-utils1.7.1 or later (#665) - The decoders now throw a parse error for a Date outside the range of a JS
Date.decodeSfItem('@999999999999999')throws instead of returning an item with an Invalid Date. A JSDateholds at most 8,640,000,000,000 seconds before or after 1970-01-01. - The encoders now throw a serialize error for an Invalid Date.
encodeSfItem(new Date(NaN))throws instead of returning@NaN.
@svta/cml-drm v1.1.13
Changed
concatInitDataIdAndCertificateanddecodeFairPlayLicensenow returnUint8Array<ArrayBuffer>. The result passes to Web APIs such asMediaKeySession.updatewithout a cast under TypeScript 6 and later. The type declarations now need TypeScript 5.7 or later.- The README now has a When to use section. The section names the tasks that the package covers and the entry point of each task.
- The README and the
homepagefield ofpackage.jsonnow link to the package page on the website, cml.svta.org/packages/drm.
Fixed
parsePsshListnow returns for a box with a size of 0. The function reads that box to the end of the data.parsePsshListnow reads thelargesizefield of a box with a size of 1.parsePsshListnow stops before a box that ends after the data, or before a box with a size below the size of its header. The function returns the entries before that box and does not throw.parsePsshListnow skips apsshbox that ends before its data size field. Before, the function read the system ID from the bytes after that box.
@svta/cml-iso-8601 v1.0.3
Changed
- The README now has a When to use section. The section names the tasks that the package covers and the entry point of each task.
Fixed
decodeIso8601DurationgivesNaNfor a malformed duration. Before,P1Hgave 3600 andPTH1Mgave 60. A time designator needs theT, and every designator needs a number.
@svta/cml-cmaf-ham v0.25.0
Changed
Track.urlis optional. An HLS audio rendition without aURIattribute maps to a track without a URL, and the HLS writer already falls back to<id>.m3u8for that case. TypeScript consumers that readtrack.urlas astringneed to handleundefined.addMetadataToHlsstoresversionandmediaSequenceas strings when the parsed HLS manifest has them. Before, an inverted check stored the value only when it was missing. Nothing in the package reads these entries.- The HLS mapper types describe the fields the mapper reads.
PlayList.attributesaddsLANGUAGEandFRAME-RATE, theMediaGroupsitems add an optionaluri, andHlsManifestaddsversionandmediaSequence.audioGroupsToSwitchingSetsandsubtitleGroupsToSwitchingSetstake the typed media groups instead ofany.Mapper.getManifestMetadataandHlsMapper.getManifestMetadatareturnJSON | undefined, the type thatDashMapperandMapperContextalready declare. - The README now has a When to use section. The section names the tasks that the package covers and the entry point of each task.
- The overview in
src/README.mdlinks the documentation at https://cml.svta.org/. getUrlFromTemplateandgetInitializationUrlresolve the segment URL templates withprocessUriTemplatefrom@svta/cml-dash, a new peer dependency. The templates now resolve$Bandwidth$,$Time$,$$, and a%0<width>dtag of any width, so$Number%05d$gives00001instead of1. A token outside the template grammar, such as$Number%d$, stays in the URL unchanged instead of becoming the plain number.@svta/cml-iso-8601is a new peer dependency.iso8601DurationToNumbertrims the value and decodes it withdecodeIso8601Durationfrom that package. A year counts as 365 days and a month as 30 days.- The DASH and HLS mapper helpers write nothing to the console.
getCodec,getSar,getContentType,getChannels,getFrameRate,getSampleRate,getLanguage,mapSegments,getDuration, andparseHlsManifestreturn their documented default for a missing value, without a log. Before, each of these helpers also wrote an error or info line to the console. Period.$.durationis optional, as in the DASH specification.getPeriodDurationderives the duration of a Period without the attribute. TypeScript consumers that readperiod.$.durationas astringneed to handleundefined.
Removed
numberToIso8601Duration. UseencodeIso8601Durationfrom@svta/cml-iso-8601, which gives the same string.
Fixed
iso8601DurationToNumberadds the days of a duration and reads the minutes after theTdesignator. Before,P1DT1Hgave 3600 andP0Y0M0DT0H1M30.000Sgave 30.dashToHamnow derives the duration of a Period without adurationattribute. The Period ends at the start of the next Period or at themediaPresentationDurationof the MPD. Before, such a Period had duration 0 and aSegmentTemplatetrack had no segments.
@svta/cml-utils v1.7.0
Added
getTransferDurationreturns the milliseconds fromresponseStartto the end of aResourceTimingsample, ordurationwhen the sample has noresponseStart(#587)getTimeToFirstBytereturns the milliseconds fromstartTimetoresponseStartof aResourceTimingsample, orNaNwhen the sample has noresponseStartinside the response. The result andgetTransferDurationadd up toduration(#587)
Changed
getBandwidthBpsdivides the body size by the transfer duration fromgetTransferDuration. For a sample withresponseStart, the wait for the first byte no longer lowers the rate. A 112 kB body that waited 800 ms and transferred in 50 ms now measures 17.9 Mbps instead of 1.05 Mbps (#587)decodeBase64andencodeTextnow returnUint8Array<ArrayBuffer>. The result passes to Web APIs such ascrypto.subtle.digestwithout a cast under TypeScript 6 and later. The type declarations now need TypeScript 5.7 or later.- The README now has a When to use section. The section names the tasks that the package covers and the entry point of each task.
@svta/cml-throughput v1.2.0
Added
EwmaEstimatorOptions.minTransferDuration: the shortest transfer, in milliseconds, that counts as a sample. A body that arrives within a few milliseconds of its headers came from a cache. shaka-player uses 5. Default 0 (#587)
Changed
- Every estimator measures a sample over its transfer, from
responseStartto the end of the response, when the sample hasresponseStart.EwmaEstimatoralso weights the sample by that transfer. Before, the rate and the weight included the wait for the first byte, so a 112 kB live segment on a connection with an 800 ms wait measured about 1 Mbps and carried 0.85 s of weight (#587) - Every estimator ignores a sample whose body arrived with its first byte, a transfer of 0 ms.
- The README now has a When to use section. The section names the tasks that the package covers and the entry point of each task.
@svta/cml-cmcd v2.8.4
Changed
recordResponseReceivedderivesttfbwithgetTimeToFirstBytefrom@svta/cml-utils. The report omitsttfbwhenresponseStartis beforestartTimeor after the end of the response, or whendurationis missing. Before, the report heldresponseStart - startTimefor anyresponseStart(#587).- The
validateCmcdEventReportdoc now renders the example code block. The docs build no longer warns about the@exampletag. - The README now has a When to use section. The section names the tasks that the package covers and the entry point of each task.
- Every code example in the guides now typechecks. The
recordResponseReceivedexamples now includeencodedBodySize(#565).
@svta/cml-abr v0.3.0
Added
ThroughputSelectorOptions.ignoreTimeToFirstByte. Whentrue, the selector ignores the time to first byte in every pick and in the starvation guard. Defaultfalse.
Changed
- The starvation guard of both selectors adds the time to first byte to the download time of a rung. The value is the mean of
responseStart - startTimeover the last four finished samples. The guard ignores a sample whoseresponseStartis missing or outside the response (#587) - When a call has
segmentDuration, the throughput selector picks the highest rung whose download fits in one segment. The download time is the time to first byte plus the transfer atthroughput * safetyFactor. Before, the pick was the highest rung at or belowthroughput * safetyFactor / playbackRate. - The BOLA startup pick and oscillation guard bound the pick by the download time of one segment at
throughput * safetyFactor, with a budget ofsegmentDuration / playbackRate. Before, both used the highest rung at or belowthroughput * safetyFactorand ignoredplaybackRate. The buffer score, the placeholder, and the delay do not change. - The README states that the throughput selector accepts a
selectcall during a download and that BOLA does not. - The README now has a When to use section. The section names the tasks that the package covers and the entry point of each task.
- The README no longer describes the peer dependencies. The website lists them from
package.jsonon the package page.