blob: 053842c487951231fd15ec425e98a2ffe444a357 [file] [log] [blame]
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Testing autoplay with getUserMedia</title>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script src=../media/media-file.js></script>
<script src=../media/video-test.js></script>
</head>
<body>
<video id="video1" loop autoplay playsInline></video>
<video id="video2" loop autoplay playsInline></video>
<script>
promise_test(async (test) => {
if (window.internals)
internals.setMediaElementRestrictions(video1, "");
video1.src = findMediaFile("video", "../media/content/audio-tracks");
await video1.play();
video2.srcObject = await navigator.mediaDevices.getUserMedia({ video : true });
while (video2.paused)
await new Promise(resolve => setTimeout(resolve, 50));
assert_false(video1.paused, "still playing video");
}, "Granting getUserMedia should not pause playing video element");
</script>
</body>
</html>