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 }