938a2f7f by Simeon Bateman Committed by David LaPalomento

added styp generator and default audio hdlr box

1 parent c9f97355
...@@ -33,6 +33,7 @@ DataView = window.DataView; ...@@ -33,6 +33,7 @@ DataView = window.DataView;
33 stsd: [], 33 stsd: [],
34 stsz: [], 34 stsz: [],
35 stts: [], 35 stts: [],
36 styp: [],
36 tfhd: [], 37 tfhd: [],
37 traf: [], 38 traf: [],
38 trak: [], 39 trak: [],
...@@ -71,6 +72,18 @@ DataView = window.DataView; ...@@ -71,6 +72,18 @@ DataView = window.DataView;
71 0x6f, 0x48, 0x61, 0x6e, 72 0x6f, 0x48, 0x61, 0x6e,
72 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'VideoHandler' 73 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'VideoHandler'
73 ]); 74 ]);
75 SOUND_HDLR = new Uint8Array([
76 0x00, // version 0
77 0x00, 0x00, 0x00, // flags
78 0x00, 0x00, 0x00, 0x00, // pre_defined
79 0x73, 0x6f, 0x75, 0x6e, // handler_type: 'soun'
80 0x00, 0x00, 0x00, 0x00, // reserved
81 0x00, 0x00, 0x00, 0x00, // reserved
82 0x00, 0x00, 0x00, 0x00, // reserved
83 0x56, 0x69, 0x64, 0x65,
84 0x6f, 0x48, 0x61, 0x6e,
85 0x73, 0x6f, 0x75, 0x6e, 0x00 // name: 'VideoHandler'
86 ]);
74 DREF = new Uint8Array([ 87 DREF = new Uint8Array([
75 0x00, // version 0 88 0x00, // version 0
76 0x00, 0x00, 0x00, // flags 89 0x00, 0x00, 0x00, // flags
...@@ -296,6 +309,10 @@ stsd = function(width, height) { ...@@ -296,6 +309,10 @@ stsd = function(width, height) {
296 )); 309 ));
297 }; 310 };
298 311
312 styp = function() {
313 return box(types.styp, MAJOR_BRAND, MINOR_VERSION, MAJOR_BRAND);
314 };
315
299 tkhd = function(duration, width, height) { 316 tkhd = function(duration, width, height) {
300 return box(types.tkhd, new Uint8Array([ 317 return box(types.tkhd, new Uint8Array([
301 0x00, // version 0 318 0x00, // version 0
......