move mediaServer.start() into try catch

This commit is contained in:
dank074
2026-02-27 02:11:29 -06:00
committed by Rory&
parent f94f58da3b
commit 6090f414ce
2 changed files with 2 additions and 2 deletions

View File

@@ -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}`)}`);

View File

@@ -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(),