toMap method

Map<String, dynamic> toMap()

Implementation

Map<String, dynamic> toMap() {
  final iceServersMap = <Map<String, dynamic>>[
    if (iceServers != null)
      for (final e in iceServers!) e.toMap()
  ];

  return <String, dynamic>{
    // only supports unified plan
    'sdpSemantics': 'unified-plan',
    if (encodedInsertableStreams != null)
      'encodedInsertableStreams': encodedInsertableStreams,
    if (iceServersMap.isNotEmpty) 'iceServers': iceServersMap,
    if (iceCandidatePoolSize != null)
      'iceCandidatePoolSize': iceCandidatePoolSize,
    if (iceTransportPolicy != null)
      'iceTransportPolicy': iceTransportPolicy!.toStringValue(),
  };
}