videosdk-live / videosdk-rtc-flutter-sdk-example

WebRTC based video conferencing SDK for Flutter (Android / iOS)
https://docs.videosdk.live/flutter/guide/video-and-audio-calling-api-sdk/getting-started
82 stars 30 forks source link

problem with participantLeft. Not firing #69

Closed astheras closed 2 weeks ago

astheras commented 1 month ago

participantJoined works perfectly. But when i try to leave the stream from another device, participantLeft doesn't want to fire on my current device. Instead of participantLeft fires Events.streamDisabled, What am i doing wrong?

    room.on(
      Events.participantJoined,
      (Participant participant) {
        _registerParticipantEvents(
          participant,
        );
      },
    );

    // not working
    room.on(
      Events.participantLeft,
      (Participant participant) {
        participantList.removeWhere(
          (element) => element.participant.id == participant.id,
        );
      },
    );
harshitbagga commented 1 month ago

Can you review this implementation? I believe you're using our example as a reference. I recommend checking the conference_participant_grid.dart file in our example code for guidance. However, I still need to review your implementation of the leave function, specifically where the participant exits the meeting. Here's an example:

`_meeting.on( Events.participantLeft, (participantId) { final newParticipants = participants;

newParticipants.remove(participantId);
setState(() {
  participants = newParticipants;
  updateOnScreenParticipants();
});

}, );`

astheras commented 1 month ago

maybe i didn't understand, but the implementation of the leaving is provided in first message. And I can't get inside, because the event does not fire. I have checked it on ios and android. When I close page/application on device A, device B fires streamDisabled event Instead of participantLeft

 room.on(
      Events.participantLeft,
      (Participant participant) {
        participantList.removeWhere(
          (element) => element.participant.id == participant.id,
        );
      },
    );
harshitbagga commented 1 month ago

Could you please share the implementation where you're calling the leave method? If you'd like to discuss this further, feel free to book a meeting with us using this link: [https://meetings.hubspot.com/harshit-bagga].

astheras commented 1 month ago

device A is web, device B is phone. Just close tab or refresh the page on the web. On mobile room.leave() when I leave the meeting page. But basically , I also able to close app

harshitbagga commented 1 month ago

It would be helpful if we could review the code, as I tried the same on my end and it worked. I highly recommend booking a meeting with us using this link: [https://meetings.hubspot.com/harshit-bagga].

halima1802 commented 2 weeks ago

Hi @astheras , it’s been a while since we last heard from you, so I'll go ahead and close this issue for now. If you’re still experiencing this problem or have any updates to share, please feel free to reopen it or create a new issue. Thanks for your understanding!