Interface SignalingClient

[[SignalingClient]] is the top-level interface for opening a signaling connection over WebSocket.

interface SignalingClient {
    closeConnection(): void;
    demoteFromPrimaryMeeting(): void;
    join(settings: SignalingClientJoin): void;
    leave(): void;
    mute(muted: boolean): void;
    openConnection(request: SignalingClientConnectionRequest): void;
    pause(streamIds: number[]): void;
    pingPong(pingPongFrame: SdkPingPongFrame): number;
    promoteToPrimaryMeeting(credentials: MeetingSessionCredentials): void;
    ready(): boolean;
    registerObserver(observer: SignalingClientObserver): void;
    remoteVideoUpdate(
        addedOrUpdated: SignalingClientVideoSubscriptionConfiguration[],
        removedMids: string[],
    ): void;
    removeObserver(observer: SignalingClientObserver): void;
    resume(streamIds: number[]): void;
    sendClientMetrics(clientMetricFrame: SdkClientMetricFrame): void;
    sendDataMessage(messageFrame: SdkDataMessageFrame): void;
    sendMeetingSessionTiming(timing: MeetingSessionTiming): void;
    subscribe(settings: SignalingClientSubscribe): void;
}

Implemented by

Methods

  • Closes any existing connection.

    Prior to closing, it delivers a WebSocketClosing event. Upon receipt of the final WebSocket close event, the connection request queue is serviced. If there is no connection to close, this function just services the connection request queue and returns.

    Returns void

  • Enqueues an attempt to open a signaling connection over WebSocket.

    Once initiated, a WebSocketConnecting event is sent to observers. If successful, a WebSocketOpen event is sent out. If the connection could not be established for any reason, a WebSocketFailed event is sent followed by WebSocketClosed event. If any existing connection is open, then that is first closed (and the WebSocketClosed event is sent out) before the open is tried.

    Parameters

    Returns void

  • Sends a ping or pong with an id.

    Parameters

    • pingPongFrame: SdkPingPongFrame

      ping or pong frame to send.

    Returns number

    the ms timestamp when the message was sent.

  • Allows an attendee in a replica meeting to join the primary meeting as if they were a normal attendee. Once successfully joined they will receive a callback on SignalingClientObserver.handleSignalingClientEvent. See documentation of observer for more information.

    They may also receive another callback on SignalingClientObserver.handleSignalingClientEvent to indicate they can begin to share video.

    Failure will also be indicated through the SignalingClientObserver.handleSignalingClientEvent callback.

    Parameters

    Returns void

  • Returns whether the client has a connection open in the ready state

    Returns boolean

    Whether the client has a connection open in the ready state

  • Sends a remote video update frame with the given configurations and removed streams. These can be sent in parallel to subscribe without issue, but note that subscribe will overwrite any configuration set here.

    Note that the addedOrUpdated is basically a flattened map with SignalingClientVideoSubscriptionConfiguration.mid being the key, which is why we only need to pass the mid when removing.

    Parameters

    Returns void

  • Sends a client stats frame.

    Parameters

    • clientMetricFrame: SdkClientMetricFrame

    Returns void