Mux v3.2.1 Mux.Video.PlaybackRestrictions View Source

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

Link to this section Summary

Functions

Create a new playback restriction.

Retrieve a playback restriction by ID.

List playback restrictions.

Updates the referrer domain restriction for a playback restriction

Link to this section Functions

Create a new playback restriction.

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

Examples

iex> client = Mux.Base.new("my_token_id", "my_token_secret")
iex> {:ok, playback_restriction, _env} = Mux.Video.PlaybackRestrictions.create(client, %{referrer: %{allowed_domains: ["*.example.com"], allow_no_referrer: true}})
iex> playback_restriction
%{"created_at" => "1653174155", "id" => "uP6cf00TE5HUvfdEmI6PR01vXQgZEjydC3", "referrer" => %{"allow_no_referrer" => true, "allowed_domains" => ["*.example.com"]}, "updated_at" => "1653174155"}
Link to this function

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

View Source

Delete a playback restriction.

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.PlaybackRestrictions.delete(client, "uP6cf00TE5HUvfdEmI6PR01vXQgZEjydC3")
iex> status
:ok
Link to this function

get(client, playback_restriction_id, options \\ [])

View Source

Retrieve a playback restriction by ID.

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

Examples

iex> client = Mux.Base.new("my_token_id", "my_token_secret")
iex> {:ok, playback_restriction, _env} = Mux.Video.PlaybackRestrictions.get(client, "uP6cf00TE5HUvfdEmI6PR01vXQgZEjydC3")
iex> playback_restriction
%{"created_at" => "1653174155", "id" => "uP6cf00TE5HUvfdEmI6PR01vXQgZEjydC3", "referrer" => %{"allow_no_referrer" => true, "allowed_domains" => ["*.example.com"]}, "updated_at" => "1653174155"}
Link to this function

list(client, params \\ [])

View Source

List playback restrictions.

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

Examples

iex> client = Mux.Base.new("my_token_id", "my_token_secret")
iex> {:ok, playback_restrictions, _env} = Mux.Video.PlaybackRestrictions.list(client)
iex> playback_restrictions
[%{"created_at" => "1653174155", "id" => "uP6cf00TE5HUvfdEmI6PR01vXQgZEjydC3", "referrer" => %{"allow_no_referrer" => true, "allowed_domains" => ["*.example.com"]}, "updated_at" => "1653174155"}, %{"created_at" => "1653174155", "id" => "uP6cf00TE5HUvfdEmI6PR01vXQgZEjydC3", "referrer" => %{"allow_no_referrer" => true, "allowed_domains" => ["*.example.com"]}, "updated_at" => "1653174155"}]
Link to this function

update_referrer_domain_restriction(client, playback_restriction_id, params)

View Source

Updates the referrer domain restriction for a playback restriction

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

Examples

iex> client = Mux.Base.new("my_token_id", "my_token_secret")
iex> {:ok, playback_restriction, _env} = Mux.Video.PlaybackRestrictions.update_referrer_domain_restriction(client, "uP6cf00TE5HUvfdEmI6PR01vXQgZEjydC3", %{allowed_domains: ["*.example.com"], allow_no_referrer: true})
iex> playback_restriction
%{"created_at" => "1653174155", "id" => "uP6cf00TE5HUvfdEmI6PR01vXQgZEjydC3", "referrer" => %{"allow_no_referrer" => true, "allowed_domains" => ["*.example.com"]}, "updated_at" => "1653174155"}