hihihi934 commited on
Commit
8a4d760
·
verified ·
1 Parent(s): da7b687

Create why.html

Browse files
Files changed (1) hide show
  1. why.html +56 -0
why.html ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>full screen video</title>
7
+ <style>
8
+ * {
9
+ margin: 0;
10
+ padding: 0;
11
+ overflow: hidden;
12
+ }
13
+ html, body {
14
+ height: 100%;
15
+ background: black;
16
+ }
17
+ video {
18
+ position: fixed;
19
+ top: 50%;
20
+ left: 50%;
21
+ min-width: 100%;
22
+ min-height: 100%;
23
+ width: auto;
24
+ height: auto;
25
+ transform: translate(-50%, -50%);
26
+ object-fit: cover;
27
+ }
28
+ </style>
29
+ </head>
30
+ <body>
31
+
32
+ <video id="myVideo" autoplay playsinline>
33
+ <source src="YOUR_VIDEO.mp4" type="video/mp4">
34
+ <!-- add more formats if you want -->
35
+ <!-- <source src="yourvideo.webm" type="video/webm"> -->
36
+ </video>
37
+
38
+ <script>
39
+ const video = document.getElementById('myVideo');
40
+
41
+ // when video finishes playing, close the tab
42
+ video.addEventListener('ended', () => {
43
+ window.close();
44
+ });
45
+
46
+ // optional: make it loop once before closing if you want, but you said close when it finishes
47
+ // video.loop = false; // default is already false
48
+
49
+ // force video to play (some browsers are strict)
50
+ video.play().catch(e => {
51
+ console.log("autoplay blocked, user needs to interact");
52
+ });
53
+ </script>
54
+
55
+ </body>
56
+ </html>