ExtendedRTCPeerConnection
Extends
RTCPeerConnection
Properties
| Property | Modifier | Type | Description | Inherited from |
|---|---|---|---|---|
canTrickleIceCandidates | readonly | null | boolean | MDN Reference | RTCPeerConnection.canTrickleIceCandidates |
connectionState | readonly | RTCPeerConnectionState | MDN Reference | RTCPeerConnection.connectionState |
currentLocalDescription | readonly | null | RTCSessionDescription | MDN Reference | RTCPeerConnection.currentLocalDescription |
currentRemoteDescription | readonly | null | RTCSessionDescription | MDN Reference | RTCPeerConnection.currentRemoteDescription |
iceConnectionState | readonly | RTCIceConnectionState | MDN Reference | RTCPeerConnection.iceConnectionState |
iceGatheringState | readonly | RTCIceGatheringState | MDN Reference | RTCPeerConnection.iceGatheringState |
localDescription | readonly | null | RTCSessionDescription | MDN Reference | RTCPeerConnection.localDescription |
onconnectionstatechange | public | null | (this, ev) => any | MDN Reference | RTCPeerConnection.onconnectionstatechange |
ondatachannel | public | null | (this, ev) => any | MDN Reference | RTCPeerConnection.ondatachannel |
onicecandidate | public | null | (this, ev) => any | MDN Reference | RTCPeerConnection.onicecandidate |
onicecandidateerror | public | null | (this, ev) => any | MDN Reference | RTCPeerConnection.onicecandidateerror |
oniceconnectionstatechange | public | null | (this, ev) => any | MDN Reference | RTCPeerConnection.oniceconnectionstatechange |
onicegatheringstatechange | public | null | (this, ev) => any | MDN Reference | RTCPeerConnection.onicegatheringstatechange |
onnegotiationneeded | public | null | (this, ev) => any | MDN Reference | RTCPeerConnection.onnegotiationneeded |
onsignalingstatechange | public | null | (this, ev) => any | MDN Reference | RTCPeerConnection.onsignalingstatechange |
ontrack | public | null | (this, ev) => any | MDN Reference | RTCPeerConnection.ontrack |
peerIdentity | public | Promise<unknown> | - | - |
pendingLocalDescription | readonly | null | RTCSessionDescription | MDN Reference | RTCPeerConnection.pendingLocalDescription |
pendingRemoteDescription | readonly | null | RTCSessionDescription | MDN Reference | RTCPeerConnection.pendingRemoteDescription |
remoteDescription | readonly | null | RTCSessionDescription | MDN Reference | RTCPeerConnection.remoteDescription |
sctp | readonly | null | RTCSctpTransport | MDN Reference | RTCPeerConnection.sctp |
signalingState | readonly | RTCSignalingState | MDN Reference | RTCPeerConnection.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.
Type Parameters
| Type Parameter |
|---|
K extends keyof RTCPeerConnectionEventMap |
Parameters
| Parameter | Type |
|---|---|
type | K |
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.
Parameters
| Parameter | Type |
|---|---|
type | string |
listener | EventListenerOrEventListenerObject |
options? | boolean | AddEventListenerOptions |
Returns
void
Inherited from
RTCPeerConnection.addEventListener
addIceCandidate()
Call Signature
addIceCandidate(candidate?): Promise<void>;
Parameters
| Parameter | Type |
|---|---|
candidate? | null | RTCIceCandidateInit |
Returns
Promise<void>
Inherited from
RTCPeerConnection.addIceCandidate
Call Signature
addIceCandidate(
candidate,
successCallback,
failureCallback): Promise<void>;
Parameters
| Parameter | Type |
|---|---|
candidate | null | RTCIceCandidateInit |
successCallback | VoidFunction |
failureCallback | RTCPeerConnectionErrorCallback |
Returns
Promise<void>
Deprecated
Inherited from
RTCPeerConnection.addIceCandidate
addTrack()
addTrack(track, ...streams): RTCRtpSender;
Parameters
| Parameter | Type |
|---|---|
track | MediaStreamTrack |
...streams | MediaStream[] |
Returns
RTCRtpSender
Inherited from
RTCPeerConnection.addTrack
addTransceiver()
addTransceiver(trackOrKind, init?): RTCRtpTransceiver;
Parameters
| Parameter | Type |
|---|---|
trackOrKind | string | MediaStreamTrack |
init? | RTCRtpTransceiverInit |
Returns
RTCRtpTransceiver
Inherited from
RTCPeerConnection.addTransceiver
close()
close(): void;
Returns
void
Inherited from
RTCPeerConnection.close
createAnswer()
Call Signature
createAnswer(options?): Promise<RTCSessionDescriptionInit>;
Parameters
| Parameter | Type |
|---|---|
options? | RTCAnswerOptions |
Returns
Promise<RTCSessionDescriptionInit>
Inherited from
RTCPeerConnection.createAnswer
Call Signature
createAnswer(successCallback, failureCallback): Promise<void>;
Parameters
| Parameter | Type |
|---|---|
successCallback | RTCSessionDescriptionCallback |
failureCallback | RTCPeerConnectionErrorCallback |
Returns
Promise<void>
Deprecated
Inherited from
RTCPeerConnection.createAnswer
createDataChannel()
createDataChannel(label, dataChannelDict?): RTCDataChannel;
Parameters
| Parameter | Type |
|---|---|
label | string |
dataChannelDict? | RTCDataChannelInit |
Returns
RTCDataChannel
Inherited from
RTCPeerConnection.createDataChannel
createOffer()
Call Signature
createOffer(options?): Promise<RTCSessionDescriptionInit>;
Parameters
| Parameter | Type |
|---|---|
options? | RTCOfferOptions |
Returns
Promise<RTCSessionDescriptionInit>
Inherited from
RTCPeerConnection.createOffer
Call Signature
createOffer(
successCallback,
failureCallback,
options?): Promise<void>;
Parameters
| Parameter | Type |
|---|---|
successCallback | RTCSessionDescriptionCallback |
failureCallback | RTCPeerConnectionErrorCallback |
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.
Parameters
| Parameter | Type |
|---|---|
event | Event |
Returns
boolean
Inherited from
RTCPeerConnection.dispatchEvent
getConfiguration()
getConfiguration(): RTCConfiguration;
Returns
RTCConfiguration
Inherited from
RTCPeerConnection.getConfiguration
getReceivers()
getReceivers(): RTCRtpReceiver[];
Returns
RTCRtpReceiver[]
Inherited from
RTCPeerConnection.getReceivers
getSenders()
getSenders(): RTCRtpSender[];
Returns
RTCRtpSender[]
Inherited from
RTCPeerConnection.getSenders
getStats()
getStats(selector?): Promise<RTCStatsReport>;
Parameters
| Parameter | Type |
|---|---|
selector? | null | MediaStreamTrack |
Returns
Promise<RTCStatsReport>
Inherited from
RTCPeerConnection.getStats
getTransceivers()
getTransceivers(): RTCRtpTransceiver[];
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.
Type Parameters
| Type Parameter |
|---|
K extends keyof RTCPeerConnectionEventMap |
Parameters
| Parameter | Type |
|---|---|
type | K |
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.
Parameters
| Parameter | Type |
|---|---|
type | string |
listener | EventListenerOrEventListenerObject |
options? | boolean | EventListenerOptions |
Returns
void
Inherited from
RTCPeerConnection.removeEventListener
removeTrack()
removeTrack(sender): void;
Parameters
| Parameter | Type |
|---|---|
sender | RTCRtpSender |
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;
Parameters
| Parameter | Type |
|---|---|
configuration? | RTCConfiguration |
Returns
void
Inherited from
RTCPeerConnection.setConfiguration
setLocalDescription()
Call Signature
setLocalDescription(description?): Promise<void>;
Parameters
| Parameter | Type |
|---|---|
description? | RTCLocalSessionDescriptionInit |
Returns
Promise<void>
Inherited from
RTCPeerConnection.setLocalDescription
Call Signature
setLocalDescription(
description,
successCallback,
failureCallback): Promise<void>;
Parameters
| Parameter | Type |
|---|---|
description | RTCLocalSessionDescriptionInit |
successCallback | VoidFunction |
failureCallback | RTCPeerConnectionErrorCallback |
Returns
Promise<void>
Deprecated
Inherited from
RTCPeerConnection.setLocalDescription
setRemoteDescription()
Call Signature
setRemoteDescription(description): Promise<void>;
Parameters
| Parameter | Type |
|---|---|
description | RTCSessionDescriptionInit |
Returns
Promise<void>
Inherited from
RTCPeerConnection.setRemoteDescription
Call Signature
setRemoteDescription(
description,
successCallback,
failureCallback): Promise<void>;
Parameters
| Parameter | Type |
|---|---|
description | RTCSessionDescriptionInit |
successCallback | VoidFunction |
failureCallback | RTCPeerConnectionErrorCallback |
Returns
Promise<void>
Deprecated
Inherited from
RTCPeerConnection.setRemoteDescription