lively-terabyte-73999
09/25/2025, 6:43 AMtall-airline-16756
09/25/2025, 6:44 AMtall-airline-16756
09/25/2025, 6:44 AMTrackSubscriptionStatusChanged event, which automatically notifies you whenever the subscription status changes. It’s efficient and keeps you in the loop right away.
Manual Polling: If you prefer, you can also check the subscription status yourself at regular intervals using the client SDKs:
• JavaScript SDK: Look at the isSubscribed property or the subscriptionStatus getter on RemoteTrackPublication.
• Android SDK: Check out the subscriptionStatus property on RemoteTrackPublication.
• Rust SDK: Use the subscription_status() method on RemoteTrackPublication.
• Swift SDK: Take a peek at the subscriptionState property on RemoteTrackPublication.
Here’s a simple example in JavaScript to help you get started with polling:
setInterval(() => {
trackPublication.subscriptionStatus; // Check current status
}, 5000); // Check every 5 seconds
If you have any questions or if there’s a particular scenario you’re working on, please don’t hesitate to reach out. I’m here to help you every step of the way!
Sources: Sources/LiveKit/TrackPublications/RemoteTrackPublication.swift | pkg/telemetry/events_test.go | src/room/track/RemoteTrackPublication.ts | agent-console/lib/event-definitions.tsx | livekit-android-sdk/src/main/java/io/livekit/android/room/track/RemoteTrack...lively-terabyte-73999
09/25/2025, 6:47 AMtall-airline-16756
09/25/2025, 6:48 AMReconnecting and Reconnected events so it can smoothly re-establish listeners when the connection comes back.
2. Verify Event Subscription: Double-check that you’re properly subscribed to the event. For example, in JavaScript, you want to make sure your listener is registered like this:
room.on(RoomEvent.TrackSubscribed, (track, publication, participant) => {
// handle track subscription
});
1. Handle Subscription Failures: Keep an eye out for the TrackSubscriptionFailed event, which can alert you to issues like permission problems or if a track isn’t available.
2. Review Track Subscription Process: It’s important that the subscription negotiation with the server completes successfully. If it doesn’t, the TrackSubscribed event won’t be triggered.
3. Examine Client SDK Implementation: Just a heads-up—events like TrackPublished or TrackSubscribed won’t fire for tracks that were already there before you joined. To catch all tracks, you’ll want to query the room’s state right after joining.
Please feel free to reach out if you want me to walk you through any of these steps or if you have more questions. I’m here to help!
Sources: Connecting to LiveKit | LiveKit Docs | src/room/events.ts | livekit-android-sdk/src/main/java/io/livekit/android/room/track/RemoteTrack... | Webhooks | LiveKit Docs | Subscribing to tracks | LiveKit Docslively-terabyte-73999
09/25/2025, 6:49 AMtall-airline-16756
09/25/2025, 6:49 AM