totalDurationMs

abstract val totalDurationMs: Int

The total duration of the timeline in milliseconds. It has the same value as AudioTimeline.approximateDurationMs of audioTimeline.

While the length of any segment with audio is unknown, this is the sum of the known lengths. approximateElapsedTimeMs can then exceed it. A segment has audio when its SyncMediaSegmentData.refs contain a SyncMediaAudioRef. Its length is unknown while its SyncMediaSegmentData.durationType in AudioTimeline.segments is SyncMediaSegmentDurationType.UNKNOWN. While such a segment exists, a progress bar can show indeterminate progress or clamp the elapsed time.

The value changes when a length is measured or corrected. The segment lengths section of AudioTimeline says when that happens and which changes OnMediaPlayerEventListener.onSegmentDurationChanged reports.