Browse Source
Boilerplate for the mp4 transmuxer
Boilerplate for the mp4 transmuxer
Add stubs for the transmuxer and a new set of qunit tests. Update the muxer mp4 test page to invoke the stubbed object.pull/6/head

6 changed files with 78 additions and 6 deletions
-
19src/transmuxer.js
-
1test/karma.conf.js
-
1test/localkarma.conf.js
-
21test/muxer/mp4.html
-
40test/transmuxer_test.js
-
2test/videojs-hls.html
@ -0,0 +1,19 @@ |
|||
/** |
|||
* A stream-based mp2t to mp4 converter. This utility is used to |
|||
* deliver mp4s to a SourceBuffer on platforms that support native |
|||
* Media Source Extensions. The equivalent process for Flash-based |
|||
* platforms can be found in segment-parser.js |
|||
*/ |
|||
(function(window, videojs, undefined) { |
|||
'use strict'; |
|||
|
|||
var Transmuxer = function() { |
|||
Transmuxer.prototype.init.call(this); |
|||
this.push = function() { |
|||
this.mp4 = new Uint8Array(); |
|||
}; |
|||
}; |
|||
Transmuxer.prototype = new videojs.Hls.Stream(); |
|||
|
|||
window.videojs.Hls.Transmuxer = Transmuxer; |
|||
})(window, window.videojs); |
@ -0,0 +1,40 @@ |
|||
(function(window, videojs) { |
|||
'use strict'; |
|||
/* |
|||
======== A Handy Little QUnit Reference ======== |
|||
http://api.qunitjs.com/
|
|||
|
|||
Test methods: |
|||
module(name, {[setup][ ,teardown]}) |
|||
test(name, callback) |
|||
expect(numberOfAssertions) |
|||
stop(increment) |
|||
start(decrement) |
|||
Test assertions: |
|||
ok(value, [message]) |
|||
equal(actual, expected, [message]) |
|||
notEqual(actual, expected, [message]) |
|||
deepEqual(actual, expected, [message]) |
|||
notDeepEqual(actual, expected, [message]) |
|||
strictEqual(actual, expected, [message]) |
|||
notStrictEqual(actual, expected, [message]) |
|||
throws(block, [expected], [message]) |
|||
*/ |
|||
var |
|||
Transmuxer = videojs.Hls.Transmuxer, |
|||
transmuxer; |
|||
|
|||
module('MP4 Transmuxer', { |
|||
setup: function() { |
|||
transmuxer = new Transmuxer(); |
|||
} |
|||
}); |
|||
|
|||
test('can mux an empty mp2t', function() { |
|||
transmuxer.push(new Uint8Array()); |
|||
|
|||
ok(transmuxer.mp4, 'produced a non-null result'); |
|||
strictEqual(transmuxer.mp4.byteLength, 0, 'produced an empty mp4'); |
|||
}); |
|||
|
|||
})(window, window.videojs); |
Write
Preview
Loading…
Cancel
Save
Reference in new issue