async function recordVideo(){ if (window.recorder && window.recorder.state === "recording"){ window.recorder.stop(); } else { let toggle = document.getElementById('recording-button'); //we request permission to access the device's microphone and camera let stream = await navigator.mediaDevices.getUserMedia({audio: true, video: true }); //then we add that stream to our