@@ -275,22 +275,20 @@ export function parseInitSegment(initSegment: Uint8Array): InitData {
275275 soun : ElementaryStreamTypes . AUDIO as const ,
276276 vide : ElementaryStreamTypes . VIDEO as const ,
277277 } [ hdlrType ] ;
278+ // Parse codec details
279+ const stsdBox = findBox ( trak , [ 'mdia' , 'minf' , 'stbl' , 'stsd' ] ) [ 0 ] ;
280+ const stsd = parseStsd ( stsdBox ) ;
278281 if ( type ) {
279- // Parse codec details
280- const stsdBox = findBox ( trak , [ 'mdia' , 'minf' , 'stbl' , 'stsd' ] ) [ 0 ] ;
281- const stsd = parseStsd ( stsdBox ) ;
282- if ( type ) {
283- // Add 'audio', 'video', and 'audiovideo' track records that will map to SourceBuffers
284- result [ trackId ] = { timescale, type, stsd } ;
285- result [ type ] = { timescale, id : trackId , ...stsd } ;
286- } else {
287- // Add 'meta' and other track records required by `offsetStartDTS`
288- result [ trackId ] = {
289- timescale,
290- type : hdlrType as HdlrType ,
291- stsd,
292- } ;
293- }
282+ // Add 'audio', 'video', and 'audiovideo' track records that will map to SourceBuffers
283+ result [ trackId ] = { timescale, type, stsd } ;
284+ result [ type ] = { timescale, id : trackId , ...stsd } ;
285+ } else {
286+ // Add 'meta' and other track records required by `offsetStartDTS`
287+ result [ trackId ] = {
288+ timescale,
289+ type : hdlrType as HdlrType ,
290+ stsd,
291+ } ;
294292 }
295293 }
296294 }
0 commit comments