Fix video schema to allow a bunch of undefineds
2 files changed, 10 insertions, 7 deletions
diff --git a/src/schemas/webrtc/VoiceVideoSchema.ts b/src/schemas/webrtc/VoiceVideoSchema.ts
index 64f301cb..95df02fe 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 38eb419b..323438a6 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()) {
|