skip to Main Content

friends I had implemented Twillio Video call in my Android application its working fine in the availability of the network.But I am facing an issue in case of network lost.

Test Cases:-

  1. Device A call to Device B.
  2. Both connected to Room successfully.and video call working fine.
  3. Sudden Device B lost the network connection at this time the call is continuous this is a bug.

Expected :- Both have to disconnect from the room.
Actual:- they are still in connection

Please help if anybody implement this.

2

Answers


  1. Use connection check method in your class detect app have connection or not if doesnt have connnection you can call the method of call disconnect.
    If twillio is not disconnecting the call you can disconnect the call by yourself.

    Login or Signup to reply.
  2. While initializing Room, we are providing listeners to it.

        ConnectOptions.Builder connectOptionsBuilder = new ConnectOptions.Builder(mAccessToken);
        Room mRoom = Video.connect(this, connectOptionsBuilder.build(), new Room.Listener() {
                    @Override
                    public void onConnected(Room room) {
    
                    }
    
                    @Override
                    public void onConnectFailure(Room room, TwilioException twilioException) {
    
                    }
    
                    @Override
                    public void onDisconnected(Room room, TwilioException twilioException) {
                               String leftParticipantName = room.getName();// name of participant who has left
                               // Here you can end/disconnect your conversation.
    
                    }
    
                    @Override
                    public void onParticipantConnected(Room room, Participant participant) {
    
                    }
    
                    @Override
                    public void onParticipantDisconnected(Room room, Participant participant) {
    
                    }
    
                    @Override
                    public void onRecordingStarted(Room room) {
    
                    }
    
                    @Override
                    public void onRecordingStopped(Room room) {
    
                    }
                });
    

    From this method you can disconnect your video-conversation.

    For disconnect:

    if (mRoom != null) {
        mRoom.disconnect();
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search