onEvent

abstract fun onEvent(payload: ByteArray, elapsedTime: Duration?, event: AdEventType, macroContext: MacroContext?): ByteArray

Fires the tracking URLs associated with the given event (e.g. pause, resume, mute, click).

Return

an updated payload reflecting the tracking state after the call.

Parameters

payload

serialized ad payload.

elapsedTime

time elapsed since the ad started playing, or null if not applicable.

event

the AdEventType that occurred.

macroContext

optional context used to expand tracking-URL macros.

Throws


abstract fun onEvent(payload: ByteArray, elapsedTime: Duration?, event: AdEventType, macroContext: MacroContext?): ByteArray

Java-friendly overload of onEvent accepting a java.time.Duration.

See also