@amazon/ vinyl- mpd- parser
一个快速的,有计划验证的 DASH 显示器,用于浏览器和节点. 参数
.mpd 文档输入一个显示 MPEG-DASH 2011 schema 的已输入对象,
内置支持 cenc 和 微软 PlayReady 内容保护
名称空间。 校对:Soup
无效文档的源位置.
安装
npm install @amazon/vinyl-mpd-parser
使用量
import { parseDashManifest } from '@amazon/vinyl-mpd-parser'
const text = await (await fetch(mpdUri)).text()
const manifest = parseDashManifest(text)
for (const period of manifest.MPD.Period) {
for (const adaptationSet of period.AdaptationSet ?? []) {
console.log(adaptationSet.contentType, adaptationSet.Representation)
}
}
解析器建在顶端 @amazon/vinyl-xml。扩展
规则设置, 添加命名空间, 合并自己的 XmlRules 输入解析器
遵循内部用于内容保护的相同模式.
许可证
阿帕奇 - 2.0