MuxWrapper.Assets.create_asset
You're seeing just the function
create_asset
, go back to MuxWrapper.Assets module for more information.
Specs
create_asset( %Tesla.Client{adapter: term(), fun: term(), post: term(), pre: term()}, Enum.t() ) :: %MuxWrapper.EmbeddedSchema.Asset{ aspect_ratio: term(), created_at: term(), duration: term(), id: term(), master_access: term(), max_stored_frame_rate: term(), max_stored_resolution: term(), mp4_support: term(), playback_ids: term(), status: term(), test: term(), tracks: term() }
Provide create asset to Mux, suggest read Mux doc first
Parameters
- client - provid by
MuxWrapper.client/0
- params - Map with 2 key
input
andplayback_policy
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.create_asset(client, %{input: "http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"})
%MuxWrapper.EmbeddedSchema.Asset{
created_at: ~N[2021-03-19 13:13:26],
id: "gbxJ8PYkJg9TOPhP0100gYIlZKqgCai4mBnummQu8YKUI",
master_access: "none",
mp4_support: "none",
playback_ids: [],
status: "preparing"
}