@mattkrick/fast-rtc-peer
Options
All
  • Public
  • Public/Protected
  • All
Menu

Type parameters

  • EventTypes: string | symbol

Hierarchy

  • EventEmitter
    • FastRTCPeer

Index

Constructors

constructor

Properties

Optional dataChannel

dataChannel: RTCDataChannel

id

id: string

isOfferer

isOfferer: boolean

peerConnection

peerConnection: RTCPeerConnection

wrtc

wrtc: WRTC | Window

Static defaultICEServers

defaultICEServers: Array<RTCIceServer> = [{urls: 'stun:stun.l.google.com:19302'},{urls: 'stun:global.stun.twilio.com:3478?transport=udp'}]

Methods

addMedia

  • addMedia(mediaConstraints: MediaStreamConstraints): Promise<void>
  • Parameters

    • mediaConstraints: MediaStreamConstraints

    Returns Promise<void>

close

  • close(): void

dispatch

Private handleAnswer

  • handleAnswer(initSDP: RTCSessionDescriptionInit): void
  • Parameters

    • initSDP: RTCSessionDescriptionInit

    Returns void

Private handleCandidate

  • handleCandidate(candidateObj: RTCIceCandidateInit): void

Private handleOffer

  • handleOffer(nitSDP: RTCSessionDescriptionInit): Promise<void>
  • Parameters

    • nitSDP: RTCSessionDescriptionInit

    Returns Promise<void>

Private onDataChannelClose

  • onDataChannelClose(): void

Private onDataChannelMessage

  • onDataChannelMessage(event: MessageEvent): void

Private onDataChannelOpen

  • onDataChannelOpen(): void

Private onIceCandidate

  • onIceCandidate(event: RTCPeerConnectionIceEvent): void

Private onIceConnectionStateChange

  • onIceConnectionStateChange(): void

Private onNegotiationNeeded

  • onNegotiationNeeded(): Promise<void>

send

  • send(data: string | Blob | ArrayBuffer | ArrayBufferView): void
  • Parameters

    • data: string | Blob | ArrayBuffer | ArrayBufferView

    Returns void

Private setChannelEvents

Private setup

  • setup(config: RTCConfiguration): void

Object literals

Static defaultConfig

defaultConfig: object

iceServers

iceServers: RTCIceServer[] = FastRTCPeer.defaultICEServers