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);
- Table of Contents
- Init Options
- Properties
- versionpro
- Methods
- Events
Init Options
options : object
Initialization options for the interactions plugin.
options.trackAnalytics : boolean
Should track an interaction analytics report when calling report
Default: true
Example
// playerOptions.json
{
"plugins": {
"interactions": {
"trackAnalytics": false
}
}
}
Properties
player.interactions.version : string
The interactions plugin’s version string.
Example
console.log('The interactions plugin version is', player.interactions.version);
Methods
player.interactions.report([id], [data], [options])
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”
Triggered when a user interaction has been reported.
See: report
Example
player.on('interactions.report', function(id, data) {
console.log('interaction occurred!', id, data);
});