-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
68 lines (65 loc) · 2.02 KB
/
index.php
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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Captured Videos</title>
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function () {
document.querySelectorAll('.loading').forEach(function (element) {
element.addEventListener('click', function (event) {
event.preventDefault();
event.currentTarget.style.display = "none";
var video = event.currentTarget.parentNode.querySelector('video');
video.addEventListener("loadeddata", function (event) {
video.currentTime = 24 * 60 * 60 * 1000;
video.controls = true;
});
video.load();
});
});
});
</script>
<style type="text/css">
body {
font-family: sans-serif;
}
video {
width: 100%;
}
.entry {
position: relative;
display: inline-block;
width: 16em;
vertical-align: top;
}
.loading {
position: absolute;
width: 100%;
height: 100%;
z-index: 1;
}
</style>
</head>
<body>
<h1>Captured Videos</h1>
<?php
$files = glob('data/*.webm');
rsort($files);
foreach ($files as $file) {
$poster = preg_replace("/\.webm$/", ".jpg", $file);
?>
<div class="entry">
<a class="loading" href="#"></a>
<div><?php echo htmlspecialchars(basename($file), ENT_QUOTES) ?></div>
<video preload="none" poster="<?php echo htmlspecialchars($poster, ENT_QUOTES) ?>">
<source src="<?php echo htmlspecialchars($file, ENT_QUOTES) ?>" type="video/webm">
</video>
</div>
<?php
}
?>
</body>
</html>