From 526f9c2e06db218c5d3a8293cf6780541b1b5953 Mon Sep 17 00:00:00 2001 From: Filipi Fuchter Date: Thu, 13 Mar 2025 18:41:40 -0300 Subject: [PATCH] Fixing the voice agent feedback when disconnected. --- examples/aiortc/voice-agent/index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/aiortc/voice-agent/index.html b/examples/aiortc/voice-agent/index.html index 4fce3a993..879a124a3 100644 --- a/examples/aiortc/voice-agent/index.html +++ b/examples/aiortc/voice-agent/index.html @@ -59,7 +59,6 @@ peerConnection= await createSmallWebRTCConnection(audioStream.getAudioTracks()[0]) peerConnection.onconnectionstatechange = () => { let connectionState = peerConnection?.connectionState - statusEl.textContent = connectionState if (connectionState === 'connected') { _onConnected() } else if (connectionState === 'disconnected') { @@ -69,11 +68,13 @@ } const _onConnected = () => { + statusEl.textContent = "Connected" buttonEl.textContent = "Disconnect" connected = true } const _onDisconnected = () => { + statusEl.textContent = "Disconnected" buttonEl.textContent = "Connect" connected = false }