-
Notifications
You must be signed in to change notification settings - Fork 0
/
The Code Itself.html
51 lines (49 loc) · 1.18 KB
/
The Code Itself.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<!DOCTYPE html>
<html>
<head>
<title>Full Screen Video Demo</title>
<style>
body {
margin: 0;
padding: 0;
}
#video-container {
position: relative;
width: 100%;
height: 100vh;
overflow: hidden;
}
#video-container iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div id="video-container">
<iframe
width="560"
height="315"
src="https://www.youtube.com/embed/K-hXQuYpm0s"
title="YouTube video player"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen>
</iframe>
</div>
<script>
var videoContainer = document.getElementById('video-container');
function toggleFullScreen() {
if (!document.fullscreenElement) {
videoContainer.requestFullscreen();
} else {
document.exitFullscreen();
}
}
videoContainer.addEventListener('click', toggleFullScreen);
</script>
</body>
</html>