Class LiveKitRoomService
Calls LiveKit's room service over Twirp with JSON, authorized by a short access token signed with the API secret.
Inherited Members
Namespace: Uniform.LiveKit
Assembly: Uniform.LiveKit.dll
Syntax
public sealed class LiveKitRoomService
Constructors
| Edit this page View SourceLiveKitRoomService(HttpClient, string, string, string, TimeProvider?)
Calls LiveKit's room service over Twirp with JSON, authorized by a short access token signed with the API secret.
Declaration
public LiveKitRoomService(HttpClient http, string url, string apiKey, string apiSecret, TimeProvider? time = null)
Parameters
| Type | Name | Description |
|---|---|---|
| HttpClient | http | The client of the requests. |
| string | url | LiveKit's URL, |
| string | apiKey | The API key. |
| string | apiSecret | The API secret. |
| TimeProvider | time | Clock of the tokens. |
Methods
| Edit this page View SourceCreateRoomAsync(string, TimeSpan, TimeSpan, int, CancellationToken)
Create room name, or keep it as it is when it exists.
Declaration
public Task CreateRoomAsync(string name, TimeSpan emptyTimeout, TimeSpan departureTimeout, int maxParticipants = 0, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The room name. |
| TimeSpan | emptyTimeout | How long the room waits for its first participant. |
| TimeSpan | departureTimeout | How long the room stays after the last participant leaves. |
| int | maxParticipants | Most participants, 0 for no limit. |
| CancellationToken | cancellationToken | Cancels the request. |
Returns
| Type | Description |
|---|---|
| Task |
HasParticipantAsync(string, string, CancellationToken)
Return whether participant identity is in room name now; false when either is not there.
Declaration
public Task<bool> HasParticipantAsync(string name, string identity, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | |
| string | identity | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<bool> |
HttpUrl(string)
Return LiveKit's HTTP base URL for url: ws as http, wss as https, without a trailing slash.
Declaration
public static string HttpUrl(string url)
Parameters
| Type | Name | Description |
|---|---|---|
| string | url |
Returns
| Type | Description |
|---|---|
| string |