refined-hydrogen-81988
12/02/2025, 2:55 PM_self_.ctx.room.remote_participants.values() but publication.track is None. I want to subscribe to this video track. Should I await it?tall-airline-16756
12/02/2025, 2:55 PMtall-airline-16756
12/02/2025, 2:55 PMpublication.track as None because the remote track hasn't been subscribed (or signaled) yet. To get the actual Track object you should subscribe and wait for the subscription event rather than relying on publication.track immediately.
What to do:
1. Ensure autoSubscribe is enabled, or call publication.setSubscribed(True) to request subscription.
2. Await the subscription by handling the track-subscribed event (or the SDK equivalent) and use the track provided there.
Example (Python-style):
# request subscription if needed
publication.setSubscribed(True)
# handle when the track is ready
@self.ctx.room.on("track_subscribed")
def on_track_subscribed(track, publication, participant):
if track.kind == rtc.TrackKind.KIND_VIDEO:
# `track` is now available for rendering/processing
...
If you tell me which SDK (Python, JS, iOS, Android) and whether autoSubscribe is on, I can give a concrete code snippet for your environment.
Sources: Subscribing to tracks | LiveKit docs | client-sdk-js | livekit/livekit_composite | DeepWikirefined-hydrogen-81988
12/02/2025, 2:58 PMtall-airline-16756
12/02/2025, 2:59 PM# request subscription if needed
publication.setSubscribed(True)
# await the specific subscription event
async def wait_for_subscription(pub, room):
fut = asyncio.get_event_loop().create_future()
@room.on("track_subscribed")
def _on(track, publication, participant):
if publication == pub:
fut.set_result(track)
return await fut
track = await wait_for_subscription(publication, room)
# track is now available
• If using JavaScript/TypeScript (Promise + once):
publication.setSubscribed(true);
const track = await new Promise((resolve) => {
room.once(RoomEvent.TrackSubscribed, (t, p) => {
if (p === publication) resolve(t);
});
});
Use whichever pattern matches your SDK. If you tell me which client (Python/JS/iOS/Android) you're using, I can provide a concrete snippet tailored to it.
Sources: Job lifecycle | LiveKit docs | client-sdk-swift | livekit/livekit_composite | DeepWiki | Subscribing to tracks | LiveKit docs