Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions runtimes/web/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,11 @@ async function loadCartWasm () {

let videoRecorder = null;
function recordVideo () {
if (videoRecorder != null) {
return; // Still recording, ignore
if (videoRecorder != null) { // Stops recording after hitting the record key during recording
videoRecorder.requestData();
videoRecorder.stop();
videoRecorder = null;
return;
}

const mimeType = "video/webm";
Expand All @@ -148,11 +151,7 @@ async function loadCartWasm () {
};

videoRecorder.start();
setTimeout(() => {
videoRecorder.requestData();
videoRecorder.stop();
videoRecorder = null;
}, 4000);

}

let savedState = null;
Expand Down