Skip to content

About

A common library for media playback in JavaScript

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

86 stars

Watchers

8 watching

Forks

Latest commit

 

History

519 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Common Media Library

A common library for media playback in JavaScript

Open source players such as hls.js, dash.js, and shaka-player implement many of the same features independently. This duplication is especially common for standards-based features, such as ID3 parsing, 608 parsing, and CMCD. The players share the intent of these features but not the code. A bug fixed in one player can remain in the others. The goal of this library is to create one place where these utilities can be maintained and distributed.

Documentation

Read the documentation on the website. Every package has a page with the overview, the guides, the API reference, and the changelog.

Guides:

The releases page lists the changelog entries of every package.

Install

Install one of the libraries with npm:

npm i @svta/cml-cmcd

The type declarations need TypeScript 5.7 or later.

Usage

import { appendCmcdQuery, CmcdObjectType } from "@svta/cml-cmcd";

const cmcd = {
	sid: "4f2867f2-b0fd-4db7-a3e0-cea7dff44cfb",
	cid: "cc002fc3-d9e1-418d-9a5f-3d0eac601882",
	d: 4004.37,
	ot: CmcdObjectType.VIDEO,
	["com.example-hello"]: "world",
};

const cmcdUrl = appendCmcdQuery("https://example.com/video/segment-1.m4s", cmcd);
console.log(cmcdUrl);
// https://example.com/video/segment-1.m4s?CMCD=cid%3D%22cc002fc3-d9e1-418d-9a5f-3d0eac601882%22%2Ccom.example-hello%3D%22world%22%2Cd%3D4004%2Cot%3Dv%2Csid%3D%224f2867f2-b0fd-4db7-a3e0-cea7dff44cfb%22%2Cv%3D2

Coding agents

The repository ships a skill that tells a coding agent which package covers a media playback task. Install the skill in a player project:

npx skills add streaming-video-technology-alliance/common-media-library

Agents that read documentation from the web can begin with llms.txt.

Community

If you need help with the Common Media Library, or if you want to talk with other members:

Contributing

The Common Media Library is free and open source. We welcome help of any kind: fixing bugs, improving documentation, or suggesting new features. Read the contributing guide for details. The SVTA Players and Playback working group oversees contributions and project decisions.

Code of Conduct

This project has a Contributor Code of Conduct. By participating in this project, you agree to follow its terms.

Thanks

This project builds on the work of the open source community. Special thanks to the maintainers of hls.js, dash.js, shaka-player, video.js, and structured-field-values. Thanks also to the Streaming Video Technology Alliance, the DASH Industry Forum, and the CTA WAVE Project.

About

A common library for media playback in JavaScript

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

86 stars

Watchers

8 watching

Forks

Releases

Packages

Used by

Contributors

Languages