1b73bdb0 by David LaPalomento

Hook up transmuxer to test page

Invoke the transmuxer on muxer/mp4.html and display the results of inspecting the output.
1 parent 5cfc5611
......@@ -161,23 +161,31 @@
reader.addEventListener('loadend', function() {
var segment = new Uint8Array(reader.result),
transmuxer = new videojs.mp2t.Transmuxer(),
events = [],
bytes,
hex = '';
transmuxer.on('data', function(data) {
if (data) {
console.log(data);
events.push(data.data);
}
});
transmuxer.push(segment);
transmuxer.end();
bytes = new Uint8Array(events[0].byteLength + events[1].byteLength);
bytes.set(events[0]);
bytes.set(events[1], events[0].byteLength);
console.log('transmuxed', videojs.inspectMp4(bytes))
// clear old box info
vjsBoxes.innerHTML = JSON.stringify(videojs.inspectMp4(bytes), null, ' ');
// write out the result
hex += '<pre>';
hex += 'nothing to see here';
hex += '</pre>';
vjsOutput.innerHTML = hex;
vjsBoxes.innerHTML = 'nothing to see here';
});
reader.readAsArrayBuffer(this.files[0]);
}, false);
......