blob: 192e5dd0264f74338493af510f169c4e893dc927 [file] [log] [blame]
<html>
<head>
<title>Test presentation mode after entering fullscreen via Fullscreen API</title>
<script src="media-file.js"></script>
<script src="video-test.js"></script>
<script>
if (window.internals)
window.internals.settings.setAllowsPictureInPictureMediaPlayback(true);
var requestedFullscreen = false;
function init()
{
findMediaElement();
video.addEventListener('canplaythrough', oncanplaythrough);
video.src = findMediaFile('video', 'content/test');
}
function oncanplaythrough()
{
if (!('webkitSupportsPresentationMode' in video && 'webkitPresentationMode' in video)) {
failTest("Presentation mode is not supported in this video element.")
return;
}
testExpected("video.webkitPresentationMode", "inline");
video.addEventListener('webkitpresentationmodechanged', onpresentationmodechanged);
consoleWrite("Going into Full Screen");
runWithKeyDown(function(){ video.webkitRequestFullscreen(); });
requestedFullscreen = true;
}
function onpresentationmodechanged()
{
if (requestedFullscreen) {
testExpected("video.webkitPresentationMode", "fullscreen");
consoleWrite("Exiting Full Screen");
runWithKeyDown(function(){ video.webkitExitFullScreen(); });
requestedFullscreen = false;
return;
}
testExpected("video.webkitPresentationMode", "inline");
endTest();
}
</script>
</head>
<body onload="init()">
Tests that the video's presentation mode is updated accordingly after entering and exiting Full Screen<br>
<video controls></video>
</body>
</html>