blob: 648eafacfa9f364138027d93d9d33ece8278c535 [file] [log] [blame]
<!DOCTYPE html>
<title>Verify video play using media stream as video src.</title>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<video autoplay></video>
<script>
async_test(function(t) {
var video = document.querySelector("video");
navigator.webkitGetUserMedia({video:true}, function(stream) {
video.ontimeupdate = t.step_func(function() {
// restart preview.
video.srcObject = stream;
video.ontimeupdate = t.step_func_done();
});
//start preview.
video.srcObject = stream;
}, getStreamFailed);
function getStreamFailed(error) {
t.unreached_func();
}
video.onerror = t.unreached_func();
video.onloadstart = t.step_func(function() {});
video.onloadeddata = t.step_func(function() {});
video.oncanplay = t.step_func(function() {});
video.onplay = t.step_func(function() {});
video.oncanplaythrough = t.step_func(function() {});
});
</script>