interactions

The interactions plugin allows you to report and listen on user interactions.

Example

player.on('interactions.report', function(id, data) {
    console.log('interaction occurred!', id, data);
});

var interactionData = { something: 'something' }
player.interactions.report('myInteractionId', interactionData);

Init Options

options : object

Initialization options for the interactions plugin.

options.trackAnalytics : boolean
property

Should track an interaction analytics report when calling report

Default: true
Example

// playerOptions.json
{
    "plugins": {
        "interactions": {
            "trackAnalytics": false
        }
    }
}

Properties

player.interactions.version : string
propertyreadonly

The interactions plugin’s version string.

Example

console.log('The interactions plugin version is', player.interactions.version);

Methods

player.interactions.report([id], [data], [options])
method

Manually report a user interaction.
Triggers the interactions.report event.
If trackAnalytics is set to true (default) it will also send an interaction analytics report.

Param Type Description
[id] string Optional. An id for the interaction, will be sent as an argument in the interactions.report event.
[data] object Optional. Additional data for the interaction, will be sent as an argument in the interactions.report event.
[options] object Optional. An options object.
[options.trackAnalytics] boolean If specified, it will override the trackAnalytics value for that call.
[options.analyticsData] object Additional data that will be added to the analytics report.

Example

var interactionData = { something: 'something' }
player.interactions.report('myInteractionId', interactionData);

Events

“interactions.report”
event

Triggered when a user interaction has been reported.

See: report
Example

player.on('interactions.report', function(id, data) {
    console.log('interaction occurred!', id, data);
});
Rate this page: X
Tell us more!