Skip to content

Commit 3b56ef6

Browse files
committed
v7.0.23
1 parent c341025 commit 3b56ef6

File tree

7 files changed

+24
-13
lines changed

7 files changed

+24
-13
lines changed

build/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Gleap.preFillForm({
88
//Gleap.setApiUrl("http://localhost:9000");
99
// Gleap.setLanguage("en");
1010
Gleap.setFrameUrl("http://localhost:3000");
11-
Gleap.initialize("MMxTvMklWdr6pgZzA3hJk9K0IvOsIT2A");
11+
Gleap.initialize("ogWhNhuiZcGWrva5nlDS8l7a78OfaLlV");
1212

1313
Gleap.identify("user_19283", {
1414
name: "Franz AB",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gleap",
3-
"version": "7.0.22",
3+
"version": "7.0.23",
44
"main": "build/index.js",
55
"scripts": {
66
"start": "webpack serve",

published/7.0.21/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

published/7.0.23/index.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

published/latest/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/GleapScreenRecorder.js

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ export class GleapScreenRecorder {
2626
}, 100);
2727
}
2828

29+
getSupportedMimeType() {
30+
if (MediaRecorder.isTypeSupported("video/mp4")) {
31+
return "video/mp4";
32+
}
33+
return "video/webm";
34+
}
35+
2936
formatTime(s) {
3037
return (s - (s %= 60)) / 60 + (9 < s ? ":" : ":0") + s;
3138
}
@@ -157,11 +164,13 @@ export class GleapScreenRecorder {
157164
this.rerender();
158165
};
159166

160-
handleRecord = function ({ stream, mimeType = "video/mp4" }) {
167+
handleRecord = function ({ stream }) {
161168
const self = this;
162169

163170
var recordedChunks = [];
164-
this.mediaRecorder = new MediaRecorder(stream);
171+
this.mediaRecorder = new MediaRecorder(stream, {
172+
mimeType: this.getSupportedMimeType()
173+
});
165174
this.isRecording = true;
166175
this.recordTime = 0;
167176

@@ -185,24 +194,25 @@ export class GleapScreenRecorder {
185194
};
186195

187196
stream.getVideoTracks()[0].onended = function () {
188-
self.prepareRecording(recordedChunks, mimeType);
197+
self.prepareRecording(recordedChunks);
189198
};
190199

191200
this.mediaRecorder.onstop = function () {
192-
self.prepareRecording(recordedChunks, mimeType);
201+
self.prepareRecording(recordedChunks);
193202
};
194203

195204
this.mediaRecorder.start(200); // here 200ms is interval of chunk collection
205+
196206
self.rerender();
197207
};
198208

199-
prepareRecording = function (recordedChunks, mimeType) {
209+
prepareRecording = function (recordedChunks) {
200210
const completeBlob = new Blob(recordedChunks, {
201-
type: mimeType,
211+
type: this.getSupportedMimeType(),
202212
});
203213

204-
this.file = new File([completeBlob], "screen-recording.mp4", {
205-
type: "video/mp4",
214+
this.file = new File([completeBlob], `screen-recording.${this.getSupportedMimeType() === "video/mp4" ? 'mp4' : "webm"}`, {
215+
type: this.getSupportedMimeType(),
206216
});
207217

208218
const previewVideoElement = document.querySelector(

0 commit comments

Comments
 (0)