currentTime

abstract val currentTime: Double

The current playback time of the active source or ad in seconds.

In case of VoD sources this is a value between 0 and Source.duration. In case of live DASH and Smooth Streaming sources the value is an absolute (unix) timestamp, whereas for live HLS sources the value is a relative timestamp.

Relative timestamps use the absolute timestamp of the first segment of the initially downloaded HLS playlist as a reference. To always get an absolute timestamp, playbackTimeOffsetToAbsoluteTime can be added to currentTime or any other playback time provided by the player (e.g. timestamps in events). Conversely, to always get a relative timestamp, playbackTimeOffsetToRelativeTime can be added instead. These conversions only apply for playback times directly provided by the player. Converting playback times to relative timestamps and then back to absolute ones using the same method will not work.

Returns 0.0 if there is no active playback session.