Skip to main content

PeerConnection

Extends

Properties

PropertyTypeDescriptionInherited from
answerOptionsundefined | RTCAnswerOptions-BasePeerConnection.answerOptions
bandwidthBandwidth-BasePeerConnection.bandwidth
close() => void-BasePeerConnection.close
configsMediaConfig[]-BasePeerConnection.configs
connectionStateRTCPeerConnectionState-BasePeerConnection.connectionState
createDataChannel(label, dataChannelDict?) => RTCDataChannel-BasePeerConnection.createDataChannel
currentLocalDescriptionnull | RTCSessionDescription--
currentRemoteDescriptionnull | RTCSessionDescription--
getConfiguration() => RTCConfiguration-BasePeerConnection.getConfiguration
getDataChannelConfigs() => DataChannelConfig[]-BasePeerConnection.getDataChannelConfigs
getTransceiverConfigs() => TransceiverConfig[]-BasePeerConnection.getTransceiverConfigs
hasICECandidatesboolean-BasePeerConnection.hasICECandidates
iceConnectionStateRTCIceConnectionState-BasePeerConnection.iceConnectionState
iceGatheringStateRTCIceGatheringState-BasePeerConnection.iceGatheringState
negotiationNeededboolean--
offerOptionsundefined | RTCOfferOptions-BasePeerConnection.offerOptions
onConnectionStateChange?EventHandler--
onDataChannel?null | (this, ev) => any--
onIceCandidate?OnIceCandidateHandler--
onIceCandidateError?null | (this, ev) => any--
onIceConnectionStateChange?EventHandler--
onIceGatheringStateChange?EventHandler--
onNegotiationNeeded?OnNegotiationNeededHandler--
onRemoteStreams?OnRemoteStreamsEventHandler--
onSecureCheckCode?OnSecureCheckCodeHandler--
onSignalingStateChange?EventHandler--
onTrack?OnTrackEventHandler--
onTransceiverChange?OnTransceiverChangeHandler--
peerExtendedRTCPeerConnection-BasePeerConnection.peer
pendingLocalDescription?RTCSessionDescription | RTCSessionDescriptionInitIt represents a local description that is in the process of being negotiated plus any local candidates that have been generated by the ICE Agent since the offer or answer was created. If the RTCPeerConnection is in the stable state, the value is null. https://w3c.github.io/webrtc-pc/#dom-peerconnection-pendinglocaldesc-
pendingRemoteDescriptionnull | RTCSessionDescriptionIt represents a remote description that is in the process of being negotiated, complete with any remote candidates that have been supplied via addIceCandidate() since the offer or answer was created. If the RTCPeerConnection is in the stable state, the value is null. https://w3c.github.io/webrtc-pc/#dom-peerconnection-pendingremotedesc-
politeboolean-BasePeerConnection.polite
receiversRTCRtpReceiver[]-BasePeerConnection.receivers
referencesReferencesReference of any logical associations to the peer connection for loggingBasePeerConnection.references
restartIce() => void-BasePeerConnection.restartIce
sendersRTCRtpSender[]-BasePeerConnection.senders
setConfigurationundefined | (configuration?) => voidOnly recently supported on some browser: https://caniuse.com/?search=setconfigurationBasePeerConnection.setConfiguration
signalingStateRTCSignalingState-BasePeerConnection.signalingState

Methods

addConfig()

Call Signature

addConfig(peer, initOrConfig): DataChannelConfig;
Parameters
ParameterType
peerRTCPeerConnection
initOrConfig| DataChannelConfig | DataChannelInit
Returns

DataChannelConfig

Inherited from

BasePeerConnection.addConfig

Call Signature

addConfig(peer, initOrConfig): TransceiverConfig;
Parameters
ParameterType
peerRTCPeerConnection
initOrConfig| TransceiverConfig | TransceiverInit
Returns

TransceiverConfig

Inherited from

BasePeerConnection.addConfig

Call Signature

addConfig(peer, initOrConfig): 
| TransceiverConfig
| DataChannelConfig;
Parameters
ParameterType
peerRTCPeerConnection
initOrConfig| TransceiverConfig | DataChannelConfig | DataChannelInit | TransceiverInit
Returns

| TransceiverConfig | DataChannelConfig

Inherited from

BasePeerConnection.addConfig


createAnswer()

createAnswer(options?): Promise<RTCSessionDescriptionInit>;

Parameters

ParameterType
options?RTCAnswerOptions

Returns

Promise<RTCSessionDescriptionInit>


createOffer()

createOffer(options?): Promise<RTCSessionDescriptionInit>;

Parameters

ParameterType
options?RTCOfferOptions

Returns

Promise<RTCSessionDescriptionInit>


getStats()

getStats(selector?): Promise<RTCStatsReport>;

Parameters

ParameterType
selector?null | MediaStreamTrack

Returns

Promise<RTCStatsReport>

Inherited from

BasePeerConnection.getStats


negotiate()

negotiate(): Promise<void>;

Returns

Promise<void>


receiveAnswer()

receiveAnswer(answer): Promise<void>;

Parameters

ParameterType
answerRTCSessionDescriptionInit

Returns

Promise<void>


receiveIceCandidate()

receiveIceCandidate(candidate): Promise<void>;

Parameters

ParameterType
candidateRTCIceCandidate | RTCIceCandidateInit

Returns

Promise<void>


receiveOffer()

receiveOffer(offer): Promise<void>;

Parameters

ParameterType
offerRTCSessionDescriptionInit

Returns

Promise<void>


releaseLocalICECandidatesBuffer()

releaseLocalICECandidatesBuffer(ignore): void;

Parameters

ParameterType
ignoreboolean

Returns

void


setLocalStream()

setLocalStream(
stream,
target,
shouldSyncMedia?): Promise<void>;

Parameters

ParameterType
streamundefined | MediaStream
targetTransceiverConfigDirectionTuple[]
shouldSyncMedia?boolean

Returns

Promise<void>

Inherited from

BasePeerConnection.setLocalStream


setReference()

setReference(key, value): void;

Key/Value pair for referencing logical associations for logging

Parameters

ParameterTypeDescription
keystringThe key for the reference
valuestringThe value for the reference

Returns

void

Inherited from

BasePeerConnection.setReference