Skip to main content

Class: PlayRecorder

PlayRecorder API is a part of the Player SDK used for recording how long certain asset was shown. Use global enplug.playRecorder object to access these methods.

This API can be used to record how long a particular screen was shown on a display. An example would be recording how long an advertisement was displayed on screen to properly pay the screen provider.

Methods#

report#

report<T>(assetId, referenceId, playDuration, additionalInfo?): Promise<T>

This function can be used to record the time that an item was displayed.

Type parameters#

Name
T

Parameters#

NameTypeDefault valueDescription
assetIdstringundefined-
referenceIdanyundefinedUnique identifier to track which asset we are recording a play time for.
playDurationnumberundefinedTime in seconds that represents how long this item was displayed.
additionalInfostring''Optional string of extra information to be saved with the recorded value.

Returns#

Promise<T>

Resolves after successfully informing the Player about the report.