aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/app.js b/app.js
index 19d0867..f567987 100644
--- a/app.js
+++ b/app.js
@@ -53,9 +53,10 @@ function onGetDeviceSuccess(stream) {
53 }); 53 });
54 54
55 document.addEventListener("keydown", event => { 55 document.addEventListener("keydown", event => {
56 if (mediaRecorder.state == "inactive" && event.key == " ") { 56 if (event.key == " ") {
57 event.preventDefault(); // prevent scroll 57 event.preventDefault(); // prevent scroll
58 mediaRecorder.start(); 58 if (mediaRecorder.state == "inactive")
59 mediaRecorder.start();
59 } 60 }
60 }); 61 });
61 62