Mux v3.1.0 Mux.Video.Tracks View Source

This module provides functions around managing tracks in Mux Video. Tracks are used for subtitles/captions. API Documentation.

Link to this section Summary

Link to this section Functions

Link to this function

create(client, asset_id, params)

View Source

Create a new asset track. API Documentation

Returns {:ok, track, raw_env}.

Examples

iex> client = Mux.Base.new("my_token_id", "my_token_secret")
iex> {:ok, track, _env} = Mux.Video.Tracks.create(client, "00ecNLnqiG8v00TLqqeZ00uCE5wCAaO3kKc", %{url: "https://example.com/myVideo_en.srt", type: "text", text_type: "subtitles", language_code: "en" })
iex> track
%{"id" => "2", "language_code" => "en", "name" => "English", "passthrough" => "English", "status" => "preparing", "text_type" => "subtitles", "type" => "text"}
Link to this function

delete(client, asset_id, track_id)

View Source

Delete an asset track. API Documentation

Returns {:ok, "", raw_env}.

Examples

iex> client = Mux.Base.new("my_token_id", "my_token_secret")
iex> {status, "", _env} = Mux.Video.Tracks.delete(client, "00ecNLnqiG8v00TLqqeZ00uCE5wCAaO3kKc", "FRDDXsjcNgD013rx1M4CDunZ86xkq8A02hfF3b6XAa7iE")
iex> status
:ok