forked from collab-project/videojs-record
-
Notifications
You must be signed in to change notification settings - Fork 0
/
image-only.html
62 lines (52 loc) · 1.42 KB
/
image-only.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<!doctype html>
<html>
<head>
<title>Image-only Example - Record Plugin for Video.js</title>
<link href="http://cdnjs.cloudflare.com/ajax/libs/video.js/4.12.5/video-js.css" rel="stylesheet">
<link href="../src/css/videojs.record.css" rel="stylesheet">
<script src="http://cdnjs.cloudflare.com/ajax/libs/video.js/4.12.5/video.js"></script>
<script src="../src/js/videojs.record.js"></script>
</head>
<body>
<video id="myImage" class="video-js vjs-default-skin"></video>
<script>
var player = videojs("myImage",
{
controls: true,
width: 320,
height: 240,
children: {
controlBar: {
children: {
currentTimeDisplay: false,
timeDivider: false,
durationDisplay: false,
muteToggle: false,
volumeControl: false,
fullscreenToggle: false
}
}
},
plugins: {
record: {
image: true
}
}
});
// change player background color
player.el().style.backgroundColor = "#6B2DA8";
// error handling
player.on('deviceError', function()
{
console.warn('device error:', player.deviceErrorCode);
});
// snapshot is available
player.on('finishRecord', function()
{
// the blob object contains the image data that
// can be downloaded by the user, stored on server etc.
console.log('snapshot ready: ', player.recordedData);
});
</script>
</body>
</html>