Calls / React Native
Calls React Native v1
Calls React Native
Calls
React Native
Home
/
Calls
/
React Native
/
Direct call

Manage a call

During an ongoing call, both the caller and callee’s audio can be muted or unmuted by the directCall.muteMicrophone() or directCall.unmuteMicrophone() methods. If one party changes audio settings, the other party receives an event callback through the DirectCallListener.onRemoteAudioSettingsChanged() listener method.

The caller can start or stop video using the directCall.startVideo() or directCall.stopVideo() methods. If the remote user changes the video settings, the local user will be notified through the DirectCallListener.onRemoteVideoSettingsChanged() listener.

// Mutes local microphone.
directCall.muteMicrophone();

// Unnmutes local microphone.
directCall.unmuteMicrophone();

// Starts video.
directCall.startVideo();

// Stops video.
directCall.stopVideo();

// Changes current video device.
directCall.selectVideoDevice(VIDEO_DEVICE).catch((error) => {});

// Receives the event.
directCall.addListener({
 // ...
 onRemoteAudioSettingsChanged: (callProps: DirectCallProperties) => {
   if (callProps.isRemoteAudioEnabled) {
     // The remote user has been unmuted.
     // Consider displaying an unmuted icon.
   } else {
     // The remote user has been muted.
     // Consider displaying a muted icon.
   }
 },

 onRemoteVideoSettingsChanged: (callProps: DirectCallProperties) => {
   if (callProps.isRemoteVideoEnabled) {
     // The remote user has started video.
   } else {
     // The remote user has stopped video.
   }
 },
});