MCPcopy Index your code
hub / github.com/nukeop/nuclear / parseInitSegment

Function parseInitSegment

packages/hifi/src/fmp4/parser.ts:102–121  ·  view source on GitHub ↗
(data: Uint8Array)

Source from the content-addressed store, hash-verified

100}
101
102export function parseInitSegment(data: Uint8Array): Fmp4Index {
103 const boxes = findBoxes(data);
104 const sidxBox = boxes.find((box) => box.type === 'sidx');
105
106 if (!sidxBox) {
107 throw new Error('No sidx box found in init segment');
108 }
109
110 const { references, timescale } = parseSidx(
111 data,
112 sidxBox.offset,
113 sidxBox.size,
114 );
115
116 return {
117 initSegmentEnd: sidxBox.offset,
118 segments: references,
119 timescale,
120 };
121}

Callers 2

initMethod · 0.90
parser.test.tsFile · 0.90

Calls 2

findBoxesFunction · 0.85
parseSidxFunction · 0.85

Tested by

no test coverage detected