-
Notifications
You must be signed in to change notification settings - Fork 78
/
Copy pathdemo.html
46 lines (46 loc) · 1.24 KB
/
demo.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
<!doctype html>
<html lang="en">
<head>
<title></title>
</head>
<body>
<button id="capture-button">Capture</button>
<button id="record-button">Record</button>
<br>
<video id="result-video" autoplay></video>
<img id="result-image">
<script src="src/index.js"></script>
<script src="bower_components/whammy/whammy.js"></script>
<script>
function showImage(img) {
document.querySelector('#result-image').src = img;
}
function showVideo(blob) {
document.querySelector('#result-video').src = URL.createObjectURL(blob);
}
document.querySelector('#capture-button').onclick = function () {
JSCapture.capture({
done: showImage,
fail: function () {
alert('Error, while capturing your screen');
},
x: 10,
y: 100,
width: 800,
height: 400,
scale: 1.5
});
};
document.querySelector('#record-button').onclick = function () {
JSCapture.record({
done: showVideo,
fail: function () {
alert('Error, while recording your screen');
},
duration: 10000,
scale: 0.5
});
};
</script>
</body>
</html>