Mux v3.1.0 Mux.Video.Spaces View Source

This module provides functions for managing Spaces in Mux Video. API Documentation

Link to this section Summary

Link to this section Functions

Create a new space.

Returns {:ok, space, %Tesla.Client{}}.

Examples

iex> client = Mux.Base.new("my_token_id", "my_token_secret")
iex> {:ok, space, _env} = Mux.Video.Spaces.create(client, %{type: "server", passthrough: "example", broadcasts: [%{passthrough: "example", live_stream_id: "vJvFbCojkuSDAAeEK4EddOA01wRqN1mP4", layout: "gallery", background: "https://example.com/background.jpg", resolution: "1920x1080"}]})
iex> space
%{"broadcasts" => [%{"background" => "https://example.com/background.jpg", "id" => "fZw6qjWmKLmjfi0200NBzsgGrXZImT3KiJ", "layout" => "gallery", "live_stream_id" => "vJvFbCojkuSDAAeEK4EddOA01wRqN1mP4", "resolution" => "1920x1080", "status" => "idle"}], "created_at" => "1653342466", "id" => "xe00FkgJMdZrYQ001VC53bd01lf9ADs6YWk", "passthrough" => "example", "status" => "idle", "type" => "server"}
Link to this function

create_space_broadcast(client, space_id, params)

View Source

Create a new space broadcast.

Returns a tuple such as {:ok, broadcast, %Tesla.Env{}}

Examples

iex> client = Mux.Base.new("my_token_id", "my_token_secret")
iex> {:ok, broadcast, _env} = Mux.Video.Spaces.create_space_broadcast(client, "xe00FkgJMdZrYQ001VC53bd01lf9ADs6YWk", %{passthrough: "example", live_stream_id: "vJvFbCojkuSDAAeEK4EddOA01wRqN1mP4", layout: "gallery", background: "https://example.com/background.jpg", resolution: "1920x1080"})
iex> broadcast
%{"background" => "https://example.com/background.jpg", "id" => "fZw6qjWmKLmjfi0200NBzsgGrXZImT3KiJ", "layout" => "gallery", "live_stream_id" => "vJvFbCojkuSDAAeEK4EddOA01wRqN1mP4", "resolution" => "1920x1080", "status" => "idle"}
Link to this function

delete(client, space_id, params \\ [])

View Source

Delete a space.

Returns a tuple such as {:ok, "", %Telsa.Env{}}

Examples

iex> client = Mux.Base.new("my_token_id", "my_token_secret")
iex> {status, "", _env} = Mux.Video.Spaces.delete(client, "xe00FkgJMdZrYQ001VC53bd01lf9ADs6YWk")
iex> status
:ok
Link to this function

delete_space_broadcast(client, space_id, broadcast_id, params \\ [])

View Source

Delete a space broadcast.

Returns a tuple such as {:ok, "", %Tesla.Env{}}

Examples

iex> client = Mux.Base.new("my_token_id", "my_token_secret")
iex> {status, "", _env} = Mux.Video.Spaces.delete_space_broadcast(client, "xe00FkgJMdZrYQ001VC53bd01lf9ADs6YWk", "fZw6qjWmKLmjfi0200NBzsgGrXZImT3KiJ")
iex> status
:ok
Link to this function

get(client, space_id, params \\ [])

View Source

Retrieve a space by ID.

Returns a tuple such as {:ok, space, %Telsa.Env{}}

Examples

iex> client = Mux.Base.new("my_token_id", "my_token_secret")
iex> {:ok, space, _env} = Mux.Video.Spaces.get(client, "xe00FkgJMdZrYQ001VC53bd01lf9ADs6YWk")
iex> space
%{"broadcasts" => [%{"background" => "https://example.com/background.jpg", "id" => "fZw6qjWmKLmjfi0200NBzsgGrXZImT3KiJ", "layout" => "gallery", "live_stream_id" => "vJvFbCojkuSDAAeEK4EddOA01wRqN1mP4", "resolution" => "1920x1080", "status" => "idle"}], "created_at" => "1653342466", "id" => "xe00FkgJMdZrYQ001VC53bd01lf9ADs6YWk", "passthrough" => "example", "status" => "idle", "type" => "server"}
Link to this function

get_space_broadcast(client, space_id, broadcast_id, params \\ [])

View Source

Retrieve a space broadcast.

Returns a tuple such as {:ok, broadcast, %Tesla.Env{}}

Examples

iex> client = Mux.Base.new("my_token_id", "my_token_secret")
iex> {:ok, broadcast, _env} = Mux.Video.Spaces.get_space_broadcast(client, "xe00FkgJMdZrYQ001VC53bd01lf9ADs6YWk", "fZw6qjWmKLmjfi0200NBzsgGrXZImT3KiJ")
iex> broadcast
%{"background" => "https://example.com/background.jpg", "id" => "fZw6qjWmKLmjfi0200NBzsgGrXZImT3KiJ", "layout" => "gallery", "live_stream_id" => "vJvFbCojkuSDAAeEK4EddOA01wRqN1mP4", "resolution" => "1920x1080", "status" => "idle"}
Link to this function

list(client, params \\ [])

View Source

List spaces.

Returns a tuple such as {:ok, spaces, %Telsa.Env{}}

Examples

iex> client = Mux.Base.new("my_token_id", "my_token_secret")
iex> {:ok, spaces, _env} = Mux.Video.Spaces.list(client)
iex> spaces
[%{"broadcasts" => [%{"background" => "https://example.com/background.jpg", "id" => "fZw6qjWmKLmjfi0200NBzsgGrXZImT3KiJ", "layout" => "gallery", "live_stream_id" => "vJvFbCojkuSDAAeEK4EddOA01wRqN1mP4", "resolution" => "1920x1080", "status" => "idle"}], "created_at" => "1653342466", "id" => "xe00FkgJMdZrYQ001VC53bd01lf9ADs6YWk", "passthrough" => "example", "status" => "idle", "type" => "server"}, %{"broadcasts" => [%{"background" => "https://example.com/background.jpg", "id" => "fZw6qjWmKLmjfi0200NBzsgGrXZImT3KiJ", "layout" => "gallery", "live_stream_id" => "vJvFbCojkuSDAAeEK4EddOA01wRqN1mP4", "resolution" => "1920x1080", "status" => "idle"}], "created_at" => "1653342466", "id" => "xe00FkgJMdZrYQ001VC53bd01lf9ADs6YWk", "passthrough" => "example", "status" => "idle", "type" => "server"}]
Link to this function

start_space_broadcast(client, space_id, broadcast_id)

View Source

Start a space broadcast.

Returns a tuple such as {:ok, %{}, %Tesla.Env{}}

Examples

iex> client = Mux.Base.new("my_token_id", "my_token_secret")
iex> {status, %{}, _env} = Mux.Video.Spaces.start_space_broadcast(client, "xe00FkgJMdZrYQ001VC53bd01lf9ADs6YWk", "fZw6qjWmKLmjfi0200NBzsgGrXZImT3KiJ")
iex> status
:ok
Link to this function

stop_space_broadcast(client, space_id, broadcast_id)

View Source

Stop a space broadcast.

Returns a tuple such as {:ok, %{}, %Tesla.Env{}}

Examples

iex> client = Mux.Base.new("my_token_id", "my_token_secret")
iex> {status, %{}, _env} = Mux.Video.Spaces.stop_space_broadcast(client, "xe00FkgJMdZrYQ001VC53bd01lf9ADs6YWk", "fZw6qjWmKLmjfi0200NBzsgGrXZImT3KiJ")
iex> status
:ok