🎥 Make videos programmatically with React
parse mp4 only partially
Jonny Burger43ce20802ee2
diff --git a/packages/media-parser/src/test/parse-mp4-partially.test.ts b/packages/media-parser/src/test/parse-mp4-partially.test.tsindex 00d5301388..7a2ee7e730 100644--- a/packages/media-parser/src/test/parse-mp4-partially.test.ts+++ b/packages/media-parser/src/test/parse-mp4-partially.test.ts@@ -21,3 +21,44 @@ test('Should be able to parse only header of MP4', async () => {skippedBytes: 26326,});});++test('Should be able to parse only tracks of MP4', async () => {+ const parsed = await parseMedia({+ src: exampleVideos.mp4withmp3,+ fields: {+ size: true,+ container: true,+ name: true,+ internalStats: true,+ tracks: true,+ },+ reader: nodeReader,+ });++ expect(parsed.container).toBe('mp4');+ expect(parsed.internalStats).toEqual({+ finalCursorOffset: 1621,+ skippedBytes: 24737,+ });+});++test('Should read the whole file', async () => {+ const parsed = await parseMedia({+ src: exampleVideos.mp4withmp3,+ fields: {+ size: true,+ container: true,+ name: true,+ internalStats: true,+ tracks: true,+ structure: true,+ },+ reader: nodeReader,+ });++ expect(parsed.container).toBe('mp4');+ expect(parsed.internalStats).toEqual({+ finalCursorOffset: parsed.size,+ skippedBytes: 0,+ });+});