VideoViews
Extends:
events~EventEmitter → src/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'});
Method Summary
Public Methods | ||
public |
Returns the details for a single video view |
|
public |
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:
Name | Type | Attribute | Description |
videoViewId | string | The ID for the video view |
Example:
const muxClient = new Mux(accessToken, secret);
const { Data } = muxClient;
//Returns the details for a single video view
Data.VideoViews.get('ABCD1234');
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:
Name | Type | Attribute | Description |
queryParams | Object | example { viewer_id: 'ABCD1234', timeframe: ['7:days'], filters: ['operating_system:windows'] } |
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' });