diff options
-rw-r--r-- | app.js | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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 | ||