orange-diamond-89955
05/16/2025, 12:48 PMtall-airline-16756
05/16/2025, 12:48 PMtall-airline-16756
05/16/2025, 12:48 PMunsubscribe
method of the remote publication class. Here’s what happens during the process:
1. The method checks if the track is currently subscribed.
2. If subscribed, it sends an update to unsubscribe.
3. If a track exists, it emits the TrackUnsubscribedEvent
to both the participant’s events and the room’s events.
4. Finally, it updates the track to null.
Make sure to listen to the TrackUnsubscribedEvent
and handle any necessary cleanup accordingly. Let me know if you need further assistance!
Sources: TrackUnsubscribedEvent class - livekit_client library - Dart API | unsubscribe method - RemoteTrackPublication class - livekit_client library ... | participant(_:didUnsubscribeTrack:) | Documentationorange-diamond-89955
05/16/2025, 12:50 PMtall-airline-16756
05/16/2025, 12:50 PM// Assuming you have a reference to the publication you want to unsubscribe from
publication.setSubscribed(false);
When you call setSubscribed(false)
on the track publication, it unsubscribes the local participant from the track. Additionally, a TrackUnsubscribedEvent
will be emitted, which you can listen for on both the Room and RemoteParticipant objects.
Let me know if you need further clarification or additional examples!
Sources: Subscribing to tracks | LiveKit Docs | TrackUnsubscribedEvent class - livekit_client library - Dart API