Skip to content

five-on-it / packages/protocol/src/rtc / parseRtcSignal

Function: parseRtcSignal() ​

parseRtcSignal(text): { op: "offer"; sdp: string; type: "rtc"; } | { op: "answer"; sdp: string; type: "rtc"; } | { candidate: { candidate: string; sdpMid?: string | null; sdpMLineIndex?: number | null; usernameFragment?: string | null; }; op: "candidate"; type: "rtc"; } | { op: "close"; reason: "full" | "failed" | "dropped" | "timeout" | "silence" | "worker" | "remote" | "frames"; type: "rtc"; } | undefined

Defined in: packages/protocol/src/rtc.ts:98

Parses a text frame as a signalling frame; undefined when it is not one.

Parameters ​

text ​

string

Returns ​

{ op: "offer"; sdp: string; type: "rtc"; } | { op: "answer"; sdp: string; type: "rtc"; } | { candidate: { candidate: string; sdpMid?: string | null; sdpMLineIndex?: number | null; usernameFragment?: string | null; }; op: "candidate"; type: "rtc"; } | { op: "close"; reason: "full" | "failed" | "dropped" | "timeout" | "silence" | "worker" | "remote" | "frames"; type: "rtc"; } | undefined