PeerConnection class





count int
Get the unique count of events registered in the emitter.
hashCode int
The hash code for this object.
peer RTCPeerConnection?
read / write
peerConnectionStats ↔ PeerConnectionStats?
read / write
pendingTransceivers List<RTCRtpTransceiverCompleter>
read / write
runtimeType Type
A representation of the runtime type of the object.
sessionDescription RTCSessionDescription?
read / write


addMediaStreamToPeer(RTCPeerConnection? peer, MediaStream? mediaStream, Map<String, dynamic> options) → void
addPeerEvents(PeerConnection instanceClass, RTCPeerConnection peer) → void
Emits peer events.
addReceiveTransceivers(RTCPeerConnection? peer, Map<String, dynamic> options) Future<void>
addRemoteTrack(dynamic media, List<MediaStream> streams) Future<RTCRtpTransceiver>
Add remote receving track.
clear() → void
Clear all subscribers from the cache.
closeRTCPeer() → dynamic
Close RTC peer connection.
createRTCPeer([Map<String, dynamic>? config]) → dynamic
Instance new RTCPeerConnection.
emit(String event, [Object? sender, Object? data]) → void
API to emit events. event is a required parameter. If sender information is sent, it will be used to intimate user about it. event - What event needs to be emitted. sender - The sender who published the event. Ignore if not required. data - Data the event need to carry. Ignore this argument if no data needs to be sent.
getConnectionState(RTCPeerConnection peer) String
Get peer connection state.
getListenersCount(String event) int
Get the list of subscribers for a particular event.
getRTCConfiguration(Map<String, dynamic>? config) → dynamic
Get default RTC configuration with ICE servers from Milicast signaling server and merge it with the user configuration provided. User configuration has priority over defaults.
getRTCIceServers({String? location}) → dynamic
Get Ice servers from a Millicast signaling server.
getRTCLocalSDP({Map<String, dynamic> options = localSDPOptions}) Future<String?>
Get the SDP modified depending the options. Optionally set the SDP information to local peer.
getRTCPeer() Future<RTCPeerConnection>
Get current RTC peer connection.
getRTCPeerStatus() String?
getTracks() Future<List<MediaStreamTrack?>>
Get sender tracks Returns List of MediaStreamTrack with all tracks in sender peer.
getValidMediaStream(MediaStream? mediaStream) Future<MediaStream?>
initStats() → dynamic
Initialize the statistics monitoring of the RTCPeerConnection. It will be emitted every second.
instanceRTCPeerConnection(dynamic instanceClass, Map<String, dynamic>? config) Future<RTCPeerConnection>
isMediaStreamValid(MediaStream mediaStream) bool
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
off(Listener? listener) → void
Remove event listener from emitter. This will unsubscribe the caller from the emitter from any future events. Listener should be a valid instance. listener - Listener instance to be removed from the event subscription.
on(String event, Object? context, EventCallback callback) Listener
API to register for notification. It is mandatory to pass event name and callback parameters. event - Event name used for the subscription. A valid event name is mandatory. context - Context information, which need to be sent in all emitted events. callback - EventCallback function registered to receive events emitted from the publisher. A valid callback function is mandatory.
removeAllByCallback(EventCallback callback) → void
Remove all listeners which matches with the callback provided. It is possible to register for multiple events with a single callback. This mechanism ensure that all event registrations would be cancelled which matches the callback. callback - The event callback used during subscription.
removeAllByEvent(String event) → void
Use this mechanism to remove all subscription for a particular event. Caution : This will remove all the listeners from multiple files or classes or modules. Think twice before calling this API and make sure you know what you are doing!!! event - Event name used during subscription.
removeListener(String eventName, EventCallback callback) → void
Unsubscribe from getting any future events from emitter. This mechanism uses event name and callback to unsubscribe from all possible events. eventName - Event name for the subscription. callback - EventCallback used when registering subscription using on function.
replaceTrack(MediaStreamTrack mediaStreamTrack) → void
Replace current audio or video track that is being broadcasted.
setRTCRemoteSDP(String sdp) Future<void>
stopStats() → dynamic
Stops the monitoring of RTCPeerConnection statistics.
toString() String
A string representation of this object.
updateBandwidthRestriction(String? sdp, num bitrate) String
updateBitrate({num bitrate = 0}) → dynamic
Set SDP information to remote peer with bandwidth restriction.


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

Static Methods

getCapabilities(String kind) Future<Map>
Gets user's mobile media capabilities compared with Millicast Media Server support.
getTurnServerLocation() String
Get current TURN location.
setTurnServerLocation(String url) → void
Set TURN server location.