interface PeerEvents {
    add-stream: ((name, stream) => void);
    channel-state-change: ((state) => void);
    connection-state-change: ((state) => void);
    data-channel: ((channel) => void);
    error: ((error) => void);
    ice-connection-state-change: ((state) => void);
    remove-stream: ((id) => void);
    signal: ((signal) => void);
    signaling-state-change: ((state) => void);
}

Properties

add-stream: ((name, stream) => void)

Fired when a MediaStream is received.

Type declaration

    • (name, stream): void
    • Fired when a MediaStream is received.

      Parameters

      • name: string
      • stream: MediaStream

      Returns void

Param: name

Param: stream

Returns

channel-state-change: ((state) => void)

Fired when the signaling channel's readyState changes.

Type declaration

    • (state): void
    • Fired when the signaling channel's readyState changes.

      Parameters

      • state: RTCDataChannelState

      Returns void

Param: state

Returns

connection-state-change: ((state) => void)

Fired when the RTCPeerConnection's connectionState changes.

Type declaration

    • (state): void
    • Fired when the RTCPeerConnection's connectionState changes.

      Parameters

      • state: RTCPeerConnectionState

      Returns void

Param: state

Returns

data-channel: ((channel) => void)

Fired when a RTCDataChannel is created or received.

Type declaration

    • (channel): void
    • Fired when a RTCDataChannel is created or received.

      Parameters

      • channel: RTCDataChannel

      Returns void

Param: channel

Returns

error: ((error) => void)

Fired when an error occurs.

Type declaration

    • (error): void
    • Fired when an error occurs.

      Parameters

      • error: default

      Returns void

Param: error

Returns

ice-connection-state-change: ((state) => void)

Fired when the RTCPeerConnection's iceConnectionState changes.

Type declaration

    • (state): void
    • Fired when the RTCPeerConnection's iceConnectionState changes.

      Parameters

      • state: RTCIceConnectionState

      Returns void

Param: state

Returns

remove-stream: ((id) => void)

Fired when a received MediaStream is removed.

Type declaration

    • (id): void
    • Fired when a received MediaStream is removed.

      Parameters

      • id: string

      Returns void

Param: id

Returns

signal: ((signal) => void)

Fired when a signal can't be transported internally via the signaling channel.

Type declaration

    • (signal): void
    • Fired when a signal can't be transported internally via the signaling channel.

      Parameters

      Returns void

Param: signal

Returns

signaling-state-change: ((state) => void)

Fired when the RTCPeerConnection's signalingState changes.

Type declaration

    • (state): void
    • Fired when the RTCPeerConnection's signalingState changes.

      Parameters

      • state: RTCSignalingState

      Returns void

Param: state

Returns

Generated using TypeDoc