Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can increase webrtcserver to use a single port #2

Open
huangqingbiao8831 opened this issue Sep 11, 2024 · 1 comment
Open

Can increase webrtcserver to use a single port #2

huangqingbiao8831 opened this issue Sep 11, 2024 · 1 comment

Comments

@huangqingbiao8831
Copy link

huangqingbiao8831 commented Sep 11, 2024

I modified the single port configuration, but the video does not come out. My modifications are as follows:
1、in mediasoup/worker.ts:
let webRtcServerOptions =
{
listenInfos :
[
{
protocol : udp,
ip : '0.0.0.0',
announcedIp : '',
port : 44444

      }
      // {
      //     protocol    : tcp,
      //     ip          : '0.0.0.0',
      //     announcedIp :'',
      //     port        : 44444
      // }
    ],
};
for (const listenInfo of webRtcServerOptions.listenInfos)
		{
			listenInfo.port += i;
		}
  const webRtcServer = await worker.createWebRtcServer(webRtcServerOptions);
	  worker.appData.webRtcServer = webRtcServer;
  console.log("world========>webrtcServer id:%s",webRtcServer.id);

  this.workers.push(worker);
}

}
2、in mediasoup/webrtc.transport.ts
const webrtcserver = worker.appData.webRtcServer as types.WebRtcServer;
const transport = await router.createWebRtcTransport({
webRtcServer: webrtcserver, // webrtcserver here...
listenIps: listenIps,
numSctpStreams: { OS: 1024, MIS: 1024 },
enableUdp: true,
enableTcp: false,
preferUdp: true,
enableSctp:true,
initialAvailableOutgoingBitrate,
});
After the modification, both the video and audio cannot be displayed

@woody146
Copy link
Owner

Firstly, you should check your code to run with origin mediasoup (https://github.com/versatica/mediasoup/)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants