MuxWrapper.LiveStreams.list

You're seeing just the function list, go back to MuxWrapper.LiveStreams module for more information.
Link to this function

list(client, opt \\ %{})

View Source

Specs

list(
  %Tesla.Client{adapter: term(), fun: term(), post: term(), pre: term()},
  Enum.t()
) :: tuple()

Provide a function to list live streams by passing params in Mux, support pagnation see Mux doc

## Parameters

  • client: provide by client/0
  • opt: pagnation query params, can pass a Map like this %{limit: 10, page: 3}. If don't pass, the default value from Mux is limit: 25 and page: 1

## Example

 iex> client = MuxWrapper.client()
 %Tesla.Client{
  adapter: nil,
  fun: nil,
  post: [],
  pre: [
    {Tesla.Middleware.BaseUrl, :call, ["https://api.mux.com"]},
    {Tesla.Middleware.BasicAuth, :call,
     [
       %{
         password: "your_password",
         username: "your_username"
       }
     ]}
  ]
 } 

 iex> MuxWrapper.LiveStreams.list(client, %{limit: 1, page: 1})
 {:ok, 
   [
    %MuxWrapper.EmbeddedSchema.LiveStream{
      created_at: ~N[2021-03-17 16:49:36],
      id: "ABYT7nZXRKXLz02rMeWo00bhzLgw34sby6ZcZWR7vboFI",
      new_asset_settings: %{"playback_policies" => ["public"]},
      playback_ids: [
        %MuxWrapper.EmbeddedSchema.Playback{
          id: "NbUxpgpd02V00g02JNScdJwCxB9LUzPlvUmcnGHadG1V700",
          policy: "public"
        },
        %MuxWrapper.EmbeddedSchema.Playback{
          id: "Lg2lOeX9dmuzGOZBRVPYhcng9008MPUcCxwWA8002brlw",
          policy: "signed"
        },
        %MuxWrapper.EmbeddedSchema.Playback{
          id: "cnIcHj02pOmG01aTAE7t2B5iDWjWgQgLUbz8YHkJElBcs",
          policy: "public"
        }
      ],
      reconnect_window: 60,
      status: "idle",
      stream_key: "stream_key_very_long"
    }
   ] 
 }