From 625cf56d39d9e0ddfd3797ff36c31845c4a7e4d9 Mon Sep 17 00:00:00 2001 From: dank074 Date: Thu, 17 Apr 2025 00:19:36 -0500 Subject: [PATCH] changes --- src/webrtc/opcodes/Speaking.ts | 2 +- src/webrtc/opcodes/Video.ts | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/webrtc/opcodes/Speaking.ts b/src/webrtc/opcodes/Speaking.ts index da55b5ac..ee01c444 100644 --- a/src/webrtc/opcodes/Speaking.ts +++ b/src/webrtc/opcodes/Speaking.ts @@ -29,7 +29,7 @@ import { export async function onSpeaking(this: WebRtcWebSocket, data: VoicePayload) { if (!this.webRtcClient) return; - Promise.all( + await Promise.all( Array.from( mediaServer.getClientsForRtcServer( this.webRtcClient.rtc_server_id, diff --git a/src/webrtc/opcodes/Video.ts b/src/webrtc/opcodes/Video.ts index 391255bf..326c7b05 100644 --- a/src/webrtc/opcodes/Video.ts +++ b/src/webrtc/opcodes/Video.ts @@ -37,8 +37,12 @@ export async function onVideo(this: WebRtcWebSocket, payload: VoicePayload) { where: { id: rtc_server_id }, }); + if (!stream) return; + // only the stream owner can publish to a go live stream - if (stream?.owner_id != this.user_id) return; + if (stream?.owner_id != this.user_id) { + return; + } } const stream = d.streams?.find((element) => element !== undefined);