MuxWrapper.Playbacks (Mux Wrapper v0.1.3) View Source
Provides a wrapper of playback ids to manipulate Mux API
Link to this section Summary
Functions
Create a signed
new playback ID by asset id. to Mux, suggest read Mux doc first
Create a public
new playback ID by asset id. to Mux, suggest read Mux doc first
Delete a playback by asset id and playback id. to Mux, suggest read Mux doc first
Get a playback by asset id and playback id. to Mux, suggest read Mux doc first
Link to this section Functions
Specs
create_private_playback_id( %Tesla.Client{adapter: term(), fun: term(), post: term(), pre: term()}, String.t() ) :: tuple()
Create a signed
new playback ID by asset id. to 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.Playbacks.create_private_playback_id(client, "CO2pRYhPHeLzmv5MnmuRLmUSEYy4TvHj6gKcoU2kM7A")
{:ok,
%MuxWrapper.EmbeddedSchema.Playback{
id: "yP29YfRnmqr6Ft47nd9FscOTq5Eo63UWB74TJSeo9Es",
policy: "signed"
}
}
Specs
create_public_playback_id( %Tesla.Client{adapter: term(), fun: term(), post: term(), pre: term()}, String.t() ) :: tuple()
Create a public
new playback ID by asset id. to 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.Playbacks.create_public_playback_id(client, "CO2pRYhPHeLzmv5MnmuRLmUSEYy4TvHj6gKcoU2kM7A")
{:ok,
%MuxWrapper.EmbeddedSchema.Playback{
id: "UdNWaprxjIA01BUYYDJpaCiDZQu22Ep6tAJLOLA8Sk7A",
policy: "public"
}
}
Specs
delete( %Tesla.Client{adapter: term(), fun: term(), post: term(), pre: term()}, String.t(), String.t() ) :: tuple()
Delete a playback by asset id and playback id. to Mux, suggest read Mux doc first
Parameters
- client - provid by
MuxWrapper.client/0
- asset_id - asset id
- playback_id - playback 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.Playbacks.delete(client, "CO2pRYhPHeLzmv5MnmuRLmUSEYy4TvHj6gKcoU2kM7A", "UdNWaprxjIA01BUYYDJpaCiDZQu22Ep6tAJLOLA8Sk7A")
{:ok}
iex> MuxWrapper.Playbacks.delete(client, "CO2pRYhPHeLzmv5MnmuRLmUSEYy4TvHj6gKcoU2kM7A", "UdNWaprxjIA01BUYYDJpaCiDZQu22Ep6tAJLOLA8Sk7A")
03:09:29.925 [error] Mux pass in msg: "not_found: Playback ID not found"
{:error}
Specs
get( %Tesla.Client{adapter: term(), fun: term(), post: term(), pre: term()}, String.t(), String.t() ) :: tuple()
Get a playback by asset id and playback id. to Mux, suggest read Mux doc first
Parameters
- client - provid by
MuxWrapper.client/0
- asset_id - asset id
- playback_id - playback 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.Playbacks.get(client, "CO2pRYhPHeLzmv5MnmuRLmUSEYy4TvHj6gKcoU2kM7A", "CO2pRYhPHeLzmv5MnmuRLmUSEYy4TvHj6gKcoU2kM7A")
03:23:06.784 [error] Mux pass in msg: "invalid_parameters: Invalid playback id, mismatching environment"
{:error}
iex> MuxWrapper.Playbacks.get(client, "CO2pRYhPHeLzmv5MnmuRLmUSEYy4TvHj6gKcoU2kM7A", "yP29YfRnmqr6Ft47nd9FscOTq5Eo63UWB74TJSeo9Es")
{:ok,
%MuxWrapper.EmbeddedSchema.Playback{
id: "yP29YfRnmqr6Ft47nd9FscOTq5Eo63UWB74TJSeo9Es",
policy: "signed"
}}