aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpacien2024-01-05 00:38:53 +0100
committerpacien2024-01-05 00:38:53 +0100
commitcc084c4f96e0117e4c7b80dc870f4ac2f6a60035 (patch)
tree86206f75aeaeb8f0798f9557e1b8737dd9d3fc99
parentc97536bf080a1c45634a91cee80dba3bad3c641c (diff)
downloadechoclip-cc084c4f96e0117e4c7b80dc870f4ac2f6a60035.tar.gz
autoplay newly recorded clip when option checked
-rw-r--r--app.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/app.js b/app.js
index f567987..a761769 100644
--- a/app.js
+++ b/app.js
@@ -36,12 +36,18 @@ function onGetDeviceSuccess(stream) {
36 const blob = new Blob(recordingChunks, { type: mediaRecorder.mimeType }); 36 const blob = new Blob(recordingChunks, { type: mediaRecorder.mimeType });
37 recordingChunks = []; 37 recordingChunks = [];
38 const audioElement = audioElementForBlob(blob); 38 const audioElement = audioElementForBlob(blob);
39 // TODO: autoplay audioElement if checkbox enabled 39
40 // TODO: record blob and list to local persistent storage 40 // TODO: record blob and list to local persistent storage
41 // TODO: "clear all" button to clear all clips 41 // TODO: "clear all" button to clear all clips
42 // TODO: buttons to clear individual clips 42 // TODO: buttons to clear individual clips
43 // TODO: keyboard shortcut to play clips for the ten last indexes 43 // TODO: keyboard shortcut to play clips for the ten last indexes
44
44 clips.prepend(wrapElement("li", audioElement)); 45 clips.prepend(wrapElement("li", audioElement));
46
47 if (autoplayCheckbox.checked) {
48 // TODO: stop playing any other clip
49 audioElement.play();
50 }
45 }); 51 });
46 52
47 recordBtn.addEventListener("mousedown", _event => { 53 recordBtn.addEventListener("mousedown", _event => {