PeerConnection
Extends
Properties
| Property | Type | Description | Inherited from |
|---|---|---|---|
answerOptions | undefined | RTCAnswerOptions | - | BasePeerConnection.answerOptions |
bandwidth | Bandwidth | - | BasePeerConnection.bandwidth |
close | () => void | - | BasePeerConnection.close |
configs | MediaConfig[] | - | BasePeerConnection.configs |
connectionState | RTCPeerConnectionState | - | BasePeerConnection.connectionState |
createDataChannel | (label, dataChannelDict?) => RTCDataChannel | - | BasePeerConnection.createDataChannel |
currentLocalDescription | null | RTCSessionDescription | - | - |
currentRemoteDescription | null | RTCSessionDescription | - | - |
getConfiguration | () => RTCConfiguration | - | BasePeerConnection.getConfiguration |
getDataChannelConfigs | () => DataChannelConfig[] | - | BasePeerConnection.getDataChannelConfigs |
getTransceiverConfigs | () => TransceiverConfig[] | - | BasePeerConnection.getTransceiverConfigs |
hasICECandidates | boolean | - | BasePeerConnection.hasICECandidates |
iceConnectionState | RTCIceConnectionState | - | BasePeerConnection.iceConnectionState |
iceGatheringState | RTCIceGatheringState | - | BasePeerConnection.iceGatheringState |
negotiationNeeded | boolean | - | - |
offerOptions | undefined | 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 | - | - |
peer | ExtendedRTCPeerConnection | - | BasePeerConnection.peer |
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 | - |
pendingRemoteDescription | null | RTCSessionDescription | 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 | - |
polite | boolean | - | BasePeerConnection.polite |
receivers | RTCRtpReceiver[] | - | BasePeerConnection.receivers |
references | References | Reference of any logical associations to the peer connection for logging | BasePeerConnection.references |
restartIce | () => void | - | BasePeerConnection.restartIce |
senders | RTCRtpSender[] | - | BasePeerConnection.senders |
setConfiguration | undefined | (configuration?) => void | Only recently supported on some browser: https://caniuse.com/?search=setconfiguration | BasePeerConnection.setConfiguration |
signalingState | RTCSignalingState | - | BasePeerConnection.signalingState |
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
createAnswer()
createAnswer(options?): Promise<RTCSessionDescriptionInit>;
Parameters
| Parameter | Type |
|---|---|
options? | RTCAnswerOptions |
Returns
Promise<RTCSessionDescriptionInit>
createOffer()
createOffer(options?): Promise<RTCSessionDescriptionInit>;
Parameters
| Parameter | Type |
|---|---|
options? | RTCOfferOptions |
Returns
Promise<RTCSessionDescriptionInit>
getStats()
getStats(selector?): Promise<RTCStatsReport>;
Parameters
| Parameter | Type |
|---|---|
selector? | null | MediaStreamTrack |
Returns
Promise<RTCStatsReport>
Inherited from
negotiate()
negotiate(): Promise<void>;
Returns
Promise<void>
receiveAnswer()
receiveAnswer(answer): Promise<void>;
Parameters
| Parameter | Type |
|---|---|
answer | RTCSessionDescriptionInit |
Returns
Promise<void>
receiveIceCandidate()
receiveIceCandidate(candidate): Promise<void>;
Parameters
| Parameter | Type |
|---|---|
candidate | RTCIceCandidate | RTCIceCandidateInit |
Returns
Promise<void>
receiveOffer()
receiveOffer(offer): Promise<void>;
Parameters
| Parameter | Type |
|---|---|
offer | RTCSessionDescriptionInit |
Returns
Promise<void>
releaseLocalICECandidatesBuffer()
releaseLocalICECandidatesBuffer(ignore): void;
Parameters
| Parameter | Type |
|---|---|
ignore | boolean |
Returns
void
setLocalStream()
setLocalStream(
stream,
target,
shouldSyncMedia?): Promise<void>;
Parameters
| Parameter | Type |
|---|---|
stream | undefined | MediaStream |
target | TransceiverConfigDirectionTuple[] |
shouldSyncMedia? | boolean |
Returns
Promise<void>
Inherited from
BasePeerConnection.setLocalStream
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