Class: RTCPeerConnection
#
Hierarchy↳ RTCPeerConnection
#
Constructors#
constructor• new RTCPeerConnection(__namedParameters?
)
#
ParametersName | Type |
---|---|
__namedParameters | Partial <PeerConfig> |
#
Overrides#
Defined inpackages/webrtc/src/peerConnection.ts:111
#
Properties#
certificates• Private
Readonly
certificates: RTCCertificate[] = []
#
Defined inpackages/webrtc/src/peerConnection.ts:101
#
cname• Readonly
cname: string
#
Defined inpackages/webrtc/src/peerConnection.ts:65
#
configuration• configuration: Required
<PeerConfig>
#
Defined inpackages/webrtc/src/peerConnection.ts:70
#
connectionState• connectionState: "closed"
| "connecting"
| "failed"
| "disconnected"
| "new"
| "connected"
= "new"
#
Defined inpackages/webrtc/src/peerConnection.ts:72
#
connectionStateChange• Readonly
connectionStateChange: default
<["closed"
| "connecting"
| "failed"
| "disconnected"
| "new"
| "connected"
]>
#
Defined inpackages/webrtc/src/peerConnection.ts:81
#
currentLocalDescription• Private
Optional
currentLocalDescription: SessionDescription
#
Defined inpackages/webrtc/src/peerConnection.ts:106
#
currentRemoteDescription• Private
Optional
currentRemoteDescription: SessionDescription
#
Defined inpackages/webrtc/src/peerConnection.ts:107
#
dtlsTransport• dtlsTransport: RTCDtlsTransport
#
Defined inpackages/webrtc/src/peerConnection.ts:67
#
iceConnectionState• iceConnectionState: "closed"
| "failed"
| "disconnected"
| "new"
| "connected"
| "checking"
| "completed"
= "new"
#
Defined inpackages/webrtc/src/peerConnection.ts:73
#
iceConnectionStateChange• Readonly
iceConnectionStateChange: default
<["closed"
| "failed"
| "disconnected"
| "new"
| "connected"
| "checking"
| "completed"
]>
#
Defined inpackages/webrtc/src/peerConnection.ts:79
#
iceGatheringState• iceGatheringState: "new"
| "gathering"
| "complete"
= "new"
#
Defined inpackages/webrtc/src/peerConnection.ts:74
#
iceGatheringStateChange• Readonly
iceGatheringStateChange: default
<["new"
| "gathering"
| "complete"
]>
#
Defined inpackages/webrtc/src/peerConnection.ts:78
#
iceTransport• iceTransport: RTCIceTransport
#
Defined inpackages/webrtc/src/peerConnection.ts:66
#
isClosed• Private
isClosed: boolean
= false
#
Defined inpackages/webrtc/src/peerConnection.ts:110
#
masterTransportEstablished• masterTransportEstablished: boolean
= false
#
Defined inpackages/webrtc/src/peerConnection.ts:69
#
negotiationneeded• negotiationneeded: boolean
= false
#
Defined inpackages/webrtc/src/peerConnection.ts:76
#
onDataChannel• Readonly
onDataChannel: default
<[RTCDataChannel]>
#
Defined inpackages/webrtc/src/peerConnection.ts:82
#
onIceCandidate• Readonly
onIceCandidate: default
<[RTCIceCandidate]>
#
Defined inpackages/webrtc/src/peerConnection.ts:90
#
onNegotiationneeded• Readonly
onNegotiationneeded: default
<[]>
#
Defined inpackages/webrtc/src/peerConnection.ts:91
#
onRemoteTransceiverAdded• Readonly
onRemoteTransceiverAdded: default
<[RTCRtpTransceiver]>
#
Defined inpackages/webrtc/src/peerConnection.ts:83
#
onTransceiver• Readonly
onTransceiver: default
<[RTCRtpTransceiver]>
should use onRemoteTransceiverAdded
deprecated
#
Defined inpackages/webrtc/src/peerConnection.ts:88
#
onTransceiverAdded• Readonly
onTransceiverAdded: default
<[RTCRtpTransceiver]>
#
Defined inpackages/webrtc/src/peerConnection.ts:89
#
onconnectionstatechange• Optional
onconnectionstatechange: Callback
#
Defined inpackages/webrtc/src/peerConnection.ts:98
#
ondatachannel• Optional
ondatachannel: CallbackWithValue
<RTCDataChannelEvent>
#
Defined inpackages/webrtc/src/peerConnection.ts:93
#
onicecandidate• Optional
onicecandidate: CallbackWithValue
<RTCPeerConnectionIceEvent>
#
Defined inpackages/webrtc/src/peerConnection.ts:94
#
onnegotiationneeded• Optional
onnegotiationneeded: CallbackWithValue
<any>
#
Defined inpackages/webrtc/src/peerConnection.ts:95
#
onsignalingstatechange• Optional
onsignalingstatechange: CallbackWithValue
<any>
#
Defined inpackages/webrtc/src/peerConnection.ts:96
#
ontrack• Optional
ontrack: CallbackWithValue
<RTCTrackEvent>
#
Defined inpackages/webrtc/src/peerConnection.ts:97
#
pendingLocalDescription• Private
Optional
pendingLocalDescription: SessionDescription
#
Defined inpackages/webrtc/src/peerConnection.ts:108
#
pendingRemoteDescription• Private
Optional
pendingRemoteDescription: SessionDescription
#
Defined inpackages/webrtc/src/peerConnection.ts:109
#
remoteDtls• Private
Optional
remoteDtls: RTCDtlsParameters
#
Defined inpackages/webrtc/src/peerConnection.ts:103
#
remoteIce• Private
Optional
remoteIce: RTCIceParameters
#
Defined inpackages/webrtc/src/peerConnection.ts:104
#
router• Private
Readonly
router: RtpRouter
#
Defined inpackages/webrtc/src/peerConnection.ts:100
#
sctpRemotePort• Private
Optional
sctpRemotePort: number
#
Defined inpackages/webrtc/src/peerConnection.ts:102
#
sctpTransport• Optional
sctpTransport: RTCSctpTransport
#
Defined inpackages/webrtc/src/peerConnection.ts:68
#
seenMid• Private
seenMid: Set
<string>
#
Defined inpackages/webrtc/src/peerConnection.ts:105
#
shouldNegotiationneeded• Private
shouldNegotiationneeded: boolean
= false
#
Defined inpackages/webrtc/src/peerConnection.ts:111
#
signalingState• signalingState: "closed"
| "stable"
| "have-local-offer"
| "have-remote-offer"
| "have-local-pranswer"
| "have-remote-pranswer"
= "stable"
#
Defined inpackages/webrtc/src/peerConnection.ts:75
#
signalingStateChange• Readonly
signalingStateChange: default
<["closed"
| "stable"
| "have-local-offer"
| "have-remote-offer"
| "have-local-pranswer"
| "have-remote-pranswer"
]>
#
Defined inpackages/webrtc/src/peerConnection.ts:80
#
transceivers• Readonly
transceivers: RTCRtpTransceiver[] = []
#
Defined inpackages/webrtc/src/peerConnection.ts:77
#
captureRejectionSymbol▪ Static
Readonly
captureRejectionSymbol: typeof captureRejectionSymbol
#
Inherited fromEventTarget.captureRejectionSymbol
#
Defined innode_modules/@types/node/events.d.ts:43
#
captureRejections▪ Static
captureRejections: boolean
Sets or gets the default captureRejection value for all emitters.
#
Inherited from#
Defined innode_modules/@types/node/events.d.ts:49
#
defaultMaxListeners▪ Static
defaultMaxListeners: number
#
Inherited fromEventTarget.defaultMaxListeners
#
Defined innode_modules/@types/node/events.d.ts:50
#
errorMonitor▪ Static
Readonly
errorMonitor: typeof errorMonitor
This symbol shall be used to install a listener for only monitoring 'error'
events. Listeners installed using this symbol are called before the regular
'error'
listeners are called.
Installing a listener using this symbol does not change the behavior once an
'error'
event is emitted, therefore the process will still crash if no
regular 'error'
listener is installed.
#
Inherited from#
Defined innode_modules/@types/node/events.d.ts:42
#
Accessors#
_localDescription• Private
get
_localDescription(): undefined
| SessionDescription
#
Returnsundefined
| SessionDescription
#
Defined inpackages/webrtc/src/peerConnection.ts:179
#
_remoteDescription• Private
get
_remoteDescription(): undefined
| SessionDescription
#
Returnsundefined
| SessionDescription
#
Defined inpackages/webrtc/src/peerConnection.ts:183
#
localDescription• get
localDescription(): undefined
| RTCSessionDescription
#
Returnsundefined
| RTCSessionDescription
#
Defined inpackages/webrtc/src/peerConnection.ts:169
#
remoteDescription• get
remoteDescription(): undefined
| RTCSessionDescription
#
Returnsundefined
| RTCSessionDescription
#
Defined inpackages/webrtc/src/peerConnection.ts:174
#
Methods#
addEventListener▸ addEventListener(type
, listener
): void
#
ParametersName | Type |
---|---|
type | string |
listener | (...args : any []) => void |
#
Returnsvoid
#
Inherited from#
Defined inpackages/webrtc/src/helper.ts:37
#
addIceCandidate▸ addIceCandidate(candidateMessage
): Promise
<void>
#
ParametersName | Type |
---|---|
candidateMessage | RTCIceCandidate |
#
ReturnsPromise
<void>
#
Defined inpackages/webrtc/src/peerConnection.ts:517
#
addListener▸ addListener(event
, listener
): RTCPeerConnection
#
ParametersName | Type |
---|---|
event | string | symbol |
listener | (...args : any []) => void |
#
Returns#
Inherited from#
Defined innode_modules/@types/node/events.d.ts:62
#
addTrack▸ addTrack(track
, ms?
): RTCRtpSender
#
ParametersName | Type |
---|---|
track | MediaStreamTrack |
ms? | MediaStream |
#
ReturnsRTCRtpSender
#
Defined inpackages/webrtc/src/peerConnection.ts:867
#
addTransceiver▸ addTransceiver(trackOrKind
, options?
): RTCRtpTransceiver
#
ParametersName | Type |
---|---|
trackOrKind | Kind | MediaStreamTrack |
options | Partial <TransceiverOptions> |
#
Returns#
Defined inpackages/webrtc/src/peerConnection.ts:825
#
assertNotClosed▸ Private
assertNotClosed(): void
#
Returnsvoid
#
Defined inpackages/webrtc/src/peerConnection.ts:999
#
close▸ close(): Promise
<void>
#
ReturnsPromise
<void>
#
Defined inpackages/webrtc/src/peerConnection.ts:977
#
connect▸ Private
connect(): Promise
<void>
#
ReturnsPromise
<void>
#
Defined inpackages/webrtc/src/peerConnection.ts:522
#
createAnswer▸ createAnswer(): Promise
<RTCSessionDescription>
#
ReturnsPromise
<RTCSessionDescription>
#
Defined inpackages/webrtc/src/peerConnection.ts:913
#
createDataChannel▸ createDataChannel(label
, options?
): RTCDataChannel
#
ParametersName | Type |
---|---|
label | string |
options | Partial <Object > |
#
Returns#
Defined inpackages/webrtc/src/peerConnection.ts:281
#
createOffer▸ createOffer(): Promise
<RTCSessionDescription>
#
ReturnsPromise
<RTCSessionDescription>
#
Defined inpackages/webrtc/src/peerConnection.ts:197
#
createSctpTransport▸ Private
createSctpTransport(): RTCSctpTransport
#
Returns#
Defined inpackages/webrtc/src/peerConnection.ts:404
#
createTransport▸ Private
createTransport(srtpProfiles?
): Object
#
ParametersName | Type | Default value |
---|---|---|
srtpProfiles | number [] | [] |
#
ReturnsObject
Name | Type |
---|---|
dtlsTransport | RTCDtlsTransport |
iceTransport | RTCIceTransport |
#
Defined inpackages/webrtc/src/peerConnection.ts:359
#
dispose▸ Private
dispose(): void
#
Returnsvoid
#
Defined inpackages/webrtc/src/peerConnection.ts:1032
#
emit▸ emit(event
, ...args
): boolean
#
ParametersName | Type |
---|---|
event | string | symbol |
...args | any [] |
#
Returnsboolean
#
Inherited from#
Defined innode_modules/@types/node/events.d.ts:72
#
eventNames▸ eventNames(): (string
| symbol
)[]
#
Returns(string
| symbol
)[]
#
Inherited from#
Defined innode_modules/@types/node/events.d.ts:77
#
fireOnTrack▸ Private
fireOnTrack(track
, transceiver
, stream
): void
#
ParametersName | Type |
---|---|
track | MediaStreamTrack |
transceiver | RTCRtpTransceiver |
stream | MediaStream |
#
Returnsvoid
#
Defined inpackages/webrtc/src/peerConnection.ts:810
#
getMaxListeners▸ getMaxListeners(): number
#
Returnsnumber
#
Inherited from#
Defined innode_modules/@types/node/events.d.ts:69
#
getReceivers▸ getReceivers(): RTCRtpReceiver
[]
#
ReturnsRTCRtpReceiver
[]
#
Defined inpackages/webrtc/src/peerConnection.ts:862
#
getSenders▸ getSenders(): RTCRtpSender
[]
#
ReturnsRTCRtpSender
[]
#
Defined inpackages/webrtc/src/peerConnection.ts:858
#
getTransceiverByMLineIndex▸ Private
getTransceiverByMLineIndex(index
): undefined
| RTCRtpTransceiver
#
ParametersName | Type |
---|---|
index | number |
#
Returnsundefined
| RTCRtpTransceiver
#
Defined inpackages/webrtc/src/peerConnection.ts:191
#
getTransceiverByMid▸ Private
getTransceiverByMid(mid
): undefined
| RTCRtpTransceiver
#
ParametersName | Type |
---|---|
mid | string |
#
Returnsundefined
| RTCRtpTransceiver
#
Defined inpackages/webrtc/src/peerConnection.ts:187
#
getTransceivers▸ getTransceivers(): RTCRtpTransceiver[]
#
Returns#
Defined inpackages/webrtc/src/peerConnection.ts:854
#
listenerCount▸ listenerCount(event
): number
#
ParametersName | Type |
---|---|
event | string | symbol |
#
Returnsnumber
#
Inherited from#
Defined innode_modules/@types/node/events.d.ts:73
#
listeners▸ listeners(event
): Function
[]
#
ParametersName | Type |
---|---|
event | string | symbol |
#
ReturnsFunction
[]
#
Inherited from#
Defined innode_modules/@types/node/events.d.ts:70
#
localRtp▸ Private
localRtp(transceiver
): RTCRtpParameters
#
ParametersName | Type |
---|---|
transceiver | RTCRtpTransceiver |
#
Returns#
Defined inpackages/webrtc/src/peerConnection.ts:548
#
needNegotiation▸ Private
needNegotiation(): Promise
<void>
#
ReturnsPromise
<void>
#
Defined inpackages/webrtc/src/peerConnection.ts:348
#
off▸ off(event
, listener
): RTCPeerConnection
#
ParametersName | Type |
---|---|
event | string | symbol |
listener | (...args : any []) => void |
#
Returns#
Inherited from#
Defined innode_modules/@types/node/events.d.ts:66
#
on▸ on(event
, listener
): RTCPeerConnection
#
ParametersName | Type |
---|---|
event | string | symbol |
listener | (...args : any []) => void |
#
Returns#
Inherited from#
Defined innode_modules/@types/node/events.d.ts:63
#
once▸ once(event
, listener
): RTCPeerConnection
#
ParametersName | Type |
---|---|
event | string | symbol |
listener | (...args : any []) => void |
#
Returns#
Inherited from#
Defined innode_modules/@types/node/events.d.ts:64
#
prependListener▸ prependListener(event
, listener
): RTCPeerConnection
#
ParametersName | Type |
---|---|
event | string | symbol |
listener | (...args : any []) => void |
#
Returns#
Inherited from#
Defined innode_modules/@types/node/events.d.ts:75
#
prependOnceListener▸ prependOnceListener(event
, listener
): RTCPeerConnection
#
ParametersName | Type |
---|---|
event | string | symbol |
listener | (...args : any []) => void |
#
Returns#
Inherited fromEventTarget.prependOnceListener
#
Defined innode_modules/@types/node/events.d.ts:76
#
rawListeners▸ rawListeners(event
): Function
[]
#
ParametersName | Type |
---|---|
event | string | symbol |
#
ReturnsFunction
[]
#
Inherited from#
Defined innode_modules/@types/node/events.d.ts:71
#
remoteRtp▸ Private
remoteRtp(remoteDescription
, transceiver
): RTCRtpReceiveParameters
#
ParametersName | Type |
---|---|
remoteDescription | SessionDescription |
transceiver | RTCRtpTransceiver |
#
Returns#
Defined inpackages/webrtc/src/peerConnection.ts:560
#
removeAllListeners▸ removeAllListeners(event?
): RTCPeerConnection
#
ParametersName | Type |
---|---|
event? | string | symbol |
#
Returns#
Inherited fromEventTarget.removeAllListeners
#
Defined innode_modules/@types/node/events.d.ts:67
#
removeEventListener▸ removeEventListener(type
, listener
): void
#
ParametersName | Type |
---|---|
type | string |
listener | (...args : any []) => void |
#
Returnsvoid
#
Inherited fromEventTarget.removeEventListener
#
Defined inpackages/webrtc/src/helper.ts:41
#
removeListener▸ removeListener(event
, listener
): RTCPeerConnection
#
ParametersName | Type |
---|---|
event | string | symbol |
listener | (...args : any []) => void |
#
Returns#
Inherited from#
Defined innode_modules/@types/node/events.d.ts:65
#
removeTrack▸ removeTrack(sender
): void
#
ParametersName | Type |
---|---|
sender | RTCRtpSender |
#
Returnsvoid
#
Defined inpackages/webrtc/src/peerConnection.ts:320
#
setConnectionState▸ Private
setConnectionState(state
): void
#
ParametersName | Type |
---|---|
state | "closed" | "connecting" | "failed" | "disconnected" | "new" | "connected" |
#
Returnsvoid
#
Defined inpackages/webrtc/src/peerConnection.ts:1024
#
setLocal▸ Private
setLocal(description
): void
#
ParametersName | Type |
---|---|
description | SessionDescription |
#
Returnsvoid
#
Defined inpackages/webrtc/src/peerConnection.ts:508
#
setLocalDescription▸ setLocalDescription(sessionDescription
): Promise
<SessionDescription>
#
ParametersName | Type |
---|---|
sessionDescription | Object |
sessionDescription.sdp | string |
sessionDescription.type | "offer" | "answer" |
#
ReturnsPromise
<SessionDescription>
#
Defined inpackages/webrtc/src/peerConnection.ts:419
#
setMaxListeners▸ setMaxListeners(n
): RTCPeerConnection
#
ParametersName | Type |
---|---|
n | number |
#
Returns#
Inherited from#
Defined innode_modules/@types/node/events.d.ts:68
#
setRemoteDescription▸ setRemoteDescription(sessionDescription
): Promise
<void>
#
ParametersName | Type |
---|---|
sessionDescription | Object |
sessionDescription.sdp | string |
sessionDescription.type | "offer" | "answer" |
#
ReturnsPromise
<void>
#
Defined inpackages/webrtc/src/peerConnection.ts:642
#
setSignalingState▸ Private
setSignalingState(state
): void
#
ParametersName | Type |
---|---|
state | "closed" | "stable" | "have-local-offer" | "have-remote-offer" | "have-local-pranswer" | "have-remote-pranswer" |
#
Returnsvoid
#
Defined inpackages/webrtc/src/peerConnection.ts:1017
#
updateIceConnectionState▸ Private
updateIceConnectionState(state
): void
#
ParametersName | Type |
---|---|
state | "closed" | "failed" | "disconnected" | "new" | "connected" | "checking" | "completed" |
#
Returnsvoid
#
Defined inpackages/webrtc/src/peerConnection.ts:1010
#
updateIceGatheringState▸ Private
updateIceGatheringState(state
): void
#
ParametersName | Type |
---|---|
state | "new" | "gathering" | "complete" |
#
Returnsvoid
#
Defined inpackages/webrtc/src/peerConnection.ts:1003
#
validateDescription▸ Private
validateDescription(description
, isLocal
): void
#
ParametersName | Type |
---|---|
description | SessionDescription |
isLocal | boolean |
#
Returnsvoid
#
Defined inpackages/webrtc/src/peerConnection.ts:588
#
listenerCount▸ Static
listenerCount(emitter
, event
): number
deprecated
since v4.0.0
#
ParametersName | Type |
---|---|
emitter | EventEmitter |
event | string | symbol |
#
Returnsnumber
#
Inherited from#
Defined innode_modules/@types/node/events.d.ts:31
#
on▸ Static
on(emitter
, event
): AsyncIterableIterator
<any>
#
ParametersName | Type |
---|---|
emitter | EventEmitter |
event | string |
#
ReturnsAsyncIterableIterator
<any>
#
Inherited from#
Defined innode_modules/@types/node/events.d.ts:28
#
once▸ Static
once(emitter
, event
): Promise
<any[]>
#
ParametersName | Type |
---|---|
emitter | NodeEventTarget |
event | string | symbol |
#
ReturnsPromise
<any[]>
#
Inherited from#
Defined innode_modules/@types/node/events.d.ts:26
▸ Static
once(emitter
, event
): Promise
<any[]>
#
ParametersName | Type |
---|---|
emitter | DOMEventTarget |
event | string |
#
ReturnsPromise
<any[]>
#
Inherited from#
Defined innode_modules/@types/node/events.d.ts:27