Transport constructor
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)
Implementation
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,
this.producerCallback,
this.consumerCallback,
this.dataProducerCallback,
this.dataConsumerCallback,
}) : super() {
_logger.debug('constructor() [id:$id, direction:${direction.value}]');
_id = id;
_direction = direction;
_extendedRtpCapabilities = extendedRtpCapabilities;
_canProduceByKind = canProduceByKind;
_maxSctpMessageSize = sctpParameters?.maxMessageSize;
// Clone and sanitize additionalSettings.
additionalSettings = Map<String, dynamic>.of(additionalSettings);
additionalSettings.remove('iceServers');
additionalSettings.remove('iceTransportPolicy');
additionalSettings.remove('bundlePolicy');
additionalSettings.remove('rtcpMuxPolicy');
additionalSettings.remove('sdpSemantics');
_handler = HandlerInterface.handlerFactory();
_handler.run(
options: HandlerRunOptions(
direction: direction,
iceParameters: iceParameters,
iceCandidates: iceCandidates,
dtlsParameters: dtlsParameters,
sctpParameters: sctpParameters,
iceServers: iceServers,
iceTransportPolicy: iceTransportPolicy,
additionalSettings: additionalSettings,
proprietaryConstraints: proprietaryConstraints,
extendedRtpCapabilities: extendedRtpCapabilities,
),
);
_appData = appData;
_handleHandler();
}