Problem with mediasoup-client load

Hey there…
I have a problem with the mediasoup-client device.load while providing routerRtpCapabilities. I got router capabilities with and passing it to the device.load and got caps in not an object error.

After read of code, i found that the parameter passed is undefined in the load function. As the parameter is not getting the real value of the capabilities.

Please help me to solve this.

We don’t know your problem, sorry. Inspect the routerRtpParameters you are passing to load() method. Do your homework please.

Have you resolved this?I am also in this problem!Please help me!

Sorry guys, you don’t even paste a single log.

@lzxysf i just got the same problem and after reading and debugging the mediasoup client code… I just solved the error…

You just need to create an javascript object…

var caps = { rtpCapabilities: [data]};
await device.load({caps});

Change data with your capabilities received from another side…

thanks your answer,but the problem again.
My code is
const rtpCapabilities = JSON.parse(rtpCapabilities_json);
var caps = {rtpCapabilities: rtpCapabilities};
await device.load(caps);

Or you can visit and pressF12 to see the problem.thanks very much

It shows connected…

what?Do it works?