Livekit.IngressServiceClient (Livekit v0.1.4)
View SourceClient for interacting with the LiveKit Ingress service.
The Ingress service enables bringing external streams into LiveKit rooms, including RTMP streams, WebRTC ingress, and file-based input sources.
Summary
Functions
Creates a new ingress endpoint.
Deletes an ingress endpoint.
Lists ingress endpoints.
Creates a new IngressServiceClient.
Updates an existing ingress endpoint.
Functions
Creates a new ingress endpoint.
Parameters
client- The client connection tuple returned fromnew/3request- ALivekit.CreateIngressRequeststruct
Returns
{:ok, ingress_info}- On success, returnsLivekit.IngressInfo{:error, reason}- On failure
Examples
request = %Livekit.CreateIngressRequest{
input_type: :RTMP_INPUT,
name: "my-stream",
room_name: "my-room",
participant_identity: "streamer"
}
{:ok, ingress} = Livekit.IngressServiceClient.create_ingress(client, request)
Deletes an ingress endpoint.
Parameters
client- The client connection tuple returned fromnew/3request- ALivekit.DeleteIngressRequeststruct
Returns
{:ok, ingress_info}- On success, returns the deletedLivekit.IngressInfo{:error, reason}- On failure
Examples
request = %Livekit.DeleteIngressRequest{ingress_id: "ingress_123"}
{:ok, ingress} = Livekit.IngressServiceClient.delete_ingress(client, request)
Lists ingress endpoints.
Parameters
client- The client connection tuple returned fromnew/3request- ALivekit.ListIngressRequeststruct (optional, defaults to empty request)
Returns
{:ok, list_response}- On success, returnsLivekit.ListIngressResponse{:error, reason}- On failure
Examples
# List all ingress endpoints
{:ok, response} = Livekit.IngressServiceClient.list_ingress(client)
# Filter by room name
request = %Livekit.ListIngressRequest{room_name: "my-room"}
{:ok, response} = Livekit.IngressServiceClient.list_ingress(client, request)
Creates a new IngressServiceClient.
Parameters
url- The LiveKit server URL (can be ws:// or wss://, will be converted to appropriate format)api_key- The API key for authenticationapi_secret- The API secret for authentication
Returns
{:ok, client}- On successful connection{:error, reason}- On connection failure
Examples
iex> {:ok, client} = Livekit.IngressServiceClient.new("wss://my-livekit.com", "api_key", "secret")
{:ok, {#PID<0.123.0>, %{}}}
Updates an existing ingress endpoint.
Note: Ingress can only be updated when it's in ENDPOINT_INACTIVE state.
Parameters
client- The client connection tuple returned fromnew/3request- ALivekit.UpdateIngressRequeststruct
Returns
{:ok, ingress_info}- On success, returns updatedLivekit.IngressInfo{:error, reason}- On failure