@mattkrick/fast-rtc-peer
Options
All
Public
Public/Protected
All
Inherited
Externals
Only exported
Menu
FastRTCPeer
constructor
data
Channel
id
is
Offerer
peer
Connection
wrtc
defaultICEServers
prefixed
add
Listener
add
Media
close
dispatch
emit
event
Names
handle
Answer
handle
Candidate
handle
Offer
listener
Count
listeners
off
on
on
Data
Channel
Close
on
Data
Channel
Message
on
Data
Channel
Open
on
Ice
Candidate
on
Ice
Connection
State
Change
on
Negotiation
Needed
once
remove
All
Listeners
remove
Listener
send
set
Channel
Events
setup
default
Config
Answer
Payload
Candidate
Payload
Offer
Payload
Peer
Config
WRTC
Dispatch
Payload
ANSWER
CANDIDATE
DATA
DATA_
CLOSE
DATA_
OPEN
OFFER
SIGNAL
Type parameters
EventTypes
:
string
|
symbol
Hierarchy
EventEmitter
FastRTCPeer
Index
Modules
Event
Emitter
Constructors
constructor
Properties
data
Channel
id
is
Offerer
peer
Connection
wrtc
defaultICEServers
prefixed
Methods
add
Listener
add
Media
close
dispatch
emit
event
Names
handle
Answer
handle
Candidate
handle
Offer
listener
Count
listeners
off
on
on
Data
Channel
Close
on
Data
Channel
Message
on
Data
Channel
Open
on
Ice
Candidate
on
Ice
Connection
State
Change
on
Negotiation
Needed
once
remove
All
Listeners
remove
Listener
send
set
Channel
Events
setup
Object literals
default
Config
Constructors
constructor
new
FastRTCPeer
(
userConfig
:
PeerConfig
)
:
FastRTCPeer
Parameters
userConfig:
PeerConfig
Returns
FastRTCPeer
Properties
Optional
data
Channel
data
Channel
:
RTCDataChannel
id
id
:
string
is
Offerer
is
Offerer
:
boolean
peer
Connection
peer
Connection
:
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
add
Media
add
Media
(
mediaConstraints
:
MediaStreamConstraints
)
:
Promise
<
void
>
Parameters
mediaConstraints:
MediaStreamConstraints
Returns
Promise
<
void
>
close
close
(
)
:
void
Returns
void
dispatch
dispatch
(
payload
:
DispatchPayload
)
:
void
Parameters
payload:
DispatchPayload
Returns
void
Private
handle
Answer
handle
Answer
(
initSDP
:
RTCSessionDescriptionInit
)
:
void
Parameters
initSDP:
RTCSessionDescriptionInit
Returns
void
Private
handle
Candidate
handle
Candidate
(
candidateObj
:
RTCIceCandidateInit
)
:
void
Parameters
candidateObj:
RTCIceCandidateInit
Returns
void
Private
handle
Offer
handle
Offer
(
nitSDP
:
RTCSessionDescriptionInit
)
:
Promise
<
void
>
Parameters
nitSDP:
RTCSessionDescriptionInit
Returns
Promise
<
void
>
Private
on
Data
Channel
Close
on
Data
Channel
Close
(
)
:
void
Returns
void
Private
on
Data
Channel
Message
on
Data
Channel
Message
(
event
:
MessageEvent
)
:
void
Parameters
event:
MessageEvent
Returns
void
Private
on
Data
Channel
Open
on
Data
Channel
Open
(
)
:
void
Returns
void
Private
on
Ice
Candidate
on
Ice
Candidate
(
event
:
RTCPeerConnectionIceEvent
)
:
void
Parameters
event:
RTCPeerConnectionIceEvent
Returns
void
Private
on
Ice
Connection
State
Change
on
Ice
Connection
State
Change
(
)
:
void
Returns
void
Private
on
Negotiation
Needed
on
Negotiation
Needed
(
)
:
Promise
<
void
>
Returns
Promise
<
void
>
send
send
(
data
:
string
|
Blob
|
ArrayBuffer
|
ArrayBufferView
)
:
void
Parameters
data:
string
|
Blob
|
ArrayBuffer
|
ArrayBufferView
Returns
void
Private
set
Channel
Events
set
Channel
Events
(
channel
:
RTCDataChannel
)
:
void
Parameters
channel:
RTCDataChannel
Returns
void
Private
setup
setup
(
config
:
RTCConfiguration
)
:
void
Parameters
config:
RTCConfiguration
Returns
void
Object literals
Static
default
Config
default
Config
:
object
ice
Servers
ice
Servers
:
RTCIceServer[]
= FastRTCPeer.defaultICEServers