npm.io
1.0.7 • Published 1h ago

@svta/cml-dash

Licence
Apache-2.0
Version
1.0.7
Deps
0
Size
22 kB
Vulns
0
Weekly
0
Stars
80

@svta/cml-dash

DASH manifest parsing functionality.

Installation

npm i @svta/cml-dash

Usage

import { processUriTemplate, parseFrameRate } from "@svta/cml-dash";

// Process URI template
const result = processUriTemplate(
	"http://example.com/$RepresentationID$/$Number$/$SubNumber$/$Bandwidth$/$Time%02d$/$",
	"rep1", // RepresentationID
	1, // Number
	2, // SubNumber
	3, // Bandwidth
	4 // Time
);

assert(result === "http://example.com/rep1/1/2/3/04/$");

// Parse frame rate
const frameRate = parseFrameRate("24000/1001");
assert(frameRate === 23.976023976023978);

Keywords