mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-09-30 12:39:42 +02:00
fix: show clear error when microphone used without HTTPS
navigator.mediaDevices is undefined in insecure contexts, causing "undefined is not an object" error. Now shows actionable message. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -30,6 +30,11 @@ const DeepgramProvider = {
|
||||
this._onEnd = opts.onEnd;
|
||||
|
||||
// 1. Get microphone access
|
||||
if (!navigator.mediaDevices?.getUserMedia) {
|
||||
this._onError?.('Microphone requires a secure context (HTTPS). Use --https flag or access via localhost.');
|
||||
this._cleanup();
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this._stream = await navigator.mediaDevices.getUserMedia({
|
||||
audio: { noiseSuppression: true, echoCancellation: true, autoGainControl: true }
|
||||
|
||||
Reference in New Issue
Block a user