PeerConnection
Extends
Properties
| Property | Type | Description | Inherited from |
|---|---|---|---|
peer | ExtendedRTCPeerConnection | - | BasePeerConnection.peer |
connectionState | RTCPeerConnectionState | - | BasePeerConnection.connectionState |
iceGatheringState | RTCIceGatheringState | - | BasePeerConnection.iceGatheringState |
iceConnectionState | RTCIceConnectionState | - | BasePeerConnection.iceConnectionState |
signalingState | RTCSignalingState | - | BasePeerConnection.signalingState |
senders | RTCRtpSender[] | - | BasePeerConnection.senders |
receivers | RTCRtpReceiver[] | - | BasePeerConnection.receivers |
bandwidth | Bandwidth | - | BasePeerConnection.bandwidth |
hasICECandidates | boolean | - | BasePeerConnection.hasICECandidates |
references | References | Reference of any logical associations to the peer connection for logging | BasePeerConnection.references |
offerOptions | RTCOfferOptions | undefined | - | BasePeerConnection.offerOptions |
answerOptions | RTCAnswerOptions | undefined | - | BasePeerConnection.answerOptions |
polite | boolean | - | BasePeerConnection.polite |
configs | MediaConfig[] | - | BasePeerConnection.configs |
getTransceiverConfigs | () => TransceiverConfig[] | - | BasePeerConnection.getTransceiverConfigs |
getDataChannelConfigs | () => DataChannelConfig[] | - | BasePeerConnection.getDataChannelConfigs |
createDataChannel | (label, dataChannelDict?) => RTCDataChannel | - | BasePeerConnection.createDataChannel |
setConfiguration | (configuration?) => void | undefined | Only recently supported on some browser: https://caniuse.com/?search=setconfiguration | BasePeerConnection.setConfiguration |
getConfiguration | () => RTCConfiguration | - | BasePeerConnection.getConfiguration |
close | () => void | - | BasePeerConnection.close |
restartIce | () => void | - | BasePeerConnection.restartIce |
currentLocalDescription | RTCSessionDescription | null | - | - |
pendingLocalDescription? | RTCSessionDescription | RTCSessionDescriptionInit | It 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 | - |
currentRemoteDescription | RTCSessionDescription | null | - | - |
pendingRemoteDescription | RTCSessionDescription | null | It 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 | - |
negotiationNeeded | boolean | - | - |
onConnectionStateChange? | EventHandler | - | - |
onDataChannel? | (this, ev) => any | null | - | - |
onIceCandidate? | OnIceCandidateHandler | - | - |
onIceCandidateError? | (this, ev) => any | null | - | - |
onIceConnectionStateChange? | EventHandler | - | - |
onIceGatheringStateChange? | EventHandler | - | - |
onNegotiationNeeded? | OnNegotiationNeededHandler | - | - |
onRemoteStreams? | OnRemoteStreamsEventHandler | - | - |
onSignalingStateChange? | EventHandler | - | - |
onTrack? | OnTrackEventHandler | - | - |
onTransceiverChange? | OnTransceiverChangeHandler | - | - |
onSecureCheckCode? | OnSecureCheckCodeHandler | - | - |
Methods
addConfig()
Call Signature
addConfig(peer, initOrConfig): DataChannelConfig;
Parameters
| Parameter | Type |
|---|---|
peer | RTCPeerConnection |
initOrConfig | | DataChannelConfig | DataChannelInit |
Returns
Inherited from
Call Signature
addConfig(peer, initOrConfig): TransceiverConfig;
Parameters
| Parameter | Type |
|---|---|
peer | RTCPeerConnection |
initOrConfig | | TransceiverConfig | TransceiverInit |
Returns
Inherited from
Call Signature
addConfig(peer, initOrConfig):
| TransceiverConfig
| DataChannelConfig;
Parameters
| Parameter | Type |
|---|---|
peer | RTCPeerConnection |
initOrConfig | | TransceiverConfig | DataChannelConfig | DataChannelInit | TransceiverInit |
Returns
| TransceiverConfig
| DataChannelConfig
Inherited from
setLocalStream()
setLocalStream(
stream,
target,
shouldSyncMedia?): Promise<void>;
Parameters
| Parameter | Type |
|---|---|
stream | MediaStream | undefined |
target | TransceiverConfigDirectionTuple[] |
shouldSyncMedia? | boolean |
Returns
Promise<void>
Inherited from
BasePeerConnection.setLocalStream
getStats()
getStats(selector?): Promise<RTCStatsReport>;
Parameters
| Parameter | Type |
|---|---|
selector? | MediaStreamTrack | null |
Returns
Promise<RTCStatsReport>
Inherited from
setReference()
setReference(key, value): void;
Key/Value pair for referencing logical associations for logging
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | The key for the reference |
value | string | The value for the reference |
Returns
void
Inherited from
BasePeerConnection.setReference
createOffer()
createOffer(options?): Promise<RTCSessionDescriptionInit>;
Parameters
| Parameter | Type |
|---|---|
options? | RTCOfferOptions |
Returns
Promise<RTCSessionDescriptionInit>
createAnswer()
createAnswer(options?): Promise<RTCSessionDescriptionInit>;
Parameters
| Parameter | Type |
|---|---|
options? | RTCAnswerOptions |
Returns
Promise<RTCSessionDescriptionInit>
receiveIceCandidate()
receiveIceCandidate(candidate): Promise<void>;
Parameters
| Parameter | Type |
|---|---|
candidate | RTCIceCandidate | RTCIceCandidateInit |
Returns
Promise<void>
releaseLocalICECandidatesBuffer()
releaseLocalICECandidatesBuffer(ignore): void;
Parameters
| Parameter | Type |
|---|---|
ignore | boolean |
Returns
void
receiveAnswer()
receiveAnswer(answer): Promise<void>;
Parameters
| Parameter | Type |
|---|---|
answer | RTCSessionDescriptionInit |
Returns
Promise<void>
receiveOffer()
receiveOffer(offer): Promise<void>;
Parameters
| Parameter | Type |
|---|---|
offer | RTCSessionDescriptionInit |
Returns
Promise<void>
negotiate()
negotiate(): Promise<void>;
Returns
Promise<void>