Hello there !
I will be quick. I’m creating a sendTransport correctly, and I’m trying to produce something with it.
Here is the code from creating my transport :
const sendTransport: Transport = this.mediasoupDevice!.createSendTransport(
producersTransportParams
)
if (sendTransport == null) {
throw 'Could not cread producers transport'
}
// When we want to connect we need to fire a socket event to ask for ti
sendTransport.on('connect', async () => {
log.debug('[Mediasoup] - 📹 "connect" event for sendTransport')
await connectTransport(TransportTypes.producer)
})
// When we want to produce some media, we need to send some data to the sever
sendTransport.on(
'produce',
async ({ kind, rtpParameters, appData }, callback, errCallback) => {
try {
log.debug('[Mediasoup] - 📹 "produce" event for sendTransport')
const id = await produceMedia(kind, rtpParameters)
callback({ id })
} catch (error) {
errCallback(error)
}
}
)
const producer = await sendTransport.produce({
track: webcamTrack,
encodings,
codecOptions: {
videoGoogleStartBitrate: 1000
}
})
The “connect” event is raised correctly, and I’m connecting on the server side. But the produce
event is never fired, and thus the produce()
method never ends.
log.debug(sendTransport.listeners('produce'))
indicates that the event has a listener, and the correct one.
So, can the produce()
method fail silently before calling the event ? How can I debug that ?
Thanks !