npm.io
1.0.10 • Published 5d ago

@svta/cml-dash

Licence
Apache-2.0
Version
1.0.10
Deps
0
Size
22 kB
Vulns
0
Weekly
0
Stars
86

@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
);
console.log(result);
// http://example.com/rep1/1/2/3/04/$

// Parse frame rate
const frameRate = parseFrameRate("24000/1001");
console.log(frameRate);
// 23.976023976023978

Keywords