Calls / React Native
Calls React Native v1
Calls React Native
Calls
React Native
Home
/
Calls
/
React Native
/
Group call

Reconnect to the media stream

When a participant loses media stream in a room due to connection issues, the Calls SDK automatically tries to reconnect the participant’s media streaming in the room. If the Calls SDK fails to reconnect for about 40 seconds, an error will be returned.

import { SendbirdError } from '@sendbird/calls-react-native';

room.addListener({
  // Called when an error has occurred.
  onError(error: SendbirdError, participant: Participant | null) {
    if (error.code === SendbirdError.ErrorCode.ERR_LOCAL_PARTICIPANT_LOST_CONNECTION) {
      // Handle reconnection failure here.
      // Clear resources for group calls.
    }
  }
})