Interface WebRTCEndpointEvents<EndpointMetadata, TrackMetadata>

Events emitted by the WebRTCEndpoint instance.

interface WebRTCEndpointEvents<EndpointMetadata, TrackMetadata> {
    bandwidthEstimationChanged: ((estimation) => void);
    connected: ((endpointId, otherEndpoints) => void);
    connectionError: ((error) => void);
    disconnectRequested: ((event) => void);
    disconnected: (() => void);
    endpointAdded: ((endpoint) => void);
    endpointRemoved: ((endpoint) => void);
    endpointUpdated: ((endpoint) => void);
    localEndpointMetadataChanged: ((event) => void);
    localTrackAdded: ((event) => void);
    localTrackBandwidthSet: ((event) => void);
    localTrackEncodingBandwidthSet: ((event) => void);
    localTrackEncodingDisabled: ((event) => void);
    localTrackEncodingEnabled: ((event) => void);
    localTrackMetadataChanged: ((event) => void);
    localTrackMuted: ((event) => void);
    localTrackRemoved: ((event) => void);
    localTrackReplaced: ((event) => void);
    localTrackUnmuted: ((event) => void);
    sendMediaEvent: ((mediaEvent) => void);
    signalingError: ((error) => void);
    targetTrackEncodingRequested: ((event) => void);
    trackAdded: ((ctx) => void);
    trackEncodingDisabled: ((context, encoding) => void);
    trackEncodingEnabled: ((context, encoding) => void);
    trackReady: ((ctx) => void);
    trackRemoved: ((ctx) => void);
    trackUpdated: ((ctx) => void);
    tracksPriorityChanged: ((enabledTracks, disabledTracks) => void);
}

Type Parameters

  • EndpointMetadata
  • TrackMetadata

Properties

bandwidthEstimationChanged: ((estimation) => void)

Emitted every time the server estimates client's bandwidth.

Type declaration

    • (estimation): void
    • Parameters

      • estimation: bigint

        client's available incoming bitrate estimated by the server. It's measured in bits per second.

      Returns void

connected: ((endpointId, otherEndpoints) => void)

Emitted when endpoint of this WebRTCEndpoint instance is ready. Triggered by WebRTCEndpoint.connect

Type declaration

connectionError: ((error) => void)

Emitted in case of errors related to multimedia session e.g. ICE connection.

Type declaration

    • (error): void
    • Parameters

      • error: {
            event: Event;
            message: string;
        }
        • event: Event
        • message: string

      Returns void

disconnectRequested: ((event) => void)

Type declaration

    • (event): void
    • Parameters

      • event: any

      Returns void

disconnected: (() => void)

Emitted when endpoint of this WebRTCEndpoint instance was removed.

Type declaration

    • (): void
    • Returns void

endpointAdded: ((endpoint) => void)

Emitted each time new endpoint is added to the room.

Type declaration

endpointRemoved: ((endpoint) => void)

Emitted each time endpoint is removed, emitted only for other endpoints.

Type declaration

endpointUpdated: ((endpoint) => void)

Emitted each time endpoint has its metadata updated.

Type declaration

localEndpointMetadataChanged: ((event) => void)

Type declaration

localTrackAdded: ((event) => void)

Type declaration

localTrackBandwidthSet: ((event) => void)

Type declaration

    • (event): void
    • Parameters

      • event: {
            bandwidth: number;
            trackId: string;
        }
        • bandwidth: number
        • trackId: string

      Returns void

localTrackEncodingBandwidthSet: ((event) => void)

Type declaration

    • (event): void
    • Parameters

      • event: {
            bandwidth: number;
            rid: string;
            trackId: string;
        }
        • bandwidth: number
        • rid: string
        • trackId: string

      Returns void

localTrackEncodingDisabled: ((event) => void)

Type declaration

    • (event): void
    • Parameters

      Returns void

localTrackEncodingEnabled: ((event) => void)

Type declaration

    • (event): void
    • Parameters

      Returns void

localTrackMetadataChanged: ((event) => void)

Type declaration

    • (event): void
    • Parameters

      Returns void

localTrackMuted: ((event) => void)

Type declaration

    • (event): void
    • Parameters

      • event: {
            trackId: string;
        }
        • trackId: string

      Returns void

localTrackRemoved: ((event) => void)

Type declaration

    • (event): void
    • Parameters

      • event: {
            trackId: string;
        }
        • trackId: string

      Returns void

localTrackReplaced: ((event) => void)

Type declaration

localTrackUnmuted: ((event) => void)

Type declaration

    • (event): void
    • Parameters

      • event: {
            trackId: string;
        }
        • trackId: string

      Returns void

sendMediaEvent: ((mediaEvent) => void)

Emitted each time WebRTCEndpoint need to send some data to the server.

Type declaration

    • (mediaEvent): void
    • Parameters

      • mediaEvent: string

      Returns void

signalingError: ((error) => void)

Emitted in case of errors related to multimedia session e.g. ICE connection.

Type declaration

    • (error): void
    • Parameters

      • error: {
            message: string;
        }
        • message: string

      Returns void

targetTrackEncodingRequested: ((event) => void)

Type declaration

    • (event): void
    • Parameters

      Returns void

trackAdded: ((ctx) => void)

Emitted each time the endpoint which was already in the room, adds new track. Fields track and stream will be set to null. These fields will be set to non-null value in trackReady

Type declaration

trackEncodingDisabled: ((context, encoding) => void)

Emitted each time track encoding has been disabled.

Type declaration

trackEncodingEnabled: ((context, encoding) => void)

Emitted each time track encoding has been enabled.

Type declaration

trackReady: ((ctx) => void)

Emitted when data in a new track arrives.

This event is always emitted after trackAdded. It informs the user that data related to the given track arrives and can be played or displayed.

Type declaration

trackRemoved: ((ctx) => void)

Emitted when some track will no longer be sent.

It will also be emitted before endpointRemoved for each track of this endpoint.

Type declaration

trackUpdated: ((ctx) => void)

Emitted each time endpoint has its track metadata updated.

Type declaration

tracksPriorityChanged: ((enabledTracks, disabledTracks) => void)

Currently, this event is only emitted when DisplayManager in RTC Engine is enabled and simulcast is disabled.

Emitted when priority of video tracks have changed.

Type declaration