forked from algsoch/sachin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvideo-debug.html
More file actions
78 lines (69 loc) · 2.76 KB
/
video-debug.html
File metadata and controls
78 lines (69 loc) · 2.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Video Debug Test</title>
<style>
body { font-family: Arial, sans-serif; padding: 20px; background: #0a0b0d; color: white; }
.test-video { width: 200px; height: 200px; object-fit: cover; border: 2px solid #7b2ff2; border-radius: 12px; margin: 10px; }
.test-container { display: flex; flex-wrap: wrap; gap: 20px; }
.video-item { text-align: center; }
.status { margin-top: 5px; font-size: 12px; }
.success { color: #4ade80; }
.error { color: #f87171; }
</style>
</head>
<body>
<h2>Video Loading Debug Test</h2>
<div class="test-container" id="videoContainer"></div>
<script>
const videos = [
'trading (1).mp4',
'trading (2).mp4',
'trading (3).mp4',
'trading (4).mp4',
'tradind 5.mp4',
'educational.mp4',
'educational (2).mp4',
'motion graphic (1).mp4',
'motion graphic (2).mp4',
'motion graphic (3).mp4',
'sub vdo.mp4'
];
const container = document.getElementById('videoContainer');
videos.forEach(filename => {
const videoItem = document.createElement('div');
videoItem.className = 'video-item';
const video = document.createElement('video');
video.className = 'test-video';
video.src = `assets/${filename}`;
video.muted = true;
video.loop = true;
video.preload = 'metadata';
const label = document.createElement('div');
label.textContent = filename;
const status = document.createElement('div');
status.className = 'status';
status.textContent = 'Loading...';
video.addEventListener('loadedmetadata', () => {
status.textContent = 'Loaded ✓';
status.className = 'status success';
video.play().catch(err => {
status.textContent = 'Play failed ✗';
status.className = 'status error';
});
});
video.addEventListener('error', (e) => {
status.textContent = 'Load failed ✗';
status.className = 'status error';
console.error('Video load error for', filename, e);
});
videoItem.appendChild(video);
videoItem.appendChild(label);
videoItem.appendChild(status);
container.appendChild(videoItem);
});
</script>
</body>
</html>