mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
72 lines
2.3 KiB
HTML
72 lines
2.3 KiB
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<title>MSE: verify correct frames selected for given position</title>
|
|
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
<script type="text/javascript" src="mediasource.js"></script>
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
|
</head>
|
|
<body>
|
|
<pre id="test">
|
|
<script class="testbody" type="text/javascript">
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
runWithMSE(function (ms, v) {
|
|
ms.addEventListener("sourceopen", function () {
|
|
var sb = ms.addSourceBuffer("video/webm");
|
|
|
|
fetchWithXHR("seek.webm", function (arrayBuffer) {
|
|
// Append entire file covering range [0, 4].
|
|
sb.appendBuffer(new Uint8Array(arrayBuffer));
|
|
});
|
|
|
|
var targets = [{ currentTime: 3, videoWidth: 160, videoHeight: 120 },
|
|
{ currentTime: 2, videoWidth: 160, videoHeight: 120 },
|
|
{ currentTime: 0, videoWidth: 320, videoHeight: 240 }];
|
|
var target;
|
|
|
|
v.addEventListener("loadedmetadata", function () {
|
|
is(v.currentTime, 0, "currentTime has correct initial value");
|
|
is(v.videoWidth, 320, "videoWidth has correct initial value");
|
|
is(v.videoHeight, 240, "videoHeight has correct initial value");
|
|
|
|
fetchWithXHR("seek_lowres.webm", function (arrayBuffer) {
|
|
// Append initialization segment.
|
|
sb.appendBuffer(new Uint8Array(arrayBuffer, 0, 438));
|
|
var first = true;
|
|
sb.addEventListener("updateend", function () {
|
|
if (first) {
|
|
// Append media segment covering range [2, 4].
|
|
sb.appendBuffer(new Uint8Array(arrayBuffer, 51003));
|
|
first = false;
|
|
} else {
|
|
ms.endOfStream();
|
|
target = targets.shift();
|
|
v.currentTime = target.currentTime;
|
|
}
|
|
});
|
|
});
|
|
});
|
|
|
|
v.addEventListener("seeked", function () {
|
|
is(v.currentTime, target.currentTime, "Video currentTime at target");
|
|
|
|
is(v.videoWidth, target.videoWidth, "videoWidth has correct final value");
|
|
is(v.videoHeight, target.videoHeight, "videoHeight has correct final value");
|
|
|
|
target = targets.shift();
|
|
if (target) {
|
|
v.currentTime = target.currentTime;
|
|
} else {
|
|
SimpleTest.finish();
|
|
}
|
|
});
|
|
});
|
|
});
|
|
|
|
</script>
|
|
</pre>
|
|
</body>
|
|
</html>
|