createRecvTransportFromMap method

Transport createRecvTransportFromMap(
  1. Map data, {
  2. Function? consumerCallback,
  3. Function? dataConsumerCallback,
})

Implementation

Transport createRecvTransportFromMap(
  Map data, {
  Function? consumerCallback,
  Function? dataConsumerCallback,
}) {
  return createRecvTransport(
    id: data['id'],
    iceParameters: IceParameters.fromMap(data['iceParameters']),
    iceCandidates: List<IceCandidate>.from(data['iceCandidates']
        .map((iceCandidate) => IceCandidate.fromMap(iceCandidate))
        .toList()),
    dtlsParameters: DtlsParameters.fromMap(data['dtlsParameters']),
    sctpParameters: data['sctpParameters'] != null
        ? SctpParameters.fromMap(data['sctpParameters'])
        : null,
    iceServers: [],
    appData: data['appData'] ?? {},
    proprietaryConstraints: Map<String, dynamic>.from({
      'optional': [
        {
          'googDscp': true,
        }
      ]
    }),
    additionalSettings: {
      'encodedInsertableStreams': false,
    },
    consumerCallback: consumerCallback,
    dataConsumerCallback: dataConsumerCallback,
  );
}