Fixing the voice agent example to always create the video transceiver.
This commit is contained in:
@@ -40,7 +40,9 @@
|
|||||||
const createSmallWebRTCConnection = async (audioTrack) => {
|
const createSmallWebRTCConnection = async (audioTrack) => {
|
||||||
const pc = new RTCPeerConnection()
|
const pc = new RTCPeerConnection()
|
||||||
pc.ontrack = e => audioEl.srcObject = e.streams[0]
|
pc.ontrack = e => audioEl.srcObject = e.streams[0]
|
||||||
|
// SmallWebRTCTransport expects to receive both transceivers
|
||||||
pc.addTransceiver(audioTrack, { direction: 'sendrecv' })
|
pc.addTransceiver(audioTrack, { direction: 'sendrecv' })
|
||||||
|
pc.addTransceiver('video', { direction: 'sendrecv' })
|
||||||
await pc.setLocalDescription(await pc.createOffer())
|
await pc.setLocalDescription(await pc.createOffer())
|
||||||
//await waitForIceGatheringComplete(pc)
|
//await waitForIceGatheringComplete(pc)
|
||||||
const offer = pc.localDescription
|
const offer = pc.localDescription
|
||||||
|
|||||||
Reference in New Issue
Block a user