getRemotePeers method

Future<List<HMSPeer>?> getRemotePeers()

Returns only remote peers. The peer's own instance will not be included in this. To get all peers including the local one consider getPeers or for only the local one consider getLocalPeer. Returns null if no room is joined.

Implementation

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