Hi, ibc,
I get the TypeError when I excute device.load(routerRtpCapabilities), that issued on github, https://github.com/versatica/mediasoup-client/issues/120 .
Please help me to fix the issue.
Thank you so much.
//-------------------------------------------------------
on server side:
const worker = await mediasoup.createWorker(
{
logLevel : config.mediasoup.workerSettings.logLevel,
logTags : config.mediasoup.workerSettings.logTags,
rtcMinPort : Number(config.mediasoup.workerSettings.rtcMinPort),
rtcMaxPort : Number(config.mediasoup.workerSettings.rtcMaxPort)
});
const { mediaCodecs } = config.mediasoup.routerOptions;
const rtpCapabilities = mediasoup.getSupportedRtpCapabilities();
console.log(rtpCapabilities);
// Create a mediasoup Router.
const mediasoupRouter = await worker.createRouter({ mediaCodecs });
console.log(mediasoupRouter.rtpCapabilities);
signaling.emit(mediasoupRouter.rtpCapabilities);
//----------------------------------------------------
on client side:
import { Device } from āmediasoup-clientā;
import mySignaling from ā./my-signalingā; // Our own signaling stuff.
try {
// Create a device (use browser auto-detection).
const device = new Device();
// Communicate with our server app to retrieve router RTP capabilities.
const routerRtpCapabilities = await mySignaling.request(āgetRouterCapabilitiesā);
console.log(routerRtpCapabilities); // see the following log
// Load the device with the router RTP capabilities.
await device.load({ routerRtpCapabilities }); // throw TypeError
}
catch (e) {
console.log(e);
}