Table of Contents

Class LiveKitEgressService

Namespace
LiveKit.Services
Assembly
LiveKit.AspNetCore.ServerSdk.dll

Service for recording and streaming rooms, participants, or tracks.

Provides methods for starting and managing egress (recording/streaming) sessions. See LiveKit Egress API Documentation for more information.

public sealed class LiveKitEgressService : TwirpClient, ILiveKitEgressService
Inheritance
LiveKitEgressService
Implements
Inherited Members

Constructors

LiveKitEgressService(HttpClient, ILogger<LiveKitEgressService>, ILiveKitTokenService)

Initializes a new instance of the LiveKitEgressService class.

public LiveKitEgressService(HttpClient httpClient, ILogger<LiveKitEgressService> logger, ILiveKitTokenService _tokenService)

Parameters

httpClient HttpClient
logger ILogger<LiveKitEgressService>
_tokenService ILiveKitTokenService

Methods

ListEgressAsync(ListEgressRequest, CancellationToken)

Lists active and completed egresses.

public Task<ListEgressResponse> ListEgressAsync(ListEgressRequest request, CancellationToken cancellationToken = default)

Parameters

request ListEgressRequest
cancellationToken CancellationToken

Returns

Task<ListEgressResponse>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.

StartParticipantEgressAsync(ParticipantEgressRequest, CancellationToken)

Starts a participant egress to record a single participant.

public Task<EgressInfo> StartParticipantEgressAsync(ParticipantEgressRequest request, CancellationToken cancellationToken = default)

Parameters

request ParticipantEgressRequest
cancellationToken CancellationToken

Returns

Task<EgressInfo>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.

StartRoomCompositeEgressAsync(RoomCompositeEgressRequest, CancellationToken)

Starts a room composite egress (recording or streaming).

public Task<EgressInfo> StartRoomCompositeEgressAsync(RoomCompositeEgressRequest request, CancellationToken cancellationToken = default)

Parameters

request RoomCompositeEgressRequest
cancellationToken CancellationToken

Returns

Task<EgressInfo>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.

StartTrackCompositeEgressAsync(TrackCompositeEgressRequest, CancellationToken)

Starts a track composite egress to record specific tracks.

public Task<EgressInfo> StartTrackCompositeEgressAsync(TrackCompositeEgressRequest request, CancellationToken cancellationToken = default)

Parameters

request TrackCompositeEgressRequest
cancellationToken CancellationToken

Returns

Task<EgressInfo>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.

StartTrackEgressAsync(TrackEgressRequest, CancellationToken)

Starts a track egress to record a single track without transcoding.

public Task<EgressInfo> StartTrackEgressAsync(TrackEgressRequest request, CancellationToken cancellationToken = default)

Parameters

request TrackEgressRequest
cancellationToken CancellationToken

Returns

Task<EgressInfo>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.

StartWebEgressAsync(WebEgressRequest, CancellationToken)

Starts a web egress to record any website.

public Task<EgressInfo> StartWebEgressAsync(WebEgressRequest request, CancellationToken cancellationToken = default)

Parameters

request WebEgressRequest
cancellationToken CancellationToken

Returns

Task<EgressInfo>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.

StopEgressAsync(StopEgressRequest, CancellationToken)

Stops an active egress.

public Task<EgressInfo> StopEgressAsync(StopEgressRequest request, CancellationToken cancellationToken = default)

Parameters

request StopEgressRequest
cancellationToken CancellationToken

Returns

Task<EgressInfo>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.

UpdateLayoutAsync(UpdateLayoutRequest, CancellationToken)

Updates the layout of a web composite egress.

public Task<EgressInfo> UpdateLayoutAsync(UpdateLayoutRequest request, CancellationToken cancellationToken = default)

Parameters

request UpdateLayoutRequest
cancellationToken CancellationToken

Returns

Task<EgressInfo>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.

UpdateStreamAsync(UpdateStreamRequest, CancellationToken)

Adds or removes stream endpoints for an active egress.

public Task<EgressInfo> UpdateStreamAsync(UpdateStreamRequest request, CancellationToken cancellationToken = default)

Parameters

request UpdateStreamRequest
cancellationToken CancellationToken

Returns

Task<EgressInfo>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.