RTCPeerConnection class

A WebRTC connection between the local computer and a remote peer. It provides methods to connect to a remote peer, maintain and monitor the connection, and close the connection once it's no longer needed.

MDN Reference

Implemented types
Available extensions
Annotations
  • @JS()
  • @staticInterop

Constructors

RTCPeerConnection([RTCConfiguration? configuration])
factory

Properties

addEventListener → ({void Function<K$>(RTCPeerConnectionEventMap<K$> type, dynamic listener(K$), [Object? options]) $1, void Function(String type, Object listener, [Object? options]) $2})

Available on RTCPeerConnection, provided by the RTCPeerConnection$Typings extension

Overload accessor: $1, $2
no setter
addEventListener ↔ void Function(String, [Object?, Object?])

Available on EventTarget, provided by the EventTarget$Typings extension

getter/setter pair
addIceCandidate → ({Future<void> Function([RTCIceCandidateInit? candidate]) $1, Future<void> Function(RTCIceCandidateInit candidate, VoidFunction successCallback, RTCPeerConnectionErrorCallback failureCallback) $2})

Available on RTCPeerConnection, provided by the RTCPeerConnection$Typings extension

Overload accessor: $1, $2
no setter
addTrack RTCRtpSender Function(MediaStreamTrack, [Iterable?])

Available on RTCPeerConnection, provided by the RTCPeerConnection$Typings extension

getter/setter pair
addTransceiver RTCRtpTransceiver Function(Object, [RTCRtpTransceiverInit?])

Available on RTCPeerConnection, provided by the RTCPeerConnection$Typings extension

getter/setter pair
canTrickleIceCandidates bool?

Available on RTCPeerConnection, provided by the RTCPeerConnection$Typings extension

MDN Reference
no setter
close ↔ void Function()

Available on RTCPeerConnection, provided by the RTCPeerConnection$Typings extension

getter/setter pair
connectionState RTCPeerConnectionState

Available on RTCPeerConnection, provided by the RTCPeerConnection$Typings extension

MDN Reference
no setter
createAnswer → ({Future<RTCSessionDescriptionInit> Function([RTCAnswerOptions? options]) $1, Future<void> Function(RTCSessionDescriptionCallback successCallback, RTCPeerConnectionErrorCallback failureCallback) $2})

Available on RTCPeerConnection, provided by the RTCPeerConnection$Typings extension

Overload accessor: $1, $2
no setter
createDataChannel RTCDataChannel Function(String, [RTCDataChannelInit?])

Available on RTCPeerConnection, provided by the RTCPeerConnection$Typings extension

getter/setter pair
createOffer → ({Future<RTCSessionDescriptionInit> Function([RTCOfferOptions? options]) $1, Future<void> Function(RTCSessionDescriptionCallback successCallback, RTCPeerConnectionErrorCallback failureCallback, [RTCOfferOptions? options]) $2})

Available on RTCPeerConnection, provided by the RTCPeerConnection$Typings extension

Overload accessor: $1, $2
no setter
currentLocalDescription RTCSessionDescription?

Available on RTCPeerConnection, provided by the RTCPeerConnection$Typings extension

MDN Reference
no setter
currentRemoteDescription RTCSessionDescription?

Available on RTCPeerConnection, provided by the RTCPeerConnection$Typings extension

MDN Reference
no setter
dispatchEvent bool Function(Event)

Available on EventTarget, provided by the EventTarget$Typings extension

getter/setter pair
getConfiguration RTCConfiguration Function()

Available on RTCPeerConnection, provided by the RTCPeerConnection$Typings extension

getter/setter pair
getReceivers List<RTCRtpReceiver> Function()

Available on RTCPeerConnection, provided by the RTCPeerConnection$Typings extension

getter/setter pair
getSenders List<RTCRtpSender> Function()

Available on RTCPeerConnection, provided by the RTCPeerConnection$Typings extension

getter/setter pair
getStats Future<RTCStatsReport> Function([MediaStreamTrack?])

Available on RTCPeerConnection, provided by the RTCPeerConnection$Typings extension

getter/setter pair
getTransceivers List<RTCRtpTransceiver> Function()

Available on RTCPeerConnection, provided by the RTCPeerConnection$Typings extension

getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
iceConnectionState RTCIceConnectionState

Available on RTCPeerConnection, provided by the RTCPeerConnection$Typings extension

MDN Reference
no setter
iceGatheringState RTCIceGatheringState

Available on RTCPeerConnection, provided by the RTCPeerConnection$Typings extension

MDN Reference
no setter
localDescription RTCSessionDescription?

Available on RTCPeerConnection, provided by the RTCPeerConnection$Typings extension

MDN Reference
no setter
onconnectionstatechange ↔ dynamic Function(Event)?

Available on RTCPeerConnection, provided by the RTCPeerConnection$Typings extension

MDN Reference
getter/setter pair
ondatachannel ↔ dynamic Function(RTCDataChannelEvent)?

Available on RTCPeerConnection, provided by the RTCPeerConnection$Typings extension

MDN Reference
getter/setter pair
onicecandidate ↔ dynamic Function(RTCPeerConnectionIceEvent)?

Available on RTCPeerConnection, provided by the RTCPeerConnection$Typings extension

MDN Reference
getter/setter pair
onicecandidateerror ↔ dynamic Function(Event)?

Available on RTCPeerConnection, provided by the RTCPeerConnection$Typings extension

MDN Reference
getter/setter pair
oniceconnectionstatechange ↔ dynamic Function(Event)?

Available on RTCPeerConnection, provided by the RTCPeerConnection$Typings extension

MDN Reference
getter/setter pair
onicegatheringstatechange ↔ dynamic Function(Event)?

Available on RTCPeerConnection, provided by the RTCPeerConnection$Typings extension

MDN Reference
getter/setter pair
onnegotiationneeded ↔ dynamic Function(Event)?

Available on RTCPeerConnection, provided by the RTCPeerConnection$Typings extension

MDN Reference
getter/setter pair
onsignalingstatechange ↔ dynamic Function(Event)?

Available on RTCPeerConnection, provided by the RTCPeerConnection$Typings extension

MDN Reference
getter/setter pair
ontrack ↔ dynamic Function(RTCTrackEvent)?

Available on RTCPeerConnection, provided by the RTCPeerConnection$Typings extension

MDN Reference
getter/setter pair
pendingLocalDescription RTCSessionDescription?

Available on RTCPeerConnection, provided by the RTCPeerConnection$Typings extension

MDN Reference
no setter
pendingRemoteDescription RTCSessionDescription?

Available on RTCPeerConnection, provided by the RTCPeerConnection$Typings extension

MDN Reference
no setter
remoteDescription RTCSessionDescription?

Available on RTCPeerConnection, provided by the RTCPeerConnection$Typings extension

MDN Reference
no setter
removeEventListener ↔ void Function(String, [Object?, Object?])

Available on EventTarget, provided by the EventTarget$Typings extension

getter/setter pair
removeEventListener → ({void Function<K$>(RTCPeerConnectionEventMap<K$> type, dynamic listener(K$), [Object? options]) $1, void Function(String type, Object listener, [Object? options]) $2})

Available on RTCPeerConnection, provided by the RTCPeerConnection$Typings extension

Overload accessor: $1, $2
no setter
removeTrack ↔ void Function(RTCRtpSender)

Available on RTCPeerConnection, provided by the RTCPeerConnection$Typings extension

getter/setter pair
restartIce ↔ void Function()

Available on RTCPeerConnection, provided by the RTCPeerConnection$Typings extension

getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sctp RTCSctpTransport?

Available on RTCPeerConnection, provided by the RTCPeerConnection$Typings extension

MDN Reference
no setter
setConfiguration ↔ void Function([RTCConfiguration?])

Available on RTCPeerConnection, provided by the RTCPeerConnection$Typings extension

getter/setter pair
setLocalDescription → ({Future<void> Function([RTCLocalSessionDescriptionInit? description]) $1, Future<void> Function(RTCLocalSessionDescriptionInit description, VoidFunction successCallback, RTCPeerConnectionErrorCallback failureCallback) $2})

Available on RTCPeerConnection, provided by the RTCPeerConnection$Typings extension

Overload accessor: $1, $2
no setter
setRemoteDescription → ({Future<void> Function(RTCSessionDescriptionInit description) $1, Future<void> Function(RTCSessionDescriptionInit description, VoidFunction successCallback, RTCPeerConnectionErrorCallback failureCallback) $2})

Available on RTCPeerConnection, provided by the RTCPeerConnection$Typings extension

Overload accessor: $1, $2
no setter
signalingState RTCSignalingState

Available on RTCPeerConnection, provided by the RTCPeerConnection$Typings extension

MDN Reference
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

generateCertificate Future<RTCCertificate> Function(Object)
getter/setter pair