onPlayerTimecodeUpdated
Notifies the SDK that the current play-head time-code was updated to a new value.
Overview
Call this method to inform the SDK of the current playback position in your video player. The SDK uses this information to synchronize features like Key Plays, stats, and other time-based content with the video playback.
Method Signature
fun onPlayerTimecodeUpdated(absoluteTimeMillis: Long?)
Parameters
| Parameter | Type | Description |
|---|---|---|
absoluteTimeMillis | Long? | Current playback position in milliseconds, or null if not available |
Return Value
This method does not return a value.
Example
// Update SDK with current playback position
fun onVideoPlaybackProgress(currentTimeMs: Long) {
sdk.onPlayerTimecodeUpdated(currentTimeMs)
}
// In a video player callback
videoPlayer.setOnProgressListener { position ->
sdk.onPlayerTimecodeUpdated(position.inWholeMilliseconds)
}
// When playback is paused or stopped
fun onPlaybackStopped() {
sdk.onPlayerTimecodeUpdated(null)
}
Notes
- Call this method regularly during video playback (e.g., every 100-500ms)
- The time should be in milliseconds from the start of the content
- Pass
nullwhen playback is stopped or position is unknown - For live streams, use the absolute time position, not relative time
- This helps the SDK display time-synchronized content like Key Plays markers
Related Methods
- onEventDataUpdated() - Update event information