Lib jitsi meet right way to leave a call

Hi,
I’m using conference.leave() to leave a conference joined with lib-jitsi-meet. But even after leaving the chrome browser still shows that my video camera is begin accessed by the tab. I even tried calling connection.disconnect() after conference.leave() but still the same issue. What is the right way to leave a conference so that jitsi no longer needs camera access and leaves the conference completely?

You need to remove the tracks from the conference before destroying it

@damencho I’m removing the video tracks but still seeing the camera on.
Here is my conference object after removing the tracks:

conference.getParticipants() returns an empty array

Still struggling. Any help is appreciated :slight_smile:

Do you see the tracks in conference.rtc?

Try disposing the tracks before removing them …

No, the array size of localTracks in rtc is 0.

Same issue after disposing tracks.

videoTracks.map(track => track.dispose());
videoTracks.map(track => conference.removeTrack(track).then(() => {console.log("conference videoTracks: ", conference, conference.getParticipants());}));
videoTracks.map(track => removeVideoTrack(track));

The *conference videoTracks: * is not printed.

In the browser’s network tab I see that http-bind calls are still happening.

I had a similar issue recently. What worked for me is to do:

    await track.mute();
    track.detach();
    await track.dispose();

Both mute and dispose methods return a promise that can be awaited (or you can use .then() if you don’t use async/await).

Thanks @johnny256 for your time but still no luck. I noticed I’m getting the same issue(camera does not stop after leaving the call) when I use iframe api.