a weird error with validateRtpParameters

async function connectRecvTransport() {
    await socket.emit('consume', {
        rtpCapabilities: device.rtpCapabilities,
    }, async ({params}) => {
        if (params.error) {
            console.log(params.error);
            return;
        }

        console.log(typeof params)

        consumer = await consumerTransport.consume({
            id: params.id,
            producerId: params.producerId,
            kind: params.kind,
            rtpParameters: params.rtpParameters,
        });
        const {track} = consumer;
    
        remoteVideo.srcObject = new MediaStream([track]);
    
        socket.emit("consumer-resume")
    });
}

So! Here we have a bit of a weird problem, as you can see I am getting the error that params is not an object, even though when I check the type it is? Is this a mediasoup problem or on my side?

Your code is not valid.

Please, don’t assume by default that everything can be a bug in mediasoup. You are checking typeof params but then you are passing params.rtpParameters.

1 Like

Oh, I am so extremely sorry. Forgive me for that.
Thanks for the quick response.