58 lines
1.8 KiB
HTML
58 lines
1.8 KiB
HTML
<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>
|
|
|