mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Implement srcObject logic for Blob media providers
This commit is contained in:
parent
3c27dc993d
commit
d15640081c
4 changed files with 115 additions and 14 deletions
|
@ -0,0 +1,31 @@
|
|||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title>HTMLMediaElement.srcObject blob</title>
|
||||
<script src='/common/media.js'></script>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<video></video>
|
||||
<script>
|
||||
async_test(function(t) {
|
||||
t.step(function() {
|
||||
fetch(getVideoURI('/media/movie_5'))
|
||||
.then(function(response) {
|
||||
return response.blob();
|
||||
})
|
||||
.then(function(blob) {
|
||||
let video = document.querySelector("video");
|
||||
video.srcObject = blob;
|
||||
video.addEventListener('ended', function() {
|
||||
t.done();
|
||||
});
|
||||
video.play().catch(function(error) {
|
||||
assert(false, error);
|
||||
});
|
||||
})
|
||||
.catch(function(error) {
|
||||
assert(false, error);
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue