Skip to main content

ExtendedRTCPeerConnection

Extends​

  • RTCPeerConnection

Properties​

PropertyModifierTypeDescriptionInherited from
peerIdentitypublicPromise<unknown>--
canTrickleIceCandidatesreadonlyboolean | nullMDN ReferenceRTCPeerConnection.canTrickleIceCandidates
connectionStatereadonlyRTCPeerConnectionStateMDN ReferenceRTCPeerConnection.connectionState
currentLocalDescriptionreadonlyRTCSessionDescription | nullMDN ReferenceRTCPeerConnection.currentLocalDescription
currentRemoteDescriptionreadonlyRTCSessionDescription | nullMDN ReferenceRTCPeerConnection.currentRemoteDescription
iceConnectionStatereadonlyRTCIceConnectionStateMDN ReferenceRTCPeerConnection.iceConnectionState
iceGatheringStatereadonlyRTCIceGatheringStateMDN ReferenceRTCPeerConnection.iceGatheringState
localDescriptionreadonlyRTCSessionDescription | nullMDN ReferenceRTCPeerConnection.localDescription
onconnectionstatechangepublic(this, ev) => any | nullMDN ReferenceRTCPeerConnection.onconnectionstatechange
ondatachannelpublic(this, ev) => any | nullMDN ReferenceRTCPeerConnection.ondatachannel
onicecandidatepublic(this, ev) => any | nullMDN ReferenceRTCPeerConnection.onicecandidate
onicecandidateerrorpublic(this, ev) => any | nullMDN ReferenceRTCPeerConnection.onicecandidateerror
oniceconnectionstatechangepublic(this, ev) => any | nullMDN ReferenceRTCPeerConnection.oniceconnectionstatechange
onicegatheringstatechangepublic(this, ev) => any | nullMDN ReferenceRTCPeerConnection.onicegatheringstatechange
onnegotiationneededpublic(this, ev) => any | nullMDN ReferenceRTCPeerConnection.onnegotiationneeded
onsignalingstatechangepublic(this, ev) => any | nullMDN ReferenceRTCPeerConnection.onsignalingstatechange
ontrackpublic(this, ev) => any | nullMDN ReferenceRTCPeerConnection.ontrack
pendingLocalDescriptionreadonlyRTCSessionDescription | nullMDN ReferenceRTCPeerConnection.pendingLocalDescription
pendingRemoteDescriptionreadonlyRTCSessionDescription | nullMDN ReferenceRTCPeerConnection.pendingRemoteDescription
remoteDescriptionreadonlyRTCSessionDescription | nullMDN ReferenceRTCPeerConnection.remoteDescription
sctpreadonlyRTCSctpTransport | nullMDN ReferenceRTCPeerConnection.sctp
signalingStatereadonlyRTCSignalingStateMDN ReferenceRTCPeerConnection.signalingState

Methods​

restartIce()​

restartIce(): void;

Typescript DOM type definition has not included this method for RTCPeerConnection, thus patch it manually.

Allow a web application to easily request that ICE candidate gathering be redone on both ends of the connection. This simplifies the process by allowing the same method to be used by either the caller or the receiver to trigger an ICE restart.

https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/restartIce

Returns​

void

Overrides​

RTCPeerConnection.restartIce

dispatchEvent()​

dispatchEvent(event): boolean;

Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.

MDN Reference

Parameters​

ParameterType
eventEvent

Returns​

boolean

Inherited from​

RTCPeerConnection.dispatchEvent

addIceCandidate()​

Call Signature​

addIceCandidate(candidate?): Promise<void>;

MDN Reference

Parameters​
ParameterType
candidate?RTCIceCandidateInit | null
Returns​

Promise<void>

Inherited from​
RTCPeerConnection.addIceCandidate

Call Signature​

addIceCandidate(
candidate,
successCallback,
failureCallback): Promise<void>;
Parameters​
ParameterType
candidateRTCIceCandidateInit | null
successCallbackVoidFunction
failureCallbackRTCPeerConnectionErrorCallback
Returns​

Promise<void>

Deprecated​
Inherited from​
RTCPeerConnection.addIceCandidate

addTrack()​

addTrack(track, ...streams): RTCRtpSender;

MDN Reference

Parameters​

ParameterType
trackMediaStreamTrack
...streamsMediaStream[]

Returns​

RTCRtpSender

Inherited from​

RTCPeerConnection.addTrack

addTransceiver()​

addTransceiver(trackOrKind, init?): RTCRtpTransceiver;

MDN Reference

Parameters​

ParameterType
trackOrKindstring | MediaStreamTrack
init?RTCRtpTransceiverInit

Returns​

RTCRtpTransceiver

Inherited from​

RTCPeerConnection.addTransceiver

close()​

close(): void;

MDN Reference

Returns​

void

Inherited from​

RTCPeerConnection.close

createAnswer()​

Call Signature​

createAnswer(options?): Promise<RTCSessionDescriptionInit>;

MDN Reference

Parameters​
ParameterType
options?RTCAnswerOptions
Returns​

Promise<RTCSessionDescriptionInit>

Inherited from​
RTCPeerConnection.createAnswer

Call Signature​

createAnswer(successCallback, failureCallback): Promise<void>;
Parameters​
ParameterType
successCallbackRTCSessionDescriptionCallback
failureCallbackRTCPeerConnectionErrorCallback
Returns​

Promise<void>

Deprecated​
Inherited from​
RTCPeerConnection.createAnswer

createDataChannel()​

createDataChannel(label, dataChannelDict?): RTCDataChannel;

MDN Reference

Parameters​

ParameterType
labelstring
dataChannelDict?RTCDataChannelInit

Returns​

RTCDataChannel

Inherited from​

RTCPeerConnection.createDataChannel

createOffer()​

Call Signature​

createOffer(options?): Promise<RTCSessionDescriptionInit>;

MDN Reference

Parameters​
ParameterType
options?RTCOfferOptions
Returns​

Promise<RTCSessionDescriptionInit>

Inherited from​
RTCPeerConnection.createOffer

Call Signature​

createOffer(
successCallback,
failureCallback,
options?): Promise<void>;
Parameters​
ParameterType
successCallbackRTCSessionDescriptionCallback
failureCallbackRTCPeerConnectionErrorCallback
options?RTCOfferOptions
Returns​

Promise<void>

Deprecated​
Inherited from​
RTCPeerConnection.createOffer

getConfiguration()​

getConfiguration(): RTCConfiguration;

MDN Reference

Returns​

RTCConfiguration

Inherited from​

RTCPeerConnection.getConfiguration

getReceivers()​

getReceivers(): RTCRtpReceiver[];

MDN Reference

Returns​

RTCRtpReceiver[]

Inherited from​

RTCPeerConnection.getReceivers

getSenders()​

getSenders(): RTCRtpSender[];

MDN Reference

Returns​

RTCRtpSender[]

Inherited from​

RTCPeerConnection.getSenders

getStats()​

getStats(selector?): Promise<RTCStatsReport>;

MDN Reference

Parameters​

ParameterType
selector?MediaStreamTrack | null

Returns​

Promise<RTCStatsReport>

Inherited from​

RTCPeerConnection.getStats

getTransceivers()​

getTransceivers(): RTCRtpTransceiver[];

MDN Reference

Returns​

RTCRtpTransceiver[]

Inherited from​

RTCPeerConnection.getTransceivers

removeTrack()​

removeTrack(sender): void;

MDN Reference

Parameters​

ParameterType
senderRTCRtpSender

Returns​

void

Inherited from​

RTCPeerConnection.removeTrack

setConfiguration()​

setConfiguration(configuration?): void;

MDN Reference

Parameters​

ParameterType
configuration?RTCConfiguration

Returns​

void

Inherited from​

RTCPeerConnection.setConfiguration

setLocalDescription()​

Call Signature​

setLocalDescription(description?): Promise<void>;

MDN Reference

Parameters​
ParameterType
description?RTCLocalSessionDescriptionInit
Returns​

Promise<void>

Inherited from​
RTCPeerConnection.setLocalDescription

Call Signature​

setLocalDescription(
description,
successCallback,
failureCallback): Promise<void>;
Parameters​
ParameterType
descriptionRTCLocalSessionDescriptionInit
successCallbackVoidFunction
failureCallbackRTCPeerConnectionErrorCallback
Returns​

Promise<void>

Deprecated​
Inherited from​
RTCPeerConnection.setLocalDescription

setRemoteDescription()​

Call Signature​

setRemoteDescription(description): Promise<void>;

MDN Reference

Parameters​
ParameterType
descriptionRTCSessionDescriptionInit
Returns​

Promise<void>

Inherited from​
RTCPeerConnection.setRemoteDescription

Call Signature​

setRemoteDescription(
description,
successCallback,
failureCallback): Promise<void>;
Parameters​
ParameterType
descriptionRTCSessionDescriptionInit
successCallbackVoidFunction
failureCallbackRTCPeerConnectionErrorCallback
Returns​

Promise<void>

Deprecated​
Inherited from​
RTCPeerConnection.setRemoteDescription

addEventListener()​

Call Signature​

addEventListener<K>(
type,
listener,
options?): void;

Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.

The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.

When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.

When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.

When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.

If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.

The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.

MDN Reference

Type Parameters​
Type Parameter
K extends keyof RTCPeerConnectionEventMap
Parameters​
ParameterType
typeK
listener(this, ev) => any
options?boolean | AddEventListenerOptions
Returns​

void

Inherited from​
RTCPeerConnection.addEventListener

Call Signature​

addEventListener(
type,
listener,
options?): void;

Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.

The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.

When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.

When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.

When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.

If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.

The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.

MDN Reference

Parameters​
ParameterType
typestring
listenerEventListenerOrEventListenerObject
options?boolean | AddEventListenerOptions
Returns​

void

Inherited from​
RTCPeerConnection.addEventListener

removeEventListener()​

Call Signature​

removeEventListener<K>(
type,
listener,
options?): void;

Removes the event listener in target's event listener list with the same type, callback, and options.

MDN Reference

Type Parameters​
Type Parameter
K extends keyof RTCPeerConnectionEventMap
Parameters​
ParameterType
typeK
listener(this, ev) => any
options?boolean | EventListenerOptions
Returns​

void

Inherited from​
RTCPeerConnection.removeEventListener

Call Signature​

removeEventListener(
type,
listener,
options?): void;

Removes the event listener in target's event listener list with the same type, callback, and options.

MDN Reference

Parameters​
ParameterType
typestring
listenerEventListenerOrEventListenerObject
options?boolean | EventListenerOptions
Returns​

void

Inherited from​
RTCPeerConnection.removeEventListener