mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-28 11:23:45 +02:00
fix(input-format): recognise CMAF segments that start with sidx
Sibling case to #308: when a fragmented MP4 segment begins with a sidx box (no ftyp/styp/moof at the file root), Mp4InputFormat._canReadInput returned false, causing Input.getTracks() to throw UnsupportedInputFormatError. This shape is standard in CMAF when the DASH on-demand profile is used or when HLS playlists are derived from one (Vimeo's vod-adaptive-ak CDN, for example). The segment is still a valid ISOBMFF fragment — the sidx just sits before the moof. Adds 'sidx' alongside the existing 'moof' check so the format probe accepts these segments, and a focused regression test that fails on the previous behaviour.
This commit is contained in:
+2
-1
@@ -120,7 +120,8 @@ export class Mp4InputFormat extends IsobmffInputFormat {
|
||||
if (slice instanceof Promise) slice = await slice;
|
||||
if (!slice) return false;
|
||||
|
||||
return readAscii(slice, 4) === 'moof'; // Seen in HLS for example
|
||||
const fourCc = readAscii(slice, 4);
|
||||
return fourCc === 'moof' || fourCc === 'sidx'; // Seen in HLS for example
|
||||
}
|
||||
|
||||
get name() {
|
||||
|
||||
Reference in New Issue
Block a user