Reference Source Test
public class | source

VideoViews

Extends:

events~EventEmittersrc/base.js~Base → VideoViews

VideoViews Class - Provides access to the Mux Data Video Views API

Example:

const muxClient = new Mux(accessToken, secret);
const { Data } = muxClient;

// Returns a list of video views for a property that occurred within the specified timeframe.
// Results are ordered by view_end, according to what you provide for order_direction.
Data.VideoViews.list({order_direction: 'asc'});

Test:

Method Summary

Public Methods
public

get(videoViewId: string): Promise

Returns the details for a single video view

public

list(queryParams: Object): Promise

Returns a list of video views for a property that occurred within the specified timeframe.

Public Methods

public get(videoViewId: string): Promise source

Returns the details for a single video view

Params:

NameTypeAttributeDescription
videoViewId string

The ID for the video view

Return:

Promise

Returns a resolved Promise with a response from the Mux API

Example:

const muxClient = new Mux(accessToken, secret);
const { Data } = muxClient;

//Returns the details for a single video view
Data.VideoViews.get('ABCD1234');

See:

public list(queryParams: Object): Promise source

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

Params:

NameTypeAttributeDescription
queryParams Object

example { viewer_id: 'ABCD1234', timeframe: ['7:days'], filters: ['operating_system:windows'] }

Return:

Promise

Returns a resolved Promise with a response from the Mux API

Example:

const muxClient = new Mux(accessToken, secret);
const { Data } = muxClient;

// Returns a list of video views for a property that occurred within the specified timeframe.
Data.VideoViews.list({ viewer_id: 'ABCD1234', timeframe: ['7:days'], order_direction: 'asc' });

See: