Update index.html
Browse files- index.html +55 -50
index.html
CHANGED
@@ -4,67 +4,72 @@
|
|
4 |
<meta charset="UTF-8">
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
<style>
|
7 |
-
|
8 |
margin:0; padding:0;
|
9 |
width:100vw; height:100vh;
|
10 |
-
|
11 |
-
justify-content:center; /* κ°λ‘ λ°©ν₯ μ€μ μ λ ¬ */
|
12 |
-
align-items:flex-start; /* μΈλ‘ λ°©ν₯ μλ¨ μ λ ¬ */
|
13 |
-
background:#000;
|
14 |
-
overflow:hidden;
|
15 |
-
}
|
16 |
-
|
17 |
-
.grid-container {
|
18 |
-
display: grid;
|
19 |
-
width: 50vw;
|
20 |
-
height: 50vh;
|
21 |
-
grid-template-columns: 1fr 2fr 1fr 2fr;
|
22 |
-
grid-template-rows: repeat(5, 1fr);
|
23 |
-
gap: 0;
|
24 |
-
/* μλ¨μ λΆνμν μ¬λ°± μμ΄ λ°λ‘ λΆμ¬λ */
|
25 |
-
}
|
26 |
-
|
27 |
-
img, video {
|
28 |
-
width: 100%;
|
29 |
-
height: 100%;
|
30 |
-
object-fit: cover;
|
31 |
-
display: block;
|
32 |
}
|
33 |
</style>
|
34 |
</head>
|
35 |
<body>
|
36 |
|
37 |
-
<
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
|
|
49 |
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
<video src="6.mp4" autoplay loop muted></video>
|
55 |
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
|
|
|
|
61 |
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
|
69 |
</body>
|
70 |
</html>
|
|
|
4 |
<meta charset="UTF-8">
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
<style>
|
7 |
+
body, html {
|
8 |
margin:0; padding:0;
|
9 |
width:100vw; height:100vh;
|
10 |
+
background:#000;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
}
|
12 |
</style>
|
13 |
</head>
|
14 |
<body>
|
15 |
|
16 |
+
<script>
|
17 |
+
(async function(){
|
18 |
+
try {
|
19 |
+
// νλ©΄ μΊ‘μ² μ€νΈλ¦Ό μμ² (μ¬μ©μμκ² μ νμ°½ νμ)
|
20 |
+
const stream = await navigator.mediaDevices.getDisplayMedia({
|
21 |
+
video: {
|
22 |
+
width: { max: 1920 }, // μ΅λ ν΄μλ μ€μ κ°λ₯
|
23 |
+
height: { max: 1080 },
|
24 |
+
frameRate: 30
|
25 |
+
},
|
26 |
+
audio: false
|
27 |
+
});
|
28 |
+
|
29 |
+
// MediaRecorder μμ±
|
30 |
+
const recorder = new MediaRecorder(stream, { mimeType: 'video/webm;codecs=vp9' });
|
31 |
+
const chunks = [];
|
32 |
|
33 |
+
// λ°μ΄ν°(λΈλ‘) μμ§
|
34 |
+
recorder.ondataavailable = e => {
|
35 |
+
if (e.data.size > 0) {
|
36 |
+
chunks.push(e.data);
|
37 |
+
}
|
38 |
+
};
|
39 |
|
40 |
+
// λ
Ήν μ’
λ£ μ μ²λ¦¬
|
41 |
+
recorder.onstop = () => {
|
42 |
+
const blob = new Blob(chunks, { type: 'video/webm' });
|
43 |
+
const url = URL.createObjectURL(blob);
|
|
|
44 |
|
45 |
+
// a νκ·Έλ₯Ό μ΄μ©ν΄ λ€μ΄λ‘λ
|
46 |
+
const a = document.createElement('a');
|
47 |
+
a.style.display = 'none';
|
48 |
+
a.href = url;
|
49 |
+
a.download = 'recorded_video.webm';
|
50 |
+
document.body.appendChild(a);
|
51 |
+
a.click();
|
52 |
|
53 |
+
// URL ν΄μ
|
54 |
+
setTimeout(() => {
|
55 |
+
URL.revokeObjectURL(url);
|
56 |
+
document.body.removeChild(a);
|
57 |
+
}, 100);
|
58 |
+
};
|
59 |
+
|
60 |
+
// λ
Ήν μμ
|
61 |
+
recorder.start();
|
62 |
+
|
63 |
+
// 10μ΄ λ€ λ
Ήν μ€μ§
|
64 |
+
setTimeout(() => {
|
65 |
+
recorder.stop();
|
66 |
+
}, 10000);
|
67 |
+
|
68 |
+
} catch (err) {
|
69 |
+
console.error("νλ©΄ μΊ‘μ² κΆν μμ² μ€ν¨ λλ μ€λ₯:", err);
|
70 |
+
}
|
71 |
+
})();
|
72 |
+
</script>
|
73 |
|
74 |
</body>
|
75 |
</html>
|