getIceSevers method

Future<List<Map<String, dynamic>>> getIceSevers()

Implementation

Future<List<Map<String, dynamic>>> getIceSevers() async {
  if (_turnServerCredentials == null) {
    try {
      _turnServerCredentials = await client.getTurnServer();
    } catch (e) {
      Logs().v('[VOIP] getTurnServerCredentials error => ${e.toString()}');
    }
  }

  if (_turnServerCredentials == null) {
    return [];
  }

  return [
    {
      'username': _turnServerCredentials!.username,
      'credential': _turnServerCredentials!.password,
      'url': _turnServerCredentials!.uris[0]
    }
  ];
}