LiveKit.IngressService (LiveKit v0.1.0)

Copy Markdown View Source

LiveKit Ingress API — create and manage RTMP, WHIP, and URL ingress endpoints.

Every function is a thin wrapper around LiveKit.Twirp.call/6. It builds the protobuf request from keyword options, signs a short-lived service token with ingressAdmin permission, and returns {:ok, response} | {:error, %LiveKit.Error{}}.

iex> client = LiveKit.Client.new!(url: "http://localhost:7880", api_key: "k", api_secret: "s")
iex> {:error, error} = LiveKit.IngressService.delete_ingress(client, [])
iex> error.type
:validation

Summary

Functions

Creates an ingress endpoint. Requires :input_type (:RTMP_INPUT, :WHIP_INPUT, or :URL_INPUT).

Deletes an ingress. Requires :ingress_id.

Lists ingress endpoints. Optional filters: :room_name, :ingress_id.

Updates an ingress. Requires :ingress_id.

Functions

create_ingress(client, opts \\ [])

@spec create_ingress(
  LiveKit.Client.t(),
  keyword()
) :: {:ok, LiveKit.Proto.IngressInfo.t()} | {:error, LiveKit.Error.t()}

Creates an ingress endpoint. Requires :input_type (:RTMP_INPUT, :WHIP_INPUT, or :URL_INPUT).

Optional: :name, :room_name, :participant_identity, :participant_name, :participant_metadata, :audio, :video, :bypass_transcoding, :enable_transcoding, :url, :enabled.

delete_ingress(client, opts \\ [])

@spec delete_ingress(
  LiveKit.Client.t(),
  keyword()
) :: {:ok, LiveKit.Proto.IngressInfo.t()} | {:error, LiveKit.Error.t()}

Deletes an ingress. Requires :ingress_id.

list_ingress(client, opts \\ [])

@spec list_ingress(
  LiveKit.Client.t(),
  keyword()
) :: {:ok, LiveKit.Proto.ListIngressResponse.t()} | {:error, LiveKit.Error.t()}

Lists ingress endpoints. Optional filters: :room_name, :ingress_id.

update_ingress(client, opts \\ [])

@spec update_ingress(
  LiveKit.Client.t(),
  keyword()
) :: {:ok, LiveKit.Proto.IngressInfo.t()} | {:error, LiveKit.Error.t()}

Updates an ingress. Requires :ingress_id.

Optional fields match create_ingress/2 (except :input_type and :url).