inoculatemedia commited on
Commit
01f382b
·
verified ·
1 Parent(s): 3b64012

Add 3 files

Browse files
Files changed (3) hide show
  1. README.md +7 -5
  2. index.html +378 -19
  3. prompts.txt +0 -0
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Hls Player And Recorder
3
- emoji: 👀
4
- colorFrom: pink
5
- colorTo: yellow
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: hls-player-and-recorder
3
+ emoji: 🐳
4
+ colorFrom: red
5
+ colorTo: gray
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,378 @@
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="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>NHLS Video Player with Save Feature</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
+ <style>
10
+ /* Custom CSS for video player */
11
+ .video-container {
12
+ position: relative;
13
+ max-width: 800px;
14
+ margin: 0 auto;
15
+ background-color: #000;
16
+ border-radius: 12px;
17
+ overflow: hidden;
18
+ box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
19
+ }
20
+
21
+ .video-controls {
22
+ position: absolute;
23
+ bottom: 0;
24
+ left: 0;
25
+ right: 0;
26
+ padding: 10px;
27
+ background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
28
+ opacity: 0;
29
+ transition: opacity 0.3s;
30
+ }
31
+
32
+ .video-container:hover .video-controls {
33
+ opacity: 1;
34
+ }
35
+
36
+ .progress-container {
37
+ height: 5px;
38
+ background-color: rgba(255, 255, 255, 0.2);
39
+ border-radius: 3px;
40
+ cursor: pointer;
41
+ }
42
+
43
+ .progress-bar {
44
+ height: 100%;
45
+ background-color: #3b82f6;
46
+ border-radius: 3px;
47
+ width: 0%;
48
+ }
49
+
50
+ .volume-container {
51
+ width: 100px;
52
+ }
53
+
54
+ .volume-slider {
55
+ width: 0;
56
+ transition: width 0.2s;
57
+ overflow: hidden;
58
+ }
59
+
60
+ .volume-btn:hover + .volume-slider, .volume-slider:hover {
61
+ width: 100px;
62
+ }
63
+
64
+ /* Animation for download button */
65
+ @keyframes pulse {
66
+ 0% { transform: scale(1); }
67
+ 50% { transform: scale(1.1); }
68
+ 100% { transform: scale(1); }
69
+ }
70
+
71
+ .download-btn:hover {
72
+ animation: pulse 1s infinite;
73
+ }
74
+
75
+ /* Custom scrollbar */
76
+ ::-webkit-scrollbar {
77
+ width: 8px;
78
+ }
79
+
80
+ ::-webkit-scrollbar-track {
81
+ background: #f1f1f1;
82
+ }
83
+
84
+ ::-webkit-scrollbar-thumb {
85
+ background: #888;
86
+ border-radius: 4px;
87
+ }
88
+
89
+ ::-webkit-scrollbar-thumb:hover {
90
+ background: #555;
91
+ }
92
+ </style>
93
+ </head>
94
+ <body class="bg-gray-900 text-white min-h-screen flex flex-col">
95
+ <header class="bg-gray-800 py-4 px-6 shadow-lg">
96
+ <div class="container mx-auto flex justify-between items-center">
97
+ <div class="flex items-center space-x-2">
98
+ <i class="fas fa-play-circle text-blue-500 text-3xl"></i>
99
+ <h1 class="text-2xl font-bold">NHLS Video Player</h1>
100
+ </div>
101
+ <div class="flex items-center space-x-4">
102
+ <button id="theme-toggle" class="p-2 rounded-full hover:bg-gray-700">
103
+ <i class="fas fa-moon"></i>
104
+ </button>
105
+ </div>
106
+ </div>
107
+ </header>
108
+
109
+ <main class="flex-grow container mx-auto px-4 py-8">
110
+ <div class="video-container group">
111
+ <video id="video-player" class="w-full" poster="https://via.placeholder.com/800x450/1e293b/64748b?text=NHLS+Video+Player">
112
+ <source src="https://sample-videos.com/video123/mp4/720/big_buck_bunny_720p_1mb.mp4" type="video/mp4">
113
+ Your browser does not support the video tag.
114
+ </video>
115
+
116
+ <div class="video-controls">
117
+ <div class="flex items-center mb-2 px-2">
118
+ <div class="progress-container flex-grow mx-2">
119
+ <div class="progress-bar"></div>
120
+ </div>
121
+ <span class="time-display text-sm w-20 text-right">
122
+ <span class="current-time">00:00</span> / <span class="duration">00:00</span>
123
+ </span>
124
+ </div>
125
+
126
+ <div class="flex items-center justify-between px-2">
127
+ <div class="flex items-center space-x-4">
128
+ <button id="play-pause" class="text-white hover:text-blue-400">
129
+ <i class="fas fa-play"></i>
130
+ </button>
131
+
132
+ <div class="flex items-center volume-control">
133
+ <button class="volume-btn text-white hover:text-blue-400">
134
+ <i class="fas fa-volume-up"></i>
135
+ </button>
136
+ <div class="volume-slider ml-2">
137
+ <input type="range" min="0" max="1" step="0.01" value="1" class="w-full">
138
+ </div>
139
+ </div>
140
+ </div>
141
+
142
+ <div class="flex items-center space-x-4">
143
+ <button id="fullscreen" class="text-white hover:text-blue-400">
144
+ <i class="fas fa-expand"></i>
145
+ </button>
146
+ <button id="download-btn" class="download-btn bg-blue-600 hover:bg-blue-700 text-white px-4 py-1 rounded-full flex items-center">
147
+ <i class="fas fa-download mr-2"></i> Save MP4
148
+ </button>
149
+ </div>
150
+ </div>
151
+ </div>
152
+ </div>
153
+
154
+ <div class="max-w-4xl mx-auto mt-8">
155
+ <div class="bg-gray-800 rounded-lg p-6 shadow-lg">
156
+ <h2 class="text-xl font-bold mb-4 flex items-center">
157
+ <i class="fas fa-info-circle text-blue-500 mr-2"></i> Video Information
158
+ </h2>
159
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
160
+ <div>
161
+ <p class="text-gray-400">Title:</p>
162
+ <p class="font-medium">Big Buck Bunny Sample Video</p>
163
+ </div>
164
+ <div>
165
+ <p class="text-gray-400">Duration:</p>
166
+ <p class="font-medium"><span id="video-duration">00:00</span></p>
167
+ </div>
168
+ <div>
169
+ <p class="text-gray-400">Format:</p>
170
+ <p class="font-medium">MP4 (H.264)</p>
171
+ </div>
172
+ <div>
173
+ <p class="text-gray-400">Resolution:</p>
174
+ <p class="font-medium">720p</p>
175
+ </div>
176
+ </div>
177
+ </div>
178
+
179
+ <div class="bg-gray-800 rounded-lg p-6 shadow-lg mt-6">
180
+ <h2 class="text-xl font-bold mb-4 flex items-center">
181
+ <i class="fas fa-cog text-blue-500 mr-2"></i> Settings
182
+ </h2>
183
+ <div class="space-y-4">
184
+ <div>
185
+ <label class="block text-gray-400 mb-2">Playback Speed</label>
186
+ <select id="playback-speed" class="bg-gray-700 text-white rounded px-3 py-2 w-full md:w-64">
187
+ <option value="0.5">0.5x</option>
188
+ <option value="0.75">0.75x</option>
189
+ <option value="1" selected>1x (Normal)</option>
190
+ <option value="1.25">1.25x</option>
191
+ <option value="1.5">1.5x</option>
192
+ <option value="2">2x</option>
193
+ </select>
194
+ </div>
195
+ <div>
196
+ <label class="flex items-center space-x-2">
197
+ <input type="checkbox" id="autoplay" class="rounded text-blue-500">
198
+ <span>Autoplay next video</span>
199
+ </label>
200
+ </div>
201
+ </div>
202
+ </div>
203
+ </div>
204
+ </main>
205
+
206
+ <footer class="bg-gray-800 py-4 px-6">
207
+ <div class="container mx-auto text-center text-gray-400">
208
+ <p>© 2023 NHLS Video Player. All rights reserved.</p>
209
+ </div>
210
+ </footer>
211
+
212
+ <script>
213
+ document.addEventListener('DOMContentLoaded', function() {
214
+ // Video player elements
215
+ const video = document.getElementById('video-player');
216
+ const playPauseBtn = document.getElementById('play-pause');
217
+ const progressBar = document.querySelector('.progress-bar');
218
+ const progressContainer = document.querySelector('.progress-container');
219
+ const currentTimeDisplay = document.querySelector('.current-time');
220
+ const durationDisplay = document.querySelector('.duration');
221
+ const volumeBtn = document.querySelector('.volume-btn');
222
+ const volumeSlider = document.querySelector('.volume-slider input');
223
+ const volumeIcon = document.querySelector('.volume-btn i');
224
+ const fullscreenBtn = document.getElementById('fullscreen');
225
+ const downloadBtn = document.getElementById('download-btn');
226
+ const playbackSpeed = document.getElementById('playback-speed');
227
+ const videoDuration = document.getElementById('video-duration');
228
+ const themeToggle = document.getElementById('theme-toggle');
229
+
230
+ // Format time as MM:SS
231
+ function formatTime(seconds) {
232
+ const minutes = Math.floor(seconds / 60);
233
+ const remainingSeconds = Math.floor(seconds % 60);
234
+ return `${minutes.toString().padStart(2, '0')}:${remainingSeconds.toString().padStart(2, '0')}`;
235
+ }
236
+
237
+ // Update progress bar
238
+ function updateProgress() {
239
+ const progress = (video.currentTime / video.duration) * 100;
240
+ progressBar.style.width = `${progress}%`;
241
+ currentTimeDisplay.textContent = formatTime(video.currentTime);
242
+ }
243
+
244
+ // Set video duration
245
+ function setVideoDuration() {
246
+ durationDisplay.textContent = formatTime(video.duration);
247
+ videoDuration.textContent = formatTime(video.duration);
248
+ }
249
+
250
+ // Toggle play/pause
251
+ function togglePlayPause() {
252
+ if (video.paused) {
253
+ video.play();
254
+ playPauseBtn.innerHTML = '<i class="fas fa-pause"></i>';
255
+ } else {
256
+ video.pause();
257
+ playPauseBtn.innerHTML = '<i class="fas fa-play"></i>';
258
+ }
259
+ }
260
+
261
+ // Set progress on click
262
+ function setProgress(e) {
263
+ const width = this.clientWidth;
264
+ const clickX = e.offsetX;
265
+ const duration = video.duration;
266
+ video.currentTime = (clickX / width) * duration;
267
+ }
268
+
269
+ // Set volume
270
+ function setVolume() {
271
+ video.volume = this.value;
272
+
273
+ if (video.volume === 0) {
274
+ volumeIcon.className = 'fas fa-volume-mute';
275
+ } else if (video.volume < 0.5) {
276
+ volumeIcon.className = 'fas fa-volume-down';
277
+ } else {
278
+ volumeIcon.className = 'fas fa-volume-up';
279
+ }
280
+ }
281
+
282
+ // Toggle mute
283
+ function toggleMute() {
284
+ if (video.volume > 0) {
285
+ video.volume = 0;
286
+ volumeSlider.value = 0;
287
+ volumeIcon.className = 'fas fa-volume-mute';
288
+ } else {
289
+ video.volume = 1;
290
+ volumeSlider.value = 1;
291
+ volumeIcon.className = 'fas fa-volume-up';
292
+ }
293
+ }
294
+
295
+ // Toggle fullscreen
296
+ function toggleFullscreen() {
297
+ if (!document.fullscreenElement) {
298
+ video.requestFullscreen().catch(err => {
299
+ alert(`Error attempting to enable fullscreen: ${err.message}`);
300
+ });
301
+ } else {
302
+ document.exitFullscreen();
303
+ }
304
+ }
305
+
306
+ // Download video
307
+ function downloadVideo() {
308
+ const videoSrc = video.querySelector('source').src;
309
+ const videoTitle = 'NHLS_Video_' + new Date().toISOString().slice(0, 10) + '.mp4';
310
+
311
+ // Create download link
312
+ const link = document.createElement('a');
313
+ link.href = videoSrc;
314
+ link.download = videoTitle;
315
+ document.body.appendChild(link);
316
+ link.click();
317
+ document.body.removeChild(link);
318
+
319
+ // Show download notification
320
+ const notification = document.createElement('div');
321
+ notification.className = 'fixed bottom-4 right-4 bg-green-600 text-white px-4 py-2 rounded-lg shadow-lg flex items-center';
322
+ notification.innerHTML = `
323
+ <i class="fas fa-check-circle mr-2"></i>
324
+ <span>Download started: ${videoTitle}</span>
325
+ `;
326
+ document.body.appendChild(notification);
327
+
328
+ setTimeout(() => {
329
+ notification.classList.add('opacity-0', 'transition-opacity', 'duration-500');
330
+ setTimeout(() => notification.remove(), 500);
331
+ }, 3000);
332
+ }
333
+
334
+ // Change playback speed
335
+ function changePlaybackSpeed() {
336
+ video.playbackRate = this.value;
337
+ }
338
+
339
+ // Toggle dark/light theme
340
+ function toggleTheme() {
341
+ const isDark = document.documentElement.classList.contains('dark');
342
+
343
+ if (isDark) {
344
+ document.documentElement.classList.remove('dark');
345
+ document.body.classList.remove('bg-gray-900');
346
+ document.body.classList.add('bg-gray-100', 'text-gray-900');
347
+ themeToggle.innerHTML = '<i class="fas fa-moon"></i>';
348
+ } else {
349
+ document.documentElement.classList.add('dark');
350
+ document.body.classList.remove('bg-gray-100', 'text-gray-900');
351
+ document.body.classList.add('bg-gray-900', 'text-white');
352
+ themeToggle.innerHTML = '<i class="fas fa-sun"></i>';
353
+ }
354
+ }
355
+
356
+ // Event listeners
357
+ video.addEventListener('click', togglePlayPause);
358
+ video.addEventListener('timeupdate', updateProgress);
359
+ video.addEventListener('loadedmetadata', setVideoDuration);
360
+ video.addEventListener('ended', () => {
361
+ playPauseBtn.innerHTML = '<i class="fas fa-play"></i>';
362
+ });
363
+
364
+ playPauseBtn.addEventListener('click', togglePlayPause);
365
+ progressContainer.addEventListener('click', setProgress);
366
+ volumeSlider.addEventListener('input', setVolume);
367
+ volumeBtn.addEventListener('click', toggleMute);
368
+ fullscreenBtn.addEventListener('click', toggleFullscreen);
369
+ downloadBtn.addEventListener('click', downloadVideo);
370
+ playbackSpeed.addEventListener('change', changePlaybackSpeed);
371
+ themeToggle.addEventListener('click', toggleTheme);
372
+
373
+ // Initialize volume icon
374
+ setVolume.call(volumeSlider);
375
+ });
376
+ </script>
377
+ <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=inoculatemedia/hls-player-and-recorder" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
378
+ </html>
prompts.txt ADDED
File without changes