mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Media fragment parser
This commit is contained in:
parent
95b304b786
commit
dc11219496
7 changed files with 464 additions and 11 deletions
|
@ -0,0 +1,48 @@
|
|||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title>Video should seek to time specified in media fragment syntax</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/media.js"></script>
|
||||
<div id="log"></div>
|
||||
<video id="video"></video>
|
||||
<script>
|
||||
async_test(function () {
|
||||
let video = document.getElementById("video");
|
||||
video.src = getVideoURI('/media/movie_5') + "#t=4,7";
|
||||
video.load();
|
||||
this.step_timeout(function () {
|
||||
assert_equals(video.currentTime, 4.0);
|
||||
|
||||
video.src = getVideoURI('/media/movie_5') + "#t=%6Ept:3";
|
||||
video.load();
|
||||
this.step_timeout(function () {
|
||||
assert_true(video.src.endsWith("t=%6Ept:3"));
|
||||
assert_equals(video.currentTime, 3.0);
|
||||
|
||||
video.src = getVideoURI('/media/movie_5') + "#t=00:00:01.00";
|
||||
video.load();
|
||||
this.step_timeout(function () {
|
||||
assert_true(video.src.endsWith("t=00:00:01.00"));
|
||||
assert_equals(video.currentTime, 1.0);
|
||||
|
||||
video.src = getVideoURI('/media/movie_5') + "#u=12&t=3";
|
||||
video.load();
|
||||
this.step_timeout(function () {
|
||||
assert_true(video.src.endsWith("#u=12&t=3"));
|
||||
assert_equals(video.currentTime, 3.0);
|
||||
|
||||
video.src = getVideoURI('/media/movie_5') + "#t=npt%3A3";
|
||||
video.load();
|
||||
this.step_timeout(function () {
|
||||
assert_true(video.src.endsWith("t=npt%3A3"));
|
||||
assert_equals(video.currentTime, 3.0);
|
||||
this.done();
|
||||
}, 1000);
|
||||
}, 1000);
|
||||
}, 1000);
|
||||
}, 1000);
|
||||
}, 1000);
|
||||
});
|
||||
</script>
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue