accountLink.mediaEvent()
- Print
accountLink.mediaEvent()
- Print
Article summary
Did you find this summary helpful?
Thank you for your feedback
accountLink.mediaEvent()
Indidicates that the user has started or finished playing a specific content asset.
Signature:
$badger.accountLink().mediaEvent({params});
Parameters:
paramenter | description | data type | required? |
---|---|---|---|
contentId | A string indicating the identifier for the OTT content that was or is playing. This ID string should match the ID used in the metadata feed provided by the OTT content provider's backoffice. | string | yes |
completed | True if the user has finished playing the asset, false otherwise. Note that completed can be considered true if the subscriber reaches an effectively finished point in the asset; that is, if the OTT provider recognizes that the subscriber has reached the end credits but there are several minutes of credits remaining, completed can still be set to true even if the subscriber has not played 100% of the video content. | boolean | yes |
progress | The progress the subscriber has made playing the asset, in progressUnits units. | number | no |
progressUnits | The units that the progress field uses. This field is required if progress is provided. Value: seconds or percent | string | no, unless progress is provided |
Return Values:
None.
Usage Example:
// Example with only required parameters
$badger.accountLink().mediaEvent({
contentId:"12345678",
completed: false
});
// Example with optional progress parameter, using percent completed as progressUnits
$badger.accountLink().mediaEvent({
contentId: "12345678",
completed: true,
progress: 95,
progressUnits: "percent"
});
// Example with optional progress parameter, using seconds as progressUnits
$badger.accountLink().mediaEvent({
contentId: "12345678",
completed: true,
progress: 5400,
progressUnits: "seconds"
});
Mandatory integration:
If your app plays video assets, you must feed subscriber watch history/resume point data via the accountLink().mediaEvent method in order for their watch history personalization features to work correctly.
Was this article helpful?