MuxWrapper.Assets.list_assets

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

list_assets(client, opt \\ %{})

View Source

Specs

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

Provide list assets from Mux, suggest read Mux doc first

Parameters

  • client - provid by MuxWrapper.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

Examples

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.Assets.list_assets(client, %{limit: 1, page: 1})
[
  %MuxWrapper.EmbeddedSchema.Asset{
    aspect_ratio: "16:9",
    created_at: ~N[2021-03-19 14:37:50],
    duration: 10,
    id: "doS01p7VusXkwqfhe18LDttqIXV4xqXvd53K8ORee501k",
    master_access: "none",
    max_stored_frame_rate: 23.962,
    max_stored_resolution: "SD",
    mp4_support: "none",
    playback_ids: [],
    status: "ready",
    test: true,
    tracks: [
      %MuxWrapper.EmbeddedSchema.Track{
        channels: nil,
        duration: 60.095011,
        encoding: nil,
        frame_rate: nil,
        height: nil,
        id: "J00OusXFvcz9UJo93Vd5bFs1EsXX9cd1HqLs6lPWrRSA",
        max_channel_layout: "stereo",
        max_channels: 2,
        max_frame_rate: nil,
        max_height: nil,
        max_width: nil,
        sample_rate: nil,
        type: "audio",
        width: nil
      },
      %MuxWrapper.EmbeddedSchema.Track{
        channels: nil,
        duration: 60.095,
        encoding: nil,
        frame_rate: nil,
        height: nil,
        id: "2xI4b59vNk02DZ01EmtGk2bOYSb1vY4lmtmb6luBW500Tw",
        max_channel_layout: nil,
        max_channels: nil,
        max_frame_rate: 23.962,
        max_height: 360,
        max_width: 640,
        sample_rate: nil,
        type: "video",
        width: nil
      }
    ]
  }
]