Merge pull request #52 from joelmathewthomas/fix/exceptions
Fix/exceptions
This commit is contained in:
@@ -52,6 +52,8 @@ function UploadPage() {
|
|||||||
recorder.onstop = () => {
|
recorder.onstop = () => {
|
||||||
const blob = new Blob(chunks, { type: "audio/wav" });
|
const blob = new Blob(chunks, { type: "audio/wav" });
|
||||||
const file = new File([blob], "recording.wav", { type: "audio/wav" });
|
const file = new File([blob], "recording.wav", { type: "audio/wav" });
|
||||||
|
const tracks = stream.getTracks();
|
||||||
|
tracks.forEach(track => track.stop());
|
||||||
validateAndSetFile(file);
|
validateAndSetFile(file);
|
||||||
handleUpload(file);
|
handleUpload(file);
|
||||||
};
|
};
|
||||||
@@ -337,6 +339,7 @@ function UploadPage() {
|
|||||||
e.stopPropagation(); // Prevent click from reaching file input
|
e.stopPropagation(); // Prevent click from reaching file input
|
||||||
isRecording ? stopRecording() : startRecording();
|
isRecording ? stopRecording() : startRecording();
|
||||||
}}
|
}}
|
||||||
|
disabled={!isConnected}
|
||||||
>
|
>
|
||||||
{isRecording ? "Stop Recording" : "Start Recording"}
|
{isRecording ? "Stop Recording" : "Start Recording"}
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
Reference in New Issue
Block a user