onParticipantsChange method

Stream<Event<ConferenceServiceEventNames, Participant>> onParticipantsChange()

Returns a Stream of the ConferenceServiceEventNames.participantAdded and ConferenceServiceEventNames.participantUpdated events. By subscribing to the returned stream you will be notified about changed statuses of conference participants and new participants in a conference.

Implementation

Stream<Event<ConferenceServiceEventNames, Participant>>
    onParticipantsChange() {
  return _nativeEventsReceiver.addListener([
    ConferenceServiceEventNames.participantAdded,
    ConferenceServiceEventNames.participantUpdated,
  ]).map((event) {
    final eventMap = event as Map<Object?, Object?>;
    final eventType =
        ConferenceServiceEventNames.valueOf(eventMap["key"] as String);
    final participant =
        ParticipantMapper.fromMap(eventMap["body"] as Map<Object?, Object?>);
    return Event(eventType, participant);
  });
}