MuxWrapper.Assets.get_asset
You're seeing just the function
get_asset
, go back to MuxWrapper.Assets module for more information.
Specs
get_asset( %Tesla.Client{adapter: term(), fun: term(), post: term(), pre: term()}, String.t() ) :: tuple()
Provide get asset from Mux, suggest read Mux doc first
Parameters
- client - provid by
MuxWrapper.client/0
- asset_id - asset id
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.get_asset(client, "asset_id_very_long")
{:ok,
%MuxWrapper.EmbeddedSchema.Asset{
aspect_ratio: nil,
created_at: ~N[2021-03-19 14:09:04],
duration: nil,
id: "Aq02lD2TppLOibpXfrf5iHkwhTSuL666mYu02rfq7tHiA",
master_access: "none",
max_stored_frame_rate: nil,
max_stored_resolution: nil,
mp4_support: "none",
playback_ids: [],
status: "ready",
test: nil,
tracks: [
%MuxWrapper.EmbeddedSchema.Track{
duration: 60.095011,
id: "01I6Bo00WSBCcLhEM01FYV01NeBhcs00w7SdZytiddeYdP01E",
max_channel_layout: "stereo",
max_channels: 2,
max_frame_rate: nil,
max_height: nil,
max_width: nil,
type: "audio"
},
%MuxWrapper.EmbeddedSchema.Track{
duration: 60.095,
id: "9BnaSlTgXT01nzpPnevBzuFP8i64bcoBUcnz3pdSMG44",
max_channel_layout: nil,
max_channels: nil,
max_frame_rate: 23.962,
max_height: 360,
max_width: 640,
type: "video"
}
]
}
}