40 lines
985 B
HTML
40 lines
985 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>audio-playback-restriction</title>
|
|
<script src=media-file.js></script>
|
|
<script src=video-test.js></script>
|
|
|
|
<script>
|
|
function runTest()
|
|
{
|
|
video = document.getElementsByTagName('audio')[0];
|
|
|
|
if (window.internals)
|
|
run('internals.setMediaElementRestrictions(video, "RequireUserGestureForAudioRateChange")');
|
|
|
|
waitForEventAndFail('error');
|
|
waitForEvent('canplaythrough', canplaythrough);
|
|
run("video.src = findMediaFile('audio', 'content/test')");
|
|
}
|
|
|
|
function canplaythrough()
|
|
{
|
|
run("setTimeout(timeout, 100)");
|
|
}
|
|
|
|
function timeout()
|
|
{
|
|
testExpected('video.paused', true);
|
|
endTest();
|
|
}
|
|
</script>
|
|
</head>
|
|
|
|
<body onload="runTest()">
|
|
<p>Test that, when RequireUserGestureForAudioRateChange is set, starting playback of an audio file requires a user gesture.</p>
|
|
<audio controls autoplay></audio>
|
|
</body>
|
|
</html>
|
|
|