Skip to main content

ExtendedRTCPeerConnection

Extends

  • RTCPeerConnection

Properties

PropertyModifierTypeDescriptionInherited from
canTrickleIceCandidatesreadonlynull | booleanMDN ReferenceRTCPeerConnection.canTrickleIceCandidates
connectionStatereadonlyRTCPeerConnectionStateMDN ReferenceRTCPeerConnection.connectionState
currentLocalDescriptionreadonlynull | RTCSessionDescriptionMDN ReferenceRTCPeerConnection.currentLocalDescription
currentRemoteDescriptionreadonlynull | RTCSessionDescriptionMDN ReferenceRTCPeerConnection.currentRemoteDescription
iceConnectionStatereadonlyRTCIceConnectionStateMDN ReferenceRTCPeerConnection.iceConnectionState
iceGatheringStatereadonlyRTCIceGatheringStateMDN ReferenceRTCPeerConnection.iceGatheringState
localDescriptionreadonlynull | RTCSessionDescriptionMDN ReferenceRTCPeerConnection.localDescription
onconnectionstatechangepublicnull | (this, ev) => anyMDN ReferenceRTCPeerConnection.onconnectionstatechange
ondatachannelpublicnull | (this, ev) => anyMDN ReferenceRTCPeerConnection.ondatachannel
onicecandidatepublicnull | (this, ev) => anyMDN ReferenceRTCPeerConnection.onicecandidate
onicecandidateerrorpublicnull | (this, ev) => anyMDN ReferenceRTCPeerConnection.onicecandidateerror
oniceconnectionstatechangepublicnull | (this, ev) => anyMDN ReferenceRTCPeerConnection.oniceconnectionstatechange
onicegatheringstatechangepublicnull | (this, ev) => anyMDN ReferenceRTCPeerConnection.onicegatheringstatechange
onnegotiationneededpublicnull | (this, ev) => anyMDN ReferenceRTCPeerConnection.onnegotiationneeded
onsignalingstatechangepublicnull | (this, ev) => anyMDN ReferenceRTCPeerConnection.onsignalingstatechange
ontrackpublicnull | (this, ev) => anyMDN ReferenceRTCPeerConnection.ontrack
peerIdentitypublicPromise<unknown>--
pendingLocalDescriptionreadonlynull | RTCSessionDescriptionMDN ReferenceRTCPeerConnection.pendingLocalDescription
pendingRemoteDescriptionreadonlynull | RTCSessionDescriptionMDN ReferenceRTCPeerConnection.pendingRemoteDescription
remoteDescriptionreadonlynull | RTCSessionDescriptionMDN ReferenceRTCPeerConnection.remoteDescription
sctpreadonlynull | RTCSctpTransportMDN ReferenceRTCPeerConnection.sctp
signalingStatereadonlyRTCSignalingStateMDN ReferenceRTCPeerConnection.signalingState

Methods

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

addIceCandidate()

Call Signature

addIceCandidate(candidate?): Promise<void>;

MDN Reference

Parameters
ParameterType
candidate?null | RTCIceCandidateInit
Returns

Promise<void>

Inherited from
RTCPeerConnection.addIceCandidate

Call Signature

addIceCandidate(
candidate,
successCallback,
failureCallback): Promise<void>;
Parameters
ParameterType
candidatenull | RTCIceCandidateInit
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

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

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?null | MediaStreamTrack

Returns

Promise<RTCStatsReport>

Inherited from

RTCPeerConnection.getStats

getTransceivers()

getTransceivers(): RTCRtpTransceiver[];

MDN Reference

Returns

RTCRtpTransceiver[]

Inherited from

RTCPeerConnection.getTransceivers

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

removeTrack()

removeTrack(sender): void;

MDN Reference

Parameters

ParameterType
senderRTCRtpSender

Returns

void

Inherited from

RTCPeerConnection.removeTrack

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

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