soiz1 commited on
Commit
5d4dad4
·
verified ·
1 Parent(s): 61e0703

Create index.html

Browse files
Files changed (1) hide show
  1. index.html +72 -18
index.html CHANGED
@@ -1,19 +1,73 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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>