Source code

Revision control

Copy as Markdown

Other Tools

<!DOCTYPE html>
<title>Test if video is playing on remote device</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/media.js"></script>
setup({ explicit_timeout: true });
button {
padding: 2em;
<div id="pick-device">
Click the button below to prompt for a remote playback device and select
<button id="prompt-button">Pick device</button>
<video src="/media/green-at-15.mp4" id="video"></video>
<div id="evaluate" style="display: none">
<p>Does the video play back on the remote device?</p>
<button id="yes">Yes</button>
<button id="no">No</button>
let v = document.getElementById("video");
async_test(t => {
let button = document.getElementById("prompt-button");
button.onclick = t.step_func(() => {
promise_test(() => {
return v.remote.prompt().then(() => {;
document.getElementById("evaluate").style.display = "block";
}, "Prompt resolves");
let evaluate = success =>
assert_true(success, "Video paused and has correct play position.");
document.getElementById("yes").onclick = t.step_func_done(() =>
document.getElementById("no").onclick = t.step_func_done(() =>
}, "Test if video is playing on remote device.");