-
-
Notifications
You must be signed in to change notification settings - Fork 315
/
animated-gif.html
83 lines (71 loc) · 2.17 KB
/
animated-gif.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Animated GIF Example - Record Plugin for Video.js</title>
<link href="../node_modules/video.js/dist/video-js.min.css" rel="stylesheet">
<link href="../dist/css/videojs.record.css" rel="stylesheet">
<link href="assets/css/examples.css" rel="stylesheet">
<script src="../node_modules/video.js/dist/video.min.js"></script>
<script src="../node_modules/recordrtc/RecordRTC.js"></script>
<script src="//cdn.webrtc-experiment.com/gif-recorder.js"></script>
<script src="../node_modules/webrtc-adapter/out/adapter.js"></script>
<script src="../dist/videojs.record.js"></script>
<style>
/* change player background color */
#myVideo {
background-color: #4ecdc4;
}
</style>
</head>
<body>
<video id="myVideo" playsinline class="video-js vjs-default-skin"></video>
<script>
/* eslint-disable */
var options = {
controls: true,
width: 320,
height: 240,
fluid: false,
bigPlayButton: false,
controlBar: {
volumePanel: false,
fullscreenToggle: false
},
plugins: {
record: {
animation: true,
animationQuality: 20,
animationFrameRate: 200,
maxLength: 5,
debug: true
}
}
};
var player = videojs('myVideo', options, function() {
// print version information at startup
var msg = 'Using video.js ' + videojs.VERSION +
' with videojs-record ' + videojs.getPluginVersion('record') +
' and recordrtc ' + RecordRTC.version;
videojs.log(msg);
});
// error handling
player.on('deviceError', function() {
console.warn('device error:', player.deviceErrorCode);
});
player.on('error', function(element, error) {
console.error(error);
});
// 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>