targetLatency

abstract var targetLatency: Double

The offset in seconds between the target playhead time and the real time, or window edge, if the offset to current real time is not known.

Returns -1 if the source is not a live stream.

When playing at the live edge (timeShift == 0), the player will try to bring the latency as close as possible to the targetLatency while avoiding stalls. Has no effect if the player is not playing at the live edge (when timeshift != 0).

This is a source specific API:

  • when a source starts, the value is reset to SourceLiveConfig.targetLatency if set and the media-defined target otherwise.

  • Setting a value only affects the current source.

Setting the target latency when there is no active playback session has no effect.