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.
Delete a 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"}
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
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"}
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"}]
update_referrer_domain_restriction(client, playback_restriction_id, params)
View SourceUpdates 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"}