requestFullscreen() 예제
<button onclick="openFullscreen();">전체화면모드 열기</button> <p><strong>Tip:</strong> 전체화면모드 닫기 : ESC 키</p> <video width="100%" controls id="hz"> <source src="https://vt.tumblr.com/tumblr_o600t8hzf51qcbnq0_480.mp4" type="video/mp4"> </video> <script> var mp4 = document.getElementById("hz"); function openFullscreen() { if (mp4.requestFullscreen) { mp4.requestFullscreen(); } else if (mp4.mozRequestFullScreen) { /* Firefox */ mp4.mozRequestFullScreen(); } else if (mp4.webkitRequestFullscreen) { /* Chrome, Safari, Opera */ mp4.webkitRequestFullscreen(); } else if (mp4.msRequestFullscreen) { /* IE/Edge */ mp4.msRequestFullscreen(); } } </script> 결과보기
<button onclick="openFullscreen();">전체화면모드 열기</button>
<p><strong>Tip:</strong> 전체화면모드 닫기 : ESC 키</p>
<video width="100%" controls id="hz">
<source src="https://vt.tumblr.com/tumblr_o600t8hzf51qcbnq0_480.mp4" type="video/mp4">
</video>
<script>
var mp4 = document.getElementById("hz");
function openFullscreen() {
if (mp4.requestFullscreen) {
mp4.requestFullscreen();
} else if (mp4.mozRequestFullScreen) { /* Firefox */
mp4.mozRequestFullScreen();
} else if (mp4.webkitRequestFullscreen) { /* Chrome, Safari, Opera */
mp4.webkitRequestFullscreen();
} else if (mp4.msRequestFullscreen) { /* IE/Edge */
mp4.msRequestFullscreen();
}
</script>
결과보기