forked from muaz-khan/RecordRTC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplotly.html
131 lines (110 loc) · 4.45 KB
/
plotly.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<html>
<head>
<title>Recording plotly WebGL diagrams using RecordRTC</title>
<link rel="stylesheet" href="https://www.webrtc-experiment.com/style.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://www.webrtc-experiment.com/RecordRTC.js"></script>
<script src="https://www.webrtc-experiment.com/screenshot.js"></script>
</head>
<body>
<div class="github-stargazers" style="top:5px;right:5px;"></div>
<div class="recording-controls" style="text-align:center;">
<button type="button" id="startRecording" name="button">Start Recording</button>
<button type="button" id="stopRecording" name="button" disabled>Stop Recording</button>
</div>
<div>
<div id="myDiv" style="width:100%;height:100%"></div>
</div>
<script src="https://www.plot.ly/plotly-latest.min.js"></script>
<script type="text/javascript">
var trace1 = {
z: [
[2, 2, 0, 0, 5, 5, 6, 6, 6, 6],
[1, 1, 0, 0, 0, 5, 1, 0, 0, 0],
[1, 1, 0, 0, 0, 1, 1, 0, 0, 0],
[1, 2, 0, 0, 0, 3, 3, 5, 5, 5],
[5, 2, 2, 3, 1, 1, 3, 5, 5, 6],
[5, 2, 2, 3, 1, 1, 6, 5, 6, 6],
[3, 6, 6, 6, 6, 6, 6, 5, 5, 5],
[0, 6, 6, 6, 1, 1, 6, 2, 2, 5],
[0, 0, 2, 1, 1, 1, 2, 2, 2, 5],
[0, 2, 2, 1, 1, 2, 2, 2, 4, 4],
],
cmax: 5,
cmin: 2,
colorscale: [
["0", "#FF0000"],
["0.25", "#FFFFFF"],
["0.555555555556", "#0000ff"],
["0.777777777778", "#6CCE59"],
["1", "#FDE725"]
],
// surfacecolor: [[0,"rgb( 0, 0, 0)"],[0.3,"rgb(230, 0, 0)"],[0.6,"rgb(255,210, 0)"],[1,"rgb(255,255,255)"]],
type: 'surface',
opacity: 1,
// autocolorscale : false,
name: "trace_name",
contours: {
y: {
show: true,
}
},
};
var data = [trace1];
var layout = {
margin: {
l: 10,
r: 10,
b: 20,
t: 20
}
};
Plotly.newPlot('myDiv', data);
</script>
<script type="text/javascript">
/* JAVASCRIPT CODE GOES HERE */
var elementToShare = document.querySelector('canvas');
var recorder = RecordRTC(elementToShare, {
type: 'canvas',
showMousePointer: true
});
document.getElementById('startRecording').onclick = function() {
this.disabled = true;
isRecordingStarted = true;
isStoppedRecording = false;
recorder.startRecording();
document.getElementById('stopRecording').disabled = false;
};
document.getElementById('stopRecording').onclick = function() {
this.disabled = true;
isStoppedRecording = true;
recorder.stopRecording(function(url) {
var blob = recorder.getBlob();
console.log('blob', blob);
var video = document.createElement('video');
video.src = URL.createObjectURL(blob);
video.setAttribute('style', 'height: 100%; position: absolute; top:0;');
var body = document.querySelector('body');
body.innerHTML = '';
body.appendChild(video);
video.controls = true;
video.play();
});
};
</script>
<a href="https://github.com/muaz-khan/RecordRTC" class="fork-left"></a>
<section id="ask" class="experiment">
<h2 class="header" id="feedback">Feedback</h2>
<div>
<textarea id="message" style="border: 1px solid rgb(189, 189, 189); height: 8em; margin: .2em; outline: none; resize: vertical; width: 98%;" placeholder="Have any message? Suggestions or something went wrong?"></textarea>
</div>
<button id="send-message" style="font-size: 1em;">Send Message</button>
<small style="margin-left: 1em;">Enter your email too; if you want "direct" reply!</small>
</section>
<!-- commits.js is useless for you! -->
<script>
window.useThisGithubPath = 'muaz-khan/RecordRTC';
</script>
<script src="https://www.webrtc-experiment.com/commits.js" async></script>
</body>
</html>