Transport class
Constructors
-
Transport({required Direction direction, required String id, required IceParameters iceParameters, required List<IceCandidate> iceCandidates, required DtlsParameters dtlsParameters, SctpParameters? sctpParameters, List<RTCIceServer> iceServers = const <RTCIceServer>[], RTCIceTransportPolicy? iceTransportPolicy, Map<String, dynamic> additionalSettings = const <String, dynamic>{}, Map<String, dynamic> proprietaryConstraints = const <String, dynamic>{}, Map<String, dynamic> appData = const <String, dynamic>{}, ExtendedRtpCapabilities? extendedRtpCapabilities, required CanProduceByKind canProduceByKind, Function? producerCallback, Function? consumerCallback, Function? dataProducerCallback, Function? dataConsumerCallback})
-
@emits connect - (transportLocalParameters: any, callback: Function, errback: Function)
@emits connectionstatechange - (connectionState: ConnectionState)
@emits produce - (producerLocalParameters: any, callback: Function, errback: Function)
@emits producedata - (dataProducerLocalParameters: any, callback: Function, errback: Function)
Methods
-
callback(Function func, [dynamic arg0, dynamic arg1, dynamic arg2, dynamic arg3, dynamic arg4, dynamic arg5])
→ dynamic
-
inherited
-
callbackAsFuture(Function func, [dynamic arg0, dynamic arg1, dynamic arg2, dynamic arg3, dynamic arg4, dynamic arg5])
→ Future
-
inherited
-
clearListeners()
→ void
-
This function unbinds all the handlers for all the events
inherited
-
close()
→ Future<void>
-
Close the Transport.
-
consume({required String id, required String producerId, required String peerId, required RTCRtpMediaType kind, required RtpParameters rtpParameters, Map<String, dynamic> appData = const <String, dynamic>{}, Function? accept})
→ void
-
Create a Consumer to consume a remote Producer.
use consumerCallback to receive a new Consumer.
-
consumeData({required String id, required String dataProducerId, required SctpStreamParameters sctpStreamParameters, String label = '', String protocol = '', Map<String, dynamic> appData = const <String, dynamic>{}, String? peerId, Function? accept})
→ void
-
-
emit(String event, [dynamic arg0, dynamic arg1, dynamic arg2, dynamic arg3, dynamic arg4, dynamic arg5])
→ void
-
This function triggers all the handlers currently listening
to
event
and passes them data
.
inherited
-
emitAsFuture(String event, [dynamic arg0, dynamic arg1, dynamic arg2, dynamic arg3, dynamic arg4, dynamic arg5])
→ Future
-
This function triggers all the handlers currently listening
to
event
and passes them data
.
inherited
-
getState()
→ Future<List<StatsReport>>
-
Get associated Transport (RTCPeerConnection) stats.
-
listeners(dynamic event)
→ List
-
Return function list named
event
.
inherited
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
off(String event)
→ void
-
This function attempts to unbind all the
handler
from the event
inherited
-
on(String event, Function handler)
→ void
-
This function binds the
handler
as a listener to the event
inherited
-
once(String event, Function handler)
→ void
-
This function binds the
handler
as a listener to the first
occurrence of the event
. When handler
is called once,
it is removed.
inherited
-
produce({required MediaStreamTrack track, required MediaStream stream, List<RtpEncodingParameters> encodings = const <RtpEncodingParameters>[], ProducerCodecOptions? codecOptions, RtpCodecCapability? codec, bool stopTracks = true, bool disableTrackOnPause = true, bool zeroRtpOnPause = false, Map<String, dynamic> appData = const <String, dynamic>{}, required String source, Function? accept})
→ void
-
Create a Producer.
use producerCallback to receive a new Producer.
-
produceData({bool ordered = true, int maxPacketLife = 0, required int maxRetransmits, Priority priority = Priority.Low, String label = '', String protocol = '', Map<String, dynamic> appData = const <String, dynamic>{}, Function? accept})
→ void
-
Create a DataProducer
use dataProducerCallback to receive a new ProducerData.
-
remove(String event, Function handler)
→ void
-
This function attempts to unbind the
handler
from the event
inherited
-
restartIce(IceParameters iceParameters)
→ void
-
Restart ICE connection.
-
safeEmit(String event, [Map<String, dynamic>? args])
→ void
-
inherited
-
safeEmitAsFuture(String event, [Map<String, dynamic>? args])
→ Future
-
inherited
-
toString()
→ String
-
A string representation of this object.
inherited
-
updateIceServers(List<RTCIceServer> iceServers)
→ void
-
Update ICE servers.