Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A common library for media playback in JavaScript

License

NotificationsYou must be signed in to change notification settings

streaming-video-technology-alliance/common-media-library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A common library for media playback in JavaScript

Looking at open source players likehls.js,dash.js, andshaka-player there are common pieces of functionality that have been implemented independently across the libraries. This is particularly true when looking at standards based features, like ID3 parsing, 608 parsing and CMCD. Since the functionality is shared in spirit but not implementation, they can fall out of sync where certain bugs are fixed in one player but not the others. The goal of this library is to create a single place where these utilities can be maintained and distributed.

Project structure

This project is a mono-repo with the following workspaces:lib,docs. Thelib package contains the compiled code for the library which is published to npm. Thedocs package contains the documentation for the library and is published to GitHub pages.

Installation

npm install @svta/common-media-library

Usage

Too ensure the smallest bundle sizes possible, it is best practice to import all members and type definitionsindividually from the library.

import{appendCmcdQuery}from'@svta/common-media-library/cmcd/appendCmcdQuery';import{CmcdObjectType}from'@svta/common-media-library/cmcd/CmcdObjectType';constcmcd={sid:'4f2867f2-b0fd-4db7-a3e0-cea7dff44cfb',cid:'cc002fc3-d9e1-418d-9a5f-3d0eac601882',d:324.69,ot:CmcdObjectType.MANIFEST,['com.example-hello']:'world',};constcmcdUrl=appendCmcdQuery('https://example.com/playlist.m3u8',cmcd);console.log(cmcdUrl);// https://example.com/playlist.m3u8?CMCD=cid%3D%22cc002fc3-d9e1-418d-9a5f-3d0eac601882%22%2Ccom.example-hello%3D%22world%22%2Cd%3D325%2Cot%3Dm%2Csid%3D%224f2867f2-b0fd-4db7-a3e0-cea7dff44cfb%22

If bundle size isn't a concern, all members and type definitions can also be imported from the root of the library, or from the feature namespace.

import{appendCmcdQuery,CmcdObjectType}from'@svta/common-media-library';
import{appendCmcdQuery,CmcdObjectType}from'@svta/common-media-library/cmcd';

Documentation

API docs can be foundhere.

Thanks

This project builds upon the work of the open source community. Special thanks to the maintainers ofhls.js,dash.js,shaka-player, andstructured-field-values as well as organizations like theStreaming Video Technology Alliance,DASH Industry Forum, and theCTA WAVE Project.

About

A common library for media playback in JavaScript

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors14

Languages


[8]ページ先頭

©2009-2025 Movatter.jp