Class EgressServiceClient
- Namespace
- Livekit.Server.Sdk.Dotnet
- Assembly
- LivekitApi.dll
Client of the LiveKit Egress service: records or streams rooms, participants, tracks and web pages. See Egress overview.
public class EgressServiceClient : BaseService
- Inheritance
-
EgressServiceClient
- Inherited Members
Constructors
EgressServiceClient(string, string, string, HttpClient)
Creates the client.
public EgressServiceClient(string host, string apiKey = null, string apiSecret = null, HttpClient client = null)
Parameters
hoststringURL of the LiveKit server,
http(s)://orws(s)://; a subpath such ashttps://host/livekitis kept.apiKeystringAPI key; the
LIVEKIT_API_KEYenvironment variable when omitted.apiSecretstringAPI secret; the
LIVEKIT_API_SECRETenvironment variable when omitted.clientHttpClientOptional HttpClient to send the requests with. The SDK never modifies it, so it can be shared with other clients and code.
Methods
ListEgress(ListEgressRequest)
Lists the egresses, optionally filtered by room, egress ID or active state.
public Task<ListEgressResponse> ListEgress(ListEgressRequest request)
Parameters
requestListEgressRequestOptional filters: room name, egress ID, active egresses only.
Returns
- Task<ListEgressResponse>
The matching egresses.
StartEgress(StartEgressRequest)
Start any type of egress. The request's source and outputs determine the egress type.
public Task<EgressInfo> StartEgress(StartEgressRequest request)
Parameters
requestStartEgressRequestWhich kind of egress to start, with its own options.
Returns
- Task<EgressInfo>
The started egress, with its ID and status.
StartParticipantEgress(ParticipantEgressRequest)
Starts a participant egress: records or streams the tracks of one participant.
public Task<EgressInfo> StartParticipantEgress(ParticipantEgressRequest request)
Parameters
requestParticipantEgressRequestRoom name, participant identity and the outputs.
Returns
- Task<EgressInfo>
The started egress, with its ID and status.
StartRoomCompositeEgress(RoomCompositeEgressRequest)
Starts a room composite egress: records or streams the whole room, rendered by a web template.
public Task<EgressInfo> StartRoomCompositeEgress(RoomCompositeEgressRequest request)
Parameters
requestRoomCompositeEgressRequestRoom name, layout, template and the file, stream, segment or image outputs.
Returns
- Task<EgressInfo>
The started egress, with its ID and status.
StartTrackCompositeEgress(TrackCompositeEgressRequest)
Starts a track composite egress: records or streams one audio and one video track mixed together.
public Task<EgressInfo> StartTrackCompositeEgress(TrackCompositeEgressRequest request)
Parameters
requestTrackCompositeEgressRequestRoom name, the audio and video track SIDs and the outputs.
Returns
- Task<EgressInfo>
The started egress, with its ID and status.
StartTrackEgress(TrackEgressRequest)
Starts a track egress: exports a single track to a file or to a WebSocket.
public Task<EgressInfo> StartTrackEgress(TrackEgressRequest request)
Parameters
requestTrackEgressRequestRoom name, track SID and the file or WebSocket output.
Returns
- Task<EgressInfo>
The started egress, with its ID and status.
StartWebEgress(WebEgressRequest)
Starts a web egress: records or streams an arbitrary web page.
public Task<EgressInfo> StartWebEgress(WebEgressRequest request)
Parameters
requestWebEgressRequestURL to render and the outputs.
Returns
- Task<EgressInfo>
The started egress, with its ID and status.
StopEgress(StopEgressRequest)
Stops a running egress.
public Task<EgressInfo> StopEgress(StopEgressRequest request)
Parameters
requestStopEgressRequestEgress ID.
Returns
- Task<EgressInfo>
The stopped egress.
UpdateLayout(UpdateLayoutRequest)
Changes the layout of a running room composite egress.
public Task<EgressInfo> UpdateLayout(UpdateLayoutRequest request)
Parameters
requestUpdateLayoutRequestEgress ID and the new layout.
Returns
- Task<EgressInfo>
The updated egress.
UpdateStream(UpdateStreamRequest)
Adds or removes stream destinations (RTMP, SRT) of a running stream egress.
public Task<EgressInfo> UpdateStream(UpdateStreamRequest request)
Parameters
requestUpdateStreamRequestEgress ID and the stream URLs to add or remove.
Returns
- Task<EgressInfo>
The updated egress.