Added parser and test for styp mp4 box
Showing
2 changed files
with
18 additions
and
0 deletions
... | @@ -582,6 +582,21 @@ test('can parse a video stsd', function() { | ... | @@ -582,6 +582,21 @@ test('can parse a video stsd', function() { |
582 | }]); | 582 | }]); |
583 | }); | 583 | }); |
584 | 584 | ||
585 | test('can parse an styp', function() { | ||
586 | deepEqual(videojs.inspectMp4(new Uint8Array(box('styp', | ||
587 | 0x61, 0x76, 0x63, 0x31, // major brand | ||
588 | 0x00, 0x00, 0x00, 0x02, // minor version | ||
589 | 0x00, 0x00, 0x00, 0x03, // compatible brands | ||
590 | 0x00, 0x00, 0x00, 0x04 // compatible brands | ||
591 | ))), [{ | ||
592 | type: 'styp', | ||
593 | size: 4 * 6, | ||
594 | majorBrand: 'avc1', | ||
595 | minorVersion: 2, | ||
596 | compatibleBrands: [3, 4] | ||
597 | }], 'parsed an ftyp'); | ||
598 | }); | ||
599 | |||
585 | test('can parse a vmhd', function() { | 600 | test('can parse a vmhd', function() { |
586 | var data = box('vmhd', | 601 | var data = box('vmhd', |
587 | 0x00, // version | 602 | 0x00, // version | ... | ... |
... | @@ -373,6 +373,9 @@ var | ... | @@ -373,6 +373,9 @@ var |
373 | } | 373 | } |
374 | return result; | 374 | return result; |
375 | }, | 375 | }, |
376 | styp: function(data) { | ||
377 | return parse.ftyp(data); | ||
378 | }, | ||
376 | tfhd: function(data) { | 379 | tfhd: function(data) { |
377 | var | 380 | var |
378 | view = new DataView(data.buffer, data.byteOffset, data.byteLength), | 381 | view = new DataView(data.buffer, data.byteOffset, data.byteLength), | ... | ... |
-
Please register or sign in to post a comment