nice-room-70150
11/07/2025, 7:54 AMtall-airline-16756
11/07/2025, 7:55 AMtall-airline-16756
11/07/2025, 7:56 AMautoSubscribe to false. This way, you have full control over what you subscribe to:
let connectOptions = ConnectOptions(
url: "ws://<your_host>",
token: "<your_token>",
autoSubscribe: false
)
let room = LiveKit.connect(options: connectOptions, delegate: self)
2. Subscribe to Audio Tracks: Use the room delegate methods to make sure you’re only subscribing to audio tracks. Here’s how you can do it:
func room(_ room: Room, participant: RemoteParticipant, didPublish publication: RemoteTrackPublication) {
if publication.source == .microphone && publication.kind == .audio {
Task {
try await publication.set(subscribed: true)
}
}
}
3. Server-Side Control (Optional): If you want, you can also configure your authentication token to allow subscription permissions only. This adds an extra layer of control:
const token = new AccessToken(apiKey, apiSecret, {
identity: 'audio-only-participant',
});
token.addGrant({
room: 'your-room-name',
roomJoin: true,
canPublish: false,
canSubscribe: true,
});
If you have any questions or need a hand with the implementation, please don’t hesitate to reach out. I’m here to help!
Sources: Subscribing to tracks | LiveKit docs | Multiplatform/Views/ParticipantView.swift | Authentication | LiveKit Docs | Sources/LiveKit/Core/Room+PreConnect.swift | Mobile SDKs (Flutter, iOS, Android) | livekit/livekit_composite | DeepWikinice-room-70150
11/07/2025, 11:03 AMtall-airline-16756
11/07/2025, 11:05 AMawait egress.startRoomCompositeEgress(
'your-room-name',
{
file: { filepath: 'recording.mp4', s3: { ... } } // specify output location
},
{ layout: 'grid', audioOnly: false }
);
1. Choose Output Options: You have the flexibility to save your recording to cloud storage like S3, stream it through RTMP, or create HLS files—whatever works best for you.
2. Stop Recording: When you’re ready to stop, just use this command:
await egress.stopEgress(egressId);
This method will automatically include all published tracks—audio, video, screen share—from every participant in the room, including yourself. If you have any questions or need a hand with anything else, please don’t hesitate to ask. I’m here to help!
Sources: protobufs/livekit_egress.proto | Universal Egress | packages/livekit-server-sdk/src/EgressClient.ts | Recording participants | LiveKit docsnice-room-70150
11/07/2025, 1:14 PMtall-airline-16756
11/07/2025, 1:14 PMnice-room-70150
11/07/2025, 1:15 PMtall-airline-16756
11/07/2025, 1:16 PM