-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvideo.html
51 lines (48 loc) · 1.56 KB
/
video.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 lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Video Player</title>
<style>
/* Make sure the body takes up the full screen */
body, html {
margin: 0;
padding: 0;
height: 100%;
overflow: hidden;
}
video {
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<video id="myVideo" controls autoplay muted>
<!-- Replace the src with your video file path or URL -->
<source src="pick_is_in.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
<script>
// Wait until the DOM is fully loaded
document.addEventListener("DOMContentLoaded", function() {
const video = document.getElementById("myVideo");
// Attempt to go fullscreen
if (video.requestFullscreen) {
video.requestFullscreen();
} else if (video.mozRequestFullScreen) { // Firefox
video.mozRequestFullScreen();
} else if (video.webkitRequestFullscreen) { // Chrome, Safari and Opera
video.webkitRequestFullscreen();
} else if (video.msRequestFullscreen) { // IE/Edge
video.msRequestFullscreen();
}
// Play the video when it enters fullscreen mode
video.onloadeddata = function() {
video.play();
};
});
</script>
</body>
</html>