-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
48 lines (42 loc) · 1.71 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=800, initial-scale=1.0">
<title>ScreenRecorder</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
</head>
<body>
<div class="container">
<div class="row">
<div class="ratio ratio-16x9">
<video id="preview" poster></video>
</div>
</div>
<div class="row">
<div class="col btn-group">
<div class="btn btn-primary" onclick="recorder.start()">⏺ Start Record</div>
<div class="btn btn-outline-danger" onclick="recorder.stop()">⏹ Stop Record</div>
</div>
</div>
<div class="row">
<a class="btn btn-link disabled" role="button" id="downloadLink" href="#">Download Video</a>
</div>
</div>
</body>
<script src="ScreenRecorder.js"></script>
<script>
let recorder = new ScreenRecorder((video, thumb) => {
let filename = window.prompt('Bitte Dateinamen eingeben:'),
downloadLink = document.querySelector('a#downloadLink'),
videoElement = document.querySelector('video#preview')
videoElement.src = video
videoElement.controls = true
videoElement.poster = thumb
downloadLink.href = videoElement.src
downloadLink.download = `${filename}.wbm`
downloadLink.classList.remove('disabled')
})
</script>
</html>