accountLink.mediaEvent()

    accountLink.mediaEvent()


    Article summary

    Indidicates that the user has started or finished playing a specific content asset.

    Signature:

    $badger.accountLink().mediaEvent({params});

    Parameters:

    paramenterdescriptiondata typerequired?
    contentIdA 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.stringyes
    completedTrue 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.booleanyes
    progressThe progress the subscriber has made playing the asset, in progressUnits units.numberno
    progressUnitsThe units that the progress field uses. This field is required if progress is provided. Value: seconds or percentstringno, 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?