Mux v3.2.1 Mux.Data.VideoViews View Source

This module provides functions for interacting with individual video views. Note, the raw video views contain quite a lot of data, so the list endpoint includes a filtered set of keys for each view. API Documentation.

Link to this section Summary

Functions

Returns the details for a single video view.

Returns a paginated list of video views that occurred within the specified timeframe. Results are ordered by view_end, according to what you provide for order_direction.

Link to this section Functions

Returns the details for a single video view.

Returns {:ok, view, raw_env}.

Examples

iex> client = Mux.client("my_token_id", "my_token_secret")
iex> {:ok, view, _env} = Mux.Data.VideoViews.get(client, "k8n4aklUyrRDekILDWta1qSJqNFpYB7N50")
iex> view["id"] === "k8n4aklUyrRDekILDWta1qSJqNFpYB7N50"
true
Link to this function

list(client, params \\ [])

View Source

Returns a paginated list of video views that occurred within the specified timeframe. Results are ordered by view_end, according to what you provide for order_direction.

Returns {:ok, views, raw_env}.

Examples

iex> client = Mux.client("my_token_id", "my_token_secret")
iex> {:ok, views, _env} = Mux.Data.VideoViews.list(client)
iex> views
[%{"country_code" => nil, "error_type_id" => 1087, "id" => "DEM1z65UMx6Ldcgq9tDR9tkJNTqlE5eNlN4", "player_error_code" => nil, "player_error_message" => nil, "total_row_count" => 2, "video_title" => nil, "view_end" => "2018-01-19T02 =>18 =>41.940Z", "view_start" => "2018-01-19T02 =>18 =>41.940Z", "viewer_application_name" => "Chrome", "viewer_os_family" => nil}, %{"country_code" => nil, "error_type_id" => 1088, "id" => "k8n4aklUyrRDekILDWta1qSJqNFpYB7N50", "player_error_code" => nil, "player_error_message" => nil, "total_row_count" => 2, "video_title" => nil, "view_end" => "2018-01-19T02 =>18 =>41.940Z", "view_start" => "2018-01-19T02 =>18 =>41.940Z", "viewer_application_name" => "Chrome", "viewer_os_family" => nil}]

iex> client = Mux.client("my_token_id", "my_token_secret")
iex> {:ok, views, _env} = Mux.Data.VideoViews.list(client, filters: ["browser:Chrome"], order_direction: "desc", page: 2)
iex> views
[%{"country_code" => nil, "error_type_id" => 1087, "id" => "DEM1z65UMx6Ldcgq9tDR9tkJNTqlE5eNlN4", "player_error_code" => nil, "player_error_message" => nil, "total_row_count" => 2, "video_title" => nil, "view_end" => "2018-01-19T02 =>18 =>41.940Z", "view_start" => "2018-01-19T02 =>18 =>41.940Z", "viewer_application_name" => "Chrome", "viewer_os_family" => nil}, %{"country_code" => nil, "error_type_id" => 1088, "id" => "k8n4aklUyrRDekILDWta1qSJqNFpYB7N50", "player_error_code" => nil, "player_error_message" => nil, "total_row_count" => 2, "video_title" => nil, "view_end" => "2018-01-19T02 =>18 =>41.940Z", "view_start" => "2018-01-19T02 =>18 =>41.940Z", "viewer_application_name" => "Chrome", "viewer_os_family" => nil}]