boundless-computer-27062
09/23/2025, 10:35 AMawait job_context.api.room.update_participant(
UpdateParticipantRequest(
room=job_context.room.name,
identity=identity,
permission=models.ParticipantPermission(
can_subscribe=can_subscribe,
can_publish=can_publish,
can_publish_data=can_publish_data,
),
)
)
now I want to subscribe back first participant but second participant is unable to listen to firsttall-airline-16756
09/23/2025, 10:35 AMtall-airline-16756
09/23/2025, 10:36 AMUpdateSubscriptions method instead of UpdateParticipantRequest. The UpdateSubscriptions method is designed specifically to manage track subscriptions, making it the perfect choice here.
Here’s a simple way to do it:
await room_service.update_subscriptions(
UpdateSubscriptionsRequest(
room="your-room-name",
identity="second-participant-identity",
track_sids=["track-sid-1", "track-sid-2"],
subscribe=True
)
)
Just be sure to replace "your-room-name", "second-participant-identity", and the track SIDs with the correct details for your situation.
This approach will make sure the second participant is successfully resubscribed to the first participant's tracks. If you have any questions or need further help, feel free to ask!
Sources: livekit/livekit_room.twirp.go | packages/livekit-server-sdk/src/RoomServiceClient.ts | src/main/kotlin/io/livekit/server/RoomServiceClient.kt | livekit-api/livekit/api/room_service.py | Rooms, participants, and tracks | LiveKit Docsboundless-computer-27062
09/23/2025, 10:40 AMawait job_context.api.room.update_participant(
UpdateParticipantRequest(
room=job_context.room.name,
identity=identity,
permission=models.ParticipantPermission(
can_subscribe=can_subscribe,
can_publish=can_publish,
can_publish_data=can_publish_data,
),
)
)tall-airline-16756
09/23/2025, 10:41 AMUpdateParticipantRequest to change permissions, LiveKit automatically unpublishes all media tracks for the participant if the CanPublish permission is revoked. To help you restore the participant's tracks, here’s a simple step-by-step guide:
1. First, use UpdateParticipantRequest again to re-enable the CanPublish permission by setting it to true.
2. Your client application will then receive a ParticipantPermissionChanged event once the permissions are updated.
3. Make sure your client-side application listens for this event and responds by triggering track republishing. For example, in the JavaScript SDK, you can call publishTrack() or publishMicrophone() to bring the tracks back.
Just a friendly reminder: the server doesn’t automatically republish tracks, so your client application will need to manage this part. If you need any help setting this up, feel free to ask—I’m here to support you!
Sources: Managing participants | LiveKit Docs | protobufs/livekit_room.proto | pkg/service/roomservice.goboundless-computer-27062
09/23/2025, 10:50 AMpublishTrack() or publishMicrophone() to bring the tracks back."tall-airline-16756
09/23/2025, 10:51 AMUpdateParticipantRequest API. So, when you update permissions like enabling canPublish, the server will handle publishing or unpublishing the tracks for you.
Unlike SDK-based participants, SIP participants don’t need client-side logic to republish tracks. Instead, LiveKit’s server manages this directly. Just a quick tip: if you re-enable canPublish for a SIP participant, please make sure the SIP endpoint is set up to send media streams to LiveKit, because the server will start accepting and processing those streams right away.
If you ever notice that SIP participants aren’t publishing tracks after you update permissions, a good first step is to double-check the SIP endpoint’s configuration and confirm it’s actively sending media to LiveKit. I’m here to help if you need any further assistance!
Sources: Managing participants | LiveKit Docs | pkg/rtc/uptrackmanager_test.go | livekit/src/room/participant/local_participant.rsboundless-computer-27062
09/23/2025, 10:52 AMtall-airline-16756
09/23/2025, 10:53 AMrepublishAllTracks method available in most client SDKs. This handy method unpublishes all existing tracks, optionally restarts them, and republishes them for you. Let me walk you through how it works across different SDKs:
• JavaScript/TypeScript SDK: Simply use await localParticipant.republishAllTracks().
• Flutter SDK: Use await localParticipant.rePublishAllTracks().
• Swift SDK: You can use try await localParticipant.republishAllTracks().
• Go SDK: Use republishTracks().
If you'd like to republish a specific track, you can do so by manually unpublishing it with unpublishTrack(track) and then republishing it using publishTrack(track, options). This approach is especially useful when reconnecting or if you want to refresh your track settings.
Please feel free to reach out if you have any questions or need further guidance—I’m here to support you every step of the way!
Sources: src/room/Room.ts | lib/src/participant/local.dart | Sources/LiveKit/Participant/LocalParticipant.swift | localparticipant.go