blob: 0eaf50f76a4f809b0a6871dc9384aa4650facb60 [file] [log] [blame]
<script src="../../../resources/js-test-pre.js"></script>
<script src="../resources/media-controls-loader.js" type="text/javascript"></script>
<script src="../resources/media-controls-utils.js" type="text/javascript"></script>
<body>
<style type="text/css" media="screen">
video, #host {
position: absolute;
top: 0;
left: 0;
width: 800px;
height: 240px;
}
</style>
<video src="../../content/test.mp4" controls autoplay></video>
<div id="host"></div>
<script type="text/javascript">
window.jsTestIsAsync = true;
description("Testing the <code>FullscreenSupport</code> behavior when clicking the fullscreen button.");
const container = document.querySelector("div#host");
const media = document.querySelector("video");
const mediaController = createControls(container, media, null);
scheduler.frameDidFire = function() {
if (media.paused)
return;
const button = mediaController.controls.fullscreenButton.element;
if (button.getBoundingClientRect().width === 0)
return;
media.pause();
pressOnElement(button);
scheduler.frameDidFire = null;
};
media.addEventListener(media.webkitPresentationMode ? "webkitpresentationmodechanged" : "webkitfullscreenchange", () => {
shouldBeTrue("media.webkitDisplayingFullscreen");
container.remove();
media.remove();
finishMediaControlsTest();
});
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>