getPeers method

Future<List<HMSPeer>?> getPeers()

Returns all peers, remote and local. Returns null if no room is joined.

Implementation

Future<List<HMSPeer>?> getPeers() async {
  List? peers = await PlatformService.invokeMethod(PlatformMethod.getPeers);
  if (peers == null) {
    return null;
  }
  List<HMSPeer> listOfPeers = [];
  peers.forEach((element) {
    listOfPeers.add(HMSPeer.fromMap(element as Map));
  });
  return listOfPeers;
}