blob: eabf4c8646ba0b3fcb41b7d85e178f8989b5a317 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<title>mock-media-source</title>
<script src="mock-media-source.js"></script>
<script src="../video-test.js"></script>
<script>
var source;
var sourceBuffer;
var initSegment;
if (window.internals)
internals.initializeMockMediaSource();
function runTest() {
findMediaElement();
source = new MediaSource();
waitForEventOn(source, 'sourceopen', sourceOpen);
run('video.src = URL.createObjectURL(source)');
}
function sourceOpen() {
run('sourceBuffer = source.addSourceBuffer("video/mock; codecs=mock")');
waitForEventOn(sourceBuffer, 'updatestart');
waitForEventOn(sourceBuffer, 'update');
waitForEventOn(sourceBuffer, 'error');
waitForEventOn(sourceBuffer, 'updateend');
waitForEventOn(source, 'sourceended', endTest);
initSegment = makeAnInvalidBox();
run('sourceBuffer.appendBuffer(initSegment)');
}
</script>
</head>
<body onload="runTest()">
<video></video>
</body>
</html>