DOMException in Chrome74

mediasoup v3.4.6
mediasoup-client v3.3.12
Chrome v79
macOs 10.15.2

I trigger the transport.on(‘connect’) event after using createSendTransport(). After the server side executes webrtctransport.connect (), the client receives the callback and executes the error.


Chrome74.js?d0d4:204 Uncaught (in promise) DOMException: Failed to execute 'setRemoteDescription' on 'RTCPeerConnection': Failed to parse SessionDescription. candidate:undefined 1 undefined NaN undefined NaN typ undefined Invalid value: NaN.
    at SendHandler.eval (webpack-internal:///./node_modules/mediasoup-client/lib/handlers/Chrome74.js:204:28)
    at (<anonymous>)
    at fulfilled (webpack-internal:///./node_modules/mediasoup-client/lib/handlers/Chrome74.js:5:5

client code:

const transport = device.createSendTransport(data);
// ==> data is { routerRtpCapabilities }

    transport.on('connect', async ({ dtlsParameters }, callback, errback) => {
        console.log(dtlsParameters); // ==> { role: 'client', fingerprints: [...] }
        new Promise((resolve) => {
            socket.emit('connectProducerTransport', {
                userid // ==> get server webrtc transport (producer) 
            }, resolve);
        }).then(() => {
            console.log(`connect is ok!`); // ==> ok
        console.log(`[sendTransport] is connect...`); // ==> ok

transport.on('produce', ...); // ==> no use
transport.on('connectionstatechange', ...); // ==> no use
const stream = await getStream();
const videoTrack = stream.getVideoTracks()[0];
await transport.produce({track: videoTrack});

server code:

   socket.on('connectProducerTransport', async (data, callback) => {
        const { producerMap } = utilMaps;

        const transport = producerMap.get(data.userid);
        await transport.connect({
            dtlsParameters: data.dtlsParameters

        console.log(`${data.userid} producer connect is ok!`);
       // ==> is ok!


I need some help! Thank you very much!:pray:

I’m sorry, it was my fault. Although I’ve been looking for bugs all day :rofl:

That’s wrong.

Yes, createSendTransport() need webrtcTransport.
I’ve confused this parameter with what device requires.

It needs some parameters of the server side WebRtcTransport, not the whole WebRtcTransport.

Yes, I did know that by looking at the API documentation.

I’m also curious how many producers and consumers a webrtcTransport can create. Or, in theory, there is no limit

No idea, that depends on each the browser.

Ok,thank you!

I am now trying to handle remote requests through the nginx proxy, but there is one problem: the status of ICE cannot be updated effectively.
The server does not use https, but directly passes nginx reverse proxy http to https.

Please, use a separate topic for a separate question.