Skip to content

🎥 Make videos programmatically with React

small correction

Jonny Burger4f5089026c0d
diff --git a/packages/media-parser/src/samples-from-moof.ts b/packages/media-parser/src/samples-from-moof.ts
index d9212a444e..05ae55e28b 100644
--- a/packages/media-parser/src/samples-from-moof.ts
+++ b/packages/media-parser/src/samples-from-moof.ts
@@ -20,13 +20,14 @@ const getSamplesFromTraf = (
const tfhdBox = getTfhdBox(trafSegment);
const trexBox = trexBoxes.find((t) => t.trackId === tfhdBox?.trackId) ?? null;
- // intentional || instead of ?? to allow for 0
+ // intentional || instead of ?? to allow for 0, doesn't make sense for duration or size
const defaultTrackSampleDuration =
tfhdBox?.defaultSampleDuration || trexBox?.defaultSampleDuration || null;
const defaultTrackSampleSize =
tfhdBox?.defaultSampleSize || trexBox?.defaultSampleSize || null;
+ // but flags may just be 0 :)
const defaultTrackSampleFlags =
- tfhdBox?.defaultSampleFlags || trexBox?.defaultSampleFlags || null;
+ tfhdBox?.defaultSampleFlags ?? trexBox?.defaultSampleFlags ?? null;
const tfdtBox = getTfdtBox(trafSegment);
const trunBoxes = getTrunBoxes(trafSegment);