summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authordank074 <torresefrain10@gmail.com>2026-02-27 02:11:29 -0600
committerRory& <root@rory.gay>2026-02-27 09:37:22 +0100
commit6090f414ce82ab2941fa1406e69c98216babe751 (patch)
tree4f247dd4695cfcae9ba8861347b2f9f8c4ae0dca /src
parentExplicitly make webrtc service depend on sfu service (diff)
downloadserver-ts-6090f414ce82ab2941fa1406e69c98216babe751.tar.xz
move mediaServer.start() into try catch
Diffstat (limited to 'src')
-rw-r--r--src/webrtc/Server.ts2
-rw-r--r--src/webrtc/opcodes/Identify.ts2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/webrtc/Server.ts b/src/webrtc/Server.ts

index 312a97c9..bc26f3d1 100644 --- a/src/webrtc/Server.ts +++ b/src/webrtc/Server.ts
@@ -66,12 +66,12 @@ export class Server { // try to load webrtc library, if failed just don't start webrtc endpoint try { await loadWebRtcLibrary(); + await mediaServer.start(WRTC_PUBLIC_IP, WRTC_PORT_MIN, WRTC_PORT_MAX); } catch (e) { console.log(`[WebRTC] ${yellow("WEBRTC disabled")}`); return; } - await mediaServer.start(WRTC_PUBLIC_IP, WRTC_PORT_MIN, WRTC_PORT_MAX); if (!this.server.listening) { this.server.listen(this.port); console.log(`[WebRTC] ${green(`online on 0.0.0.0:${this.port}`)}`); diff --git a/src/webrtc/opcodes/Identify.ts b/src/webrtc/opcodes/Identify.ts
index 50976794..d61d4bbb 100644 --- a/src/webrtc/opcodes/Identify.ts +++ b/src/webrtc/opcodes/Identify.ts
@@ -91,7 +91,7 @@ export async function onIdentify(this: WebRtcWebSocket, data: VoicePayload) { }); // the server generates a unique ssrc for the audio and video stream. Must be unique among users connected to same server - // UDP clients will respect this ssrc, but websocket clients will generate and replace it with their own + // UDP clients will respect this ssrc, but webrtc clients will generate and replace it with their own const generatedSsrc: SSRCs = { audio_ssrc: generateSsrc(), video_ssrc: generateSsrc(),