streamPropertyChangedEvent method

void streamPropertyChangedEvent(
  1. Map<String, dynamic> params
)

Implementation

void streamPropertyChangedEvent(Map<String, dynamic> params) {
  final RemoteParticipant? remoteParticipant =
      session.remoteParticipants[params['connectionId']];
  if (remoteParticipant != null) {
    final property = params['property'];
    final newValue = params['newValue'];

    if (property == 'videoActive') {
      remoteParticipant.changeCameraStatus(bool.parse(newValue));
    } else if (property == 'audioActive') {
      remoteParticipant.changeMicrophoneStatus(bool.parse(newValue));
    }

    if (remoteParticipant.onStreamChangeEvent != null) {
      remoteParticipant.onStreamChangeEvent!(params);
    }
  }
}