Files
JKVideo/utils/buildMpd.ts
Developer ee213347c7 feat: unified player controls with heatmap progress + thumbnail preview
- VideoPlayer: 移除 onProgress/seekTo props,新增 bvid/cid 向下透传
- [bvid].tsx: 删除 HeatProgressBar 及 currentTime/duration/seekCmd state
- HeatProgressBar.tsx: 删除(逻辑已合并进 NativeVideoPlayer)
- 计划文档已保存到 docs/superpowers/plans/
2026-03-10 21:48:23 +08:00

28 lines
1.0 KiB
TypeScript

// 构建 DASH MPD 文件内容
export function buildMpd(
videoUrl: string,
videoCodecs: string,
videoBandwidth: number,
audioUrl: string,
audioCodecs: string,
audioBandwidth: number,
): string {
return `<?xml version="1.0"?>
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011" type="static" mediaPresentationDuration="PT9999S">
<Period>
<AdaptationSet contentType="video" mimeType="video/mp4" segmentAlignment="true">
<Representation id="v1" codecs="${videoCodecs}" bandwidth="${videoBandwidth}">
<BaseURL>${videoUrl}</BaseURL>
<SegmentBase><Initialization range="0-999"/></SegmentBase>
</Representation>
</AdaptationSet>
<AdaptationSet contentType="audio" mimeType="audio/mp4">
<Representation id="a1" codecs="${audioCodecs}" bandwidth="${audioBandwidth}">
<BaseURL>${audioUrl}</BaseURL>
<SegmentBase><Initialization range="0-999"/></SegmentBase>
</Representation>
</AdaptationSet>
</Period>
</MPD>`;
}