diff options
author | pacien | 2024-01-05 00:38:53 +0100 |
---|---|---|
committer | pacien | 2024-01-05 00:38:53 +0100 |
commit | cc084c4f96e0117e4c7b80dc870f4ac2f6a60035 (patch) | |
tree | 86206f75aeaeb8f0798f9557e1b8737dd9d3fc99 | |
parent | c97536bf080a1c45634a91cee80dba3bad3c641c (diff) | |
download | echoclip-cc084c4f96e0117e4c7b80dc870f4ac2f6a60035.tar.gz |
autoplay newly recorded clip when option checked
-rw-r--r-- | app.js | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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 => { |