diff --git a/app/src/Room.js b/app/src/Room.js index be9fa89d..d5406e02 100644 --- a/app/src/Room.js +++ b/app/src/Room.js @@ -251,7 +251,7 @@ module.exports = class Room { const { maxIncomingBitrate, initialAvailableOutgoingBitrate, listenInfos } = this.webRtcTransport; const webRtcTransportOptions = { - listenInfos: listenInfos, + ...(this.webRtcServerActive ? { webRtcServer: this.webRtcServer } : { listenInfos }), enableUdp: true, enableTcp: true, preferUdp: true, @@ -259,8 +259,6 @@ module.exports = class Room { initialAvailableOutgoingBitrate, }; - if (this.webRtcServerActive) webRtcTransportOptions.webRtcServer = this.webRtcServer; - const transport = await this.router.createWebRtcTransport(webRtcTransportOptions); if (!transport) {