blob: bb11efde41732c3492f80aeea6f34de53f50e0bb [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<title>media-source-resize</title>
<script src="media-source-loader.js"></script>
<script src="../video-test.js"></script>
<script>
var loader;
var source;
var sourceBuffer;
function loaderPromise(loader) {
return new Promise((resolve, reject) => {
loader.onload = resolve;
loader.onerror = reject;
});
}
window.addEventListener('load', async event => {
findMediaElement();
loader = new MediaSourceLoader('content/test-fragmented-manifest.json');
await loaderPromise(loader);
source = new MediaSource();
run('video.src = URL.createObjectURL(source)');
await waitFor(source, 'sourceopen');
waitFor(video, 'error').then(failTest);
run('sourceBuffer = source.addSourceBuffer(loader.type())');
run('sourceBuffer.appendBuffer(loader.initSegment())');
await waitFor(sourceBuffer, 'update');
consoleWrite('Append a media segment.')
run('sourceBuffer.appendBuffer(loader.mediaSegment(0))');
await waitFor(sourceBuffer, 'update');
run('video.play()');
await testExpectedEventually('internals.elementEffectivePlaybackRate(video)', 0, '!=');
endTest();
});
</script>
</head>
<body>
<video controls></video>
</body>
</html>