gecko-dev/dom/media/test/test_streams_autoplay.html
Jan-Ivar Bruaroey 0ccb51ddc8 Bug 1175523 - Update most (but not all) tests to use elem.srcObject over .mozSrcObject. r=pehrsons
--HG--
extra : rebase_source : bac0027f4bf5d75b8730c44a10141c114002633b
2015-07-14 10:12:31 -04:00

38 lines
936 B
HTML

<!DOCTYPE HTML>
<html>
<head>
<title>Test that a MediaStream source triggers autoplay</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<script type="text/javascript" src="manifest.js"></script>
</head>
<body>
<video id="v1" autoplay></video>
<video id="v2" autoplay></video>
<pre id="test">
<script class="testbody" type="text/javascript">
SimpleTest.waitForExplicitFinish();
var media = getPlayableVideo(gSmallTests);
if (media == null) {
todo(false, "No media supported.");
SimpleTest.finish();
} else {
v1.src = media.name;
v2.srcObject = v1.mozCaptureStream();
var onPlayingEventFired = false;
v2.onplaying = function() {
if(!onPlayingEventFired) {
onPlayingEventFired = true;
ok(true, "playback started");
SimpleTest.finish();
}
}
}
</script>
</pre>
</body>
</html>