Revision f826720212822414b003f8a483bff66e52e37e4b authored by askalski on 31 March 2016, 16:47:30 UTC, committed by James Graham on 31 March 2016, 16:47:36 UTC
1 parent 921a375
mediasource-play.html
<!DOCTYPE html>
<html>
<head>
<title>Simple MediaSource playback test case.</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="mediasource-util.js"></script>
</head>
<body>
<div id="log"></div>
<script>
mediasource_testafterdataloaded(function(test, mediaElement, mediaSource, segmentInfo, sourceBuffer, mediaData)
{
mediaElement.addEventListener('error', test.unreached_func("Unexpected event 'error'"));
mediaElement.addEventListener('ended', test.step_func_done());
test.expectEvent(sourceBuffer, 'updatestart', 'sourceBuffer');
test.expectEvent(sourceBuffer, 'update', 'sourceBuffer');
test.expectEvent(sourceBuffer, 'updateend', 'sourceBuffer');
sourceBuffer.appendBuffer(mediaData);
test.waitForExpectedEvents(function()
{
assert_false(sourceBuffer.updating, "updating");
assert_greater_than(mediaSource.duration, 1, "duration");
mediaSource.duration = 1;
assert_true(sourceBuffer.updating, "updating");
test.expectEvent(sourceBuffer, 'updatestart', 'sourceBuffer');
test.expectEvent(sourceBuffer, 'update', 'sourceBuffer');
test.expectEvent(sourceBuffer, 'updateend', 'sourceBuffer');
});
test.waitForExpectedEvents(function()
{
mediaSource.endOfStream();
mediaElement.play();
});
}, "Test normal playback case with MediaSource API");
</script>
</body>
</html>
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...