RtcPeerConnection class

Inheritance
Annotations
  • @DomName('RTCPeerConnection')
  • @SupportedBrowser(SupportedBrowser.CHROME)
  • @Experimental()
  • @Native("RTCPeerConnection,webkitRTCPeerConnection,mozRTCPeerConnection")

Constructors

RtcPeerConnection(Map rtcIceServers, [ Map mediaConstraints ])
factory

Properties

iceConnectionState String
@DocsEditable(), @DomName('RTCPeerConnection.iceConnectionState'), final
iceGatheringState String
@DocsEditable(), @DomName('RTCPeerConnection.iceGatheringState'), final
localDescription RtcSessionDescription
@DocsEditable(), @DomName('RTCPeerConnection.localDescription'), final
onAddStream Stream<MediaStreamEvent>
Stream of addstream events handled by this RtcPeerConnection.
@DocsEditable(), @DomName('RTCPeerConnection.onaddstream'), read-only
onDataChannel Stream<RtcDataChannelEvent>
Stream of datachannel events handled by this RtcPeerConnection.
@DocsEditable(), @DomName('RTCPeerConnection.ondatachannel'), read-only
onIceCandidate Stream<RtcPeerConnectionIceEvent>
Stream of icecandidate events handled by this RtcPeerConnection.
@DocsEditable(), @DomName('RTCPeerConnection.onicecandidate'), read-only
onIceConnectionStateChange Stream<Event>
Stream of iceconnectionstatechange events handled by this RtcPeerConnection.
@DocsEditable(), @DomName('RTCPeerConnection.oniceconnectionstatechange'), read-only
onNegotiationNeeded Stream<Event>
Stream of negotiationneeded events handled by this RtcPeerConnection.
@DocsEditable(), @DomName('RTCPeerConnection.onnegotiationneeded'), read-only
onRemoveStream Stream<MediaStreamEvent>
Stream of removestream events handled by this RtcPeerConnection.
@DocsEditable(), @DomName('RTCPeerConnection.onremovestream'), read-only
onSignalingStateChange Stream<Event>
Stream of signalingstatechange events handled by this RtcPeerConnection.
@DocsEditable(), @DomName('RTCPeerConnection.onsignalingstatechange'), read-only
remoteDescription RtcSessionDescription
@DocsEditable(), @DomName('RTCPeerConnection.remoteDescription'), final
signalingState String
@DocsEditable(), @DomName('RTCPeerConnection.signalingState'), final
hashCode int
The hash code for this object. [...]
read-only, inherited
on Events
This is an ease-of-use accessor for event streams which should only be used when an explicit accessor is not available.
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

addIceCandidate(Object candidate, [ VoidCallback successCallback, RtcPeerConnectionErrorCallback failureCallback ]) Future
@DocsEditable(), @DomName('RTCPeerConnection.addIceCandidate')
addStream(MediaStream stream, [ Map mediaConstraints ]) → void
@DocsEditable(), @DomName('RTCPeerConnection.addStream')
addTrack(MediaStreamTrack track, MediaStream streams) RtcRtpSender
@DocsEditable(), @DomName('RTCPeerConnection.addTrack'), @Experimental()
close() → void
@DocsEditable(), @DomName('RTCPeerConnection.close')
createAnswer([Map mediaConstraints ]) Future<RtcSessionDescription>
createDataChannel(String label, [ Map dataChannelDict ]) RtcDataChannel
@DocsEditable(), @DomName('RTCPeerConnection.createDataChannel')
createDtmfSender(MediaStreamTrack track) RtcDtmfSender
@DocsEditable(), @DomName('RTCPeerConnection.createDTMFSender'), @JSName('createDTMFSender')
createOffer([Map mediaConstraints ]) Future<RtcSessionDescription>
getLocalStreams() List<MediaStream>
@DocsEditable(), @DomName('RTCPeerConnection.getLocalStreams')
getReceivers() List<RtcRtpReceiver>
@DocsEditable(), @DomName('RTCPeerConnection.getReceivers'), @Experimental()
getRemoteStreams() List<MediaStream>
@DocsEditable(), @DomName('RTCPeerConnection.getRemoteStreams')
getSenders() List<RtcRtpSender>
@DocsEditable(), @DomName('RTCPeerConnection.getSenders'), @Experimental()
getStats() Future
@DocsEditable(), @DomName('RTCPeerConnection.getStats')
removeStream(MediaStream stream) → void
@DocsEditable(), @DomName('RTCPeerConnection.removeStream')
removeTrack(RtcRtpSender sender) → void
@DocsEditable(), @DomName('RTCPeerConnection.removeTrack'), @Experimental()
setConfiguration(Map configuration) → void
@DocsEditable(), @DomName('RTCPeerConnection.setConfiguration'), @Experimental()
setLocalDescription(Map description) Future
@DocsEditable(), @DomName('RTCPeerConnection.setLocalDescription'), @JSName('setLocalDescription')
setRemoteDescription(Map description) Future
@DocsEditable(), @DomName('RTCPeerConnection.setRemoteDescription'), @JSName('setRemoteDescription')
addEventListener(String type, EventListener listener, [ bool useCapture ]) → void
inherited
dispatchEvent(Event event) bool
@DocsEditable(), @DomName('EventTarget.dispatchEvent'), inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
removeEventListener(String type, EventListener listener, [ bool useCapture ]) → void
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited

Static Properties

supported bool
Checks if Real Time Communication (RTC) APIs are supported and enabled on the current platform.
read-only

Static Methods

generateCertificate(dynamic keygenAlgorithm) Future
@DocsEditable(), @DomName('RTCPeerConnection.generateCertificate'), @Experimental()

Constants

addStreamEvent → const EventStreamProvider<MediaStreamEvent>
Static factory designed to expose addstream events to event handlers that are not necessarily instances of RtcPeerConnection. [...]
@DocsEditable(), @DomName('RTCPeerConnection.addstreamEvent')
const EventStreamProvider<MediaStreamEvent>('addstream')
dataChannelEvent → const EventStreamProvider<RtcDataChannelEvent>
Static factory designed to expose datachannel events to event handlers that are not necessarily instances of RtcPeerConnection. [...]
@DocsEditable(), @DomName('RTCPeerConnection.datachannelEvent')
const EventStreamProvider<RtcDataChannelEvent>('datachannel')
iceCandidateEvent → const EventStreamProvider<RtcPeerConnectionIceEvent>
Static factory designed to expose icecandidate events to event handlers that are not necessarily instances of RtcPeerConnection. [...]
@DocsEditable(), @DomName('RTCPeerConnection.icecandidateEvent')
const EventStreamProvider<RtcPeerConnectionIceEvent>('icecandidate')
iceConnectionStateChangeEvent → const EventStreamProvider<Event>
Static factory designed to expose iceconnectionstatechange events to event handlers that are not necessarily instances of RtcPeerConnection. [...]
@DocsEditable(), @DomName('RTCPeerConnection.iceconnectionstatechangeEvent')
const EventStreamProvider<Event>('iceconnectionstatechange')
negotiationNeededEvent → const EventStreamProvider<Event>
Static factory designed to expose negotiationneeded events to event handlers that are not necessarily instances of RtcPeerConnection. [...]
@DocsEditable(), @DomName('RTCPeerConnection.negotiationneededEvent')
const EventStreamProvider<Event>('negotiationneeded')
removeStreamEvent → const EventStreamProvider<MediaStreamEvent>
Static factory designed to expose removestream events to event handlers that are not necessarily instances of RtcPeerConnection. [...]
@DocsEditable(), @DomName('RTCPeerConnection.removestreamEvent')
const EventStreamProvider<MediaStreamEvent>('removestream')
signalingStateChangeEvent → const EventStreamProvider<Event>
Static factory designed to expose signalingstatechange events to event handlers that are not necessarily instances of RtcPeerConnection. [...]
@DocsEditable(), @DomName('RTCPeerConnection.signalingstatechangeEvent')
const EventStreamProvider<Event>('signalingstatechange')