Fixing the voice agent example to always create the video transceiver.

This commit is contained in:
Filipi Fuchter
2025-04-14 10:41:39 -03:00
parent edd53d425e
commit 099d2c02e1

View File

@@ -40,7 +40,9 @@
const createSmallWebRTCConnection = async (audioTrack) => {
const pc = new RTCPeerConnection()
pc.ontrack = e => audioEl.srcObject = e.streams[0]
// SmallWebRTCTransport expects to receive both transceivers
pc.addTransceiver(audioTrack, { direction: 'sendrecv' })
pc.addTransceiver('video', { direction: 'sendrecv' })
await pc.setLocalDescription(await pc.createOffer())
//await waitForIceGatheringComplete(pc)
const offer = pc.localDescription