@twilio/video-node-sdk - v1.0.0-beta.1
    Preparing search index...

    Type Alias RoomEvents

    Listener signatures for every event a Room can emit.

    The track events at the end of this map are emitted by each RemoteParticipant and re-emitted here, with the participant that emitted them appended as the last argument. Listening here handles every participant's tracks in one place, instead of attaching listeners to each participant.

    type RoomEvents = {
        connectFailure: (error: TwilioError) => void;
        disconnected: (room: Room, error?: TwilioError) => void;
        dominantSpeakerChanged: (participant: RemoteParticipant | null) => void;
        participantConnected: (participant: RemoteParticipant) => void;
        participantDisconnected: (participant: RemoteParticipant) => void;
        participantReconnected: (participant: RemoteParticipant) => void;
        participantReconnecting: (participant: RemoteParticipant) => void;
        reconnected: () => void;
        reconnecting: (error?: TwilioError) => void;
        recordingStarted: () => void;
        recordingStopped: () => void;
        trackDisabled: (
            publication: RemoteTrackPublication,
            participant: RemoteParticipant,
        ) => void;
        trackEnabled: (
            publication: RemoteTrackPublication,
            participant: RemoteParticipant,
        ) => void;
        trackPublished: (
            publication: RemoteTrackPublication,
            participant: RemoteParticipant,
        ) => void;
        trackSubscribed: (
            track: RemoteVideoTrack | RemoteAudioTrack | RemoteDataTrack,
            publication: RemoteTrackPublication,
            participant: RemoteParticipant,
        ) => void;
        trackSubscriptionFailed: (
            error: TwilioError,
            publication: RemoteTrackPublication,
            participant: RemoteParticipant,
        ) => void;
        trackUnpublished: (
            publication: RemoteTrackPublication,
            participant: RemoteParticipant,
        ) => void;
        trackUnsubscribed: (
            track: RemoteVideoTrack | RemoteAudioTrack | RemoteDataTrack,
            publication: RemoteTrackPublication,
            participant: RemoteParticipant,
        ) => void;
        transcription: (transcriptionJson: string) => void;
        videoTrackSwitchedOff: (
            track: RemoteVideoTrack,
            participant: RemoteParticipant,
        ) => void;
        videoTrackSwitchedOn: (
            track: RemoteVideoTrack,
            participant: RemoteParticipant,
        ) => void;
    }
    Index
    connectFailure: (error: TwilioError) => void

    The Room could not be joined. Terminal: no further events follow.

    Used internally by connect, which rejects with this error and disposes the partially built Room. Application code never receives a Room on which this can still fire, so failures are handled by catching the rejection from connect.

    Type Declaration

    disconnected: (room: Room, error?: TwilioError) => void

    The local participant left the Room, either by calling Room.disconnect or because the server ended the session.

    Type Declaration

    dominantSpeakerChanged: (participant: RemoteParticipant | null) => void

    The loudest participant changed. Emitted only when the Room was joined with enableDominantSpeaker: true.

    Type Declaration

    participantConnected: (participant: RemoteParticipant) => void

    A remote participant joined the Room.

    Not emitted for participants already in the Room when connect resolved. Those are part of the Room's starting state: read them from Room.participants.

    Type Declaration

    participantDisconnected: (participant: RemoteParticipant) => void

    A remote participant left the Room. Their tracks are unsubscribed first.

    Type Declaration

    participantReconnected: (participant: RemoteParticipant) => void

    A remote participant restored their connection.

    Type Declaration

    participantReconnecting: (participant: RemoteParticipant) => void

    A remote participant lost their connection and is trying to restore it.

    Type Declaration

    reconnected: () => void

    The connection was restored after reconnecting. Media resumes.

    reconnecting: (error?: TwilioError) => void

    The signaling or media connection dropped and the SDK is trying to restore it. Media is interrupted until reconnected fires.

    Type Declaration

      • (error?: TwilioError): void
      • Parameters

        • Optionalerror: TwilioError

          Why the connection dropped, when the SDK can attribute it.

        Returns void

    recordingStarted: () => void

    Recording started for this Room.

    recordingStopped: () => void

    Recording stopped for this Room.

    trackDisabled: (
        publication: RemoteTrackPublication,
        participant: RemoteParticipant,
    ) => void

    A remote participant muted a track they publish. The track stays subscribed but stops delivering media.

    Type Declaration

    trackEnabled: (
        publication: RemoteTrackPublication,
        participant: RemoteParticipant,
    ) => void

    A remote participant unmuted a track they publish.

    Type Declaration

    trackPublished: (
        publication: RemoteTrackPublication,
        participant: RemoteParticipant,
    ) => void

    A remote participant published a track. Subscription follows separately, and trackSubscribed reports it.

    Type Declaration

    trackSubscribed: (
        track: RemoteVideoTrack | RemoteAudioTrack | RemoteDataTrack,
        publication: RemoteTrackPublication,
        participant: RemoteParticipant,
    ) => void

    A remote track was subscribed to and is now delivering media or messages.

    A participant who was already publishing emits this after connect resolves. Subscriptions that completed before the listener was attached are not replayed; they appear in participant.tracks with isSubscribed set to true.

    Type Declaration

    trackSubscriptionFailed: (
        error: TwilioError,
        publication: RemoteTrackPublication,
        participant: RemoteParticipant,
    ) => void

    Subscribing to a remote track failed. The track stays unsubscribed.

    Type Declaration

    trackUnpublished: (
        publication: RemoteTrackPublication,
        participant: RemoteParticipant,
    ) => void

    A remote participant unpublished a track.

    Type Declaration

    trackUnsubscribed: (
        track: RemoteVideoTrack | RemoteAudioTrack | RemoteDataTrack,
        publication: RemoteTrackPublication,
        participant: RemoteParticipant,
    ) => void

    A remote track was unsubscribed from and stops delivering media. Its frame and message callbacks will not fire again.

    Type Declaration

    transcription: (transcriptionJson: string) => void

    A transcription result arrived. Emitted only when the Room was joined with receiveTranscriptions: true.

    Type Declaration

      • (transcriptionJson: string): void
      • Parameters

        • transcriptionJson: string

          The raw transcription payload, as a JSON string.

        Returns void

    videoTrackSwitchedOff: (
        track: RemoteVideoTrack,
        participant: RemoteParticipant,
    ) => void

    The server stopped delivering a subscribed video track, typically to stay within the Room's bandwidth profile. The track stays subscribed and its isSwitchedOff reads true.

    Type Declaration

    videoTrackSwitchedOn: (
        track: RemoteVideoTrack,
        participant: RemoteParticipant,
    ) => void

    The server resumed delivering a video track that was switched off.

    Type Declaration