From 6438953a4ba1b885fb0f9e9df23c077875ec331f Mon Sep 17 00:00:00 2001 From: Rory& Date: Thu, 19 Mar 2026 09:03:00 +0100 Subject: [PATCH] Fix video schema to allow a bunch of undefineds --- src/schemas/webrtc/VoiceVideoSchema.ts | 14 +++++++------- src/webrtc/opcodes/Video.ts | 3 +++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/schemas/webrtc/VoiceVideoSchema.ts b/src/schemas/webrtc/VoiceVideoSchema.ts index 64f301cbb..95df02feb 100644 --- a/src/schemas/webrtc/VoiceVideoSchema.ts +++ b/src/schemas/webrtc/VoiceVideoSchema.ts @@ -24,12 +24,12 @@ export interface VoiceVideoSchema { streams?: { type: "video" | "audio" | "screen"; rid: string; - ssrc: number; - active: boolean; - quality: number; - rtx_ssrc: number; - max_bitrate: number; - max_framerate: number; - max_resolution: { type: string; width: number; height: number }; + ssrc?: number; + active?: boolean; + quality?: number; + rtx_ssrc?: number; + max_bitrate?: number; + max_framerate?: number; + max_resolution?: { type: string; width: number; height: number }; }[]; } diff --git a/src/webrtc/opcodes/Video.ts b/src/webrtc/opcodes/Video.ts index 38eb419ba..323438a66 100644 --- a/src/webrtc/opcodes/Video.ts +++ b/src/webrtc/opcodes/Video.ts @@ -105,6 +105,9 @@ export async function onVideo(this: WebRtcWebSocket, payload: VoicePayload) { } // check if client has signaled that it will send video if (wantsToProduceVideo) { + // TODO: fix spacebar-webrtc-types... + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-expect-error this.webRtcClient!.videoStream = { ...stream, type: "video" }; // client sends "screen" on go live but expects "video" on response // check if we are already publishing video, if not, publish a new video track for it if (!this.webRtcClient!.isProducingVideo()) {