forked from collab-project/videojs-record
-
Notifications
You must be signed in to change notification settings - Fork 0
/
video-only.html
67 lines (56 loc) · 1.55 KB
/
video-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
63
64
65
66
67
<!doctype html>
<html>
<head>
<title>Video-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="http://cdn.webrtc-experiment.com/RecordRTC.js"></script>
<script src="../src/js/videojs.record.js"></script>
</head>
<body>
<video id="myVideo" class="video-js vjs-default-skin"></video>
<script>
var player = videojs("myVideo",
{
controls: true,
width: 320,
height: 240,
children: {
controlBar: {
children: {
muteToggle: false,
volumeControl: false
}
}
},
plugins: {
record: {
audio: false,
video: true,
maxLength: 5
}
}
});
// change player background color
player.el().style.backgroundColor = "#47AFD1";
// error handling
player.on('deviceError', function()
{
console.warn('device error:', player.deviceErrorCode);
});
// user clicked the record button and started recording
player.on('startRecord', function()
{
console.log('started recording!');
});
// user completed recording and stream is available
player.on('finishRecord', function()
{
// the blob object contains the recorded data that
// can be downloaded by the user, stored on server etc.
console.log('finished recording: ', player.recordedData);
});
</script>
</body>
</html>