Skip to content

🎥 Make videos programmatically with React

fix test

Jonny Burgere9a3a5be2495
diff --git a/packages/video-parser/package.json b/packages/video-parser/package.json
index 15d601d3cc..3c41ae5c41 100644
--- a/packages/video-parser/package.json
+++ b/packages/video-parser/package.json
@@ -9,7 +9,7 @@
"scripts": {
"formatting": "prettier src --check",
"lint": "eslint src --ext ts,tsx",
- "test": "bun test",
+ "test": "bun test src/test",
"watch": "tsc -w"
},
"devDependencies": {
diff --git a/packages/video-parser/src/test/matroska.test.ts b/packages/video-parser/src/test/matroska.test.ts
index 4d79dfa650..50a1910488 100644
--- a/packages/video-parser/src/test/matroska.test.ts
+++ b/packages/video-parser/src/test/matroska.test.ts
@@ -12,6 +12,7 @@ test('Should get duration of AV1 video', async () => {
},
nodeReader,
);
+
expect(parsed.boxes).toEqual([
{
type: 'main-segment',
@@ -23,36 +24,48 @@ test('Should get duration of AV1 video', async () => {
{
type: 'seek-segment',
seekId: '0x1549a966',
- child: {type: 'seek-position-segment', seekPosition: 161},
+ child: {
+ type: 'seek-position-segment',
+ seekPosition: 161,
+ },
},
{
type: 'seek-segment',
seekId: '0x1654ae6b',
- child: {type: 'seek-position-segment', seekPosition: 214},
+ child: {
+ type: 'seek-position-segment',
+ seekPosition: 214,
+ },
},
{
type: 'seek-segment',
seekId: '0x1254c367',
- child: {type: 'seek-position-segment', seekPosition: 322},
+ child: {
+ type: 'seek-position-segment',
+ seekPosition: 322,
+ },
},
{
type: 'seek-segment',
seekId: '0x1c53bb6b',
- child: {type: 'seek-position-segment', seekPosition: 347329},
+ child: {
+ type: 'seek-position-segment',
+ seekPosition: 347329,
+ },
},
],
},
{
- length: 88,
type: 'void-segment',
+ length: 88,
},
{
- length: 48,
type: 'info-segment',
+ length: 48,
children: [
{
- timestampScale: 1000000,
type: 'timestamp-scale-segment',
+ timestampScale: 1000000,
},
{
type: 'muxing-app-segment',
@@ -63,8 +76,8 @@ test('Should get duration of AV1 video', async () => {
value: 'Lavf60.3.100',
},
{
- duration: 1000,
type: 'duration-segment',
+ duration: 1000,
},
],
},
@@ -72,13 +85,51 @@ test('Should get duration of AV1 video', async () => {
type: 'tracks-segment',
children: [
{
- id: '0xae',
- type: 'unknown-segment',
+ type: 'track-entry-segment',
+ children: [
+ {
+ type: 'track-number-segment',
+ trackNumber: 1,
+ },
+ {
+ type: 'track-uid-segment',
+ trackUid: 'ab2171012bb9020a',
+ },
+ {
+ type: 'flag-lacing-segment',
+ lacing: false,
+ },
+ {
+ type: 'language-segment',
+ language: 'und',
+ },
+ {
+ type: 'codec-segment',
+ codec: 'V_AV1',
+ },
+ {
+ type: 'track-type-segment',
+ trackType: 1,
+ },
+ {
+ type: 'default-duration-segment',
+ defaultDuration: 40000000,
+ },
+ {
+ type: 'video-segment',
+ children: [
+ {
+ id: '0x3855b090',
+ type: 'unknown-segment',
+ },
+ ],
+ },
+ ],
},
],
},
{
- id: '0x1254c367',
+ id: '0xc71013c2',
type: 'unknown-segment',
},
],