Spaces:
Running
Running
Create index.html
Browse files- index.html +72 -18
index.html
CHANGED
@@ -1,19 +1,73 @@
|
|
1 |
-
<!
|
2 |
-
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
</html>
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="ja">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<title>動画プレイヤー</title>
|
6 |
+
<style>
|
7 |
+
body {
|
8 |
+
display: flex;
|
9 |
+
flex-direction: column;
|
10 |
+
align-items: center;
|
11 |
+
background-color: #f0f0f0;
|
12 |
+
font-family: sans-serif;
|
13 |
+
padding: 20px;
|
14 |
+
}
|
15 |
+
video {
|
16 |
+
max-width: 100%;
|
17 |
+
height: auto;
|
18 |
+
margin-bottom: 10px;
|
19 |
+
}
|
20 |
+
.controls {
|
21 |
+
display: flex;
|
22 |
+
gap: 10px;
|
23 |
+
flex-wrap: wrap;
|
24 |
+
justify-content: center;
|
25 |
+
}
|
26 |
+
button, select {
|
27 |
+
padding: 5px 10px;
|
28 |
+
font-size: 16px;
|
29 |
+
}
|
30 |
+
</style>
|
31 |
+
</head>
|
32 |
+
<body>
|
33 |
+
<h1>動画プレイヤー</h1>
|
34 |
+
<video id="videoPlayer" src="v.mp4" controls loop></video>
|
35 |
+
|
36 |
+
<div class="controls">
|
37 |
+
<label for="speedSelect">再生速度:</label>
|
38 |
+
<select id="speedSelect">
|
39 |
+
<option value="0.5">0.5x</option>
|
40 |
+
<option value="1" selected>1x</option>
|
41 |
+
<option value="1.5">1.5x</option>
|
42 |
+
<option value="2">2x</option>
|
43 |
+
</select>
|
44 |
+
|
45 |
+
<button onclick="toggleLoop()">ループ切替</button>
|
46 |
+
<button onclick="goFullscreen()">全画面</button>
|
47 |
+
</div>
|
48 |
+
|
49 |
+
<script>
|
50 |
+
const video = document.getElementById('videoPlayer');
|
51 |
+
const speedSelect = document.getElementById('speedSelect');
|
52 |
+
|
53 |
+
speedSelect.addEventListener('change', () => {
|
54 |
+
video.playbackRate = parseFloat(speedSelect.value);
|
55 |
+
});
|
56 |
+
|
57 |
+
function toggleLoop() {
|
58 |
+
video.loop = !video.loop;
|
59 |
+
alert(`ループは ${video.loop ? '有効' : '無効'} になりました`);
|
60 |
+
}
|
61 |
+
|
62 |
+
function goFullscreen() {
|
63 |
+
if (video.requestFullscreen) {
|
64 |
+
video.requestFullscreen();
|
65 |
+
} else if (video.webkitRequestFullscreen) { // Safari対応
|
66 |
+
video.webkitRequestFullscreen();
|
67 |
+
} else if (video.msRequestFullscreen) { // IE対応
|
68 |
+
video.msRequestFullscreen();
|
69 |
+
}
|
70 |
+
}
|
71 |
+
</script>
|
72 |
+
</body>
|
73 |
</html>
|