mirror of
https://github.com/spacebarchat/server.git
synced 2026-03-30 20:25:40 +00:00
move mediaServer.start() into try catch
This commit is contained in:
@@ -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}`)}`);
|
||||
|
||||
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user