MediaPlaybackTimeInfo
Information about a media timeline, such as duration, playing position, and playback speed.
Parameters
Total length of a media item. null
if unavailable or infinite, otherwise a positive Duration.
The playback position in the media item. null
if unavailable, otherwise a zero or positive Duration.
The speed of playback as a multiple of normal playback. INVALID_PLAYBACK_SPEED when playback is not active (paused, buffering, or idle). When negative, playback is in reverse.
Elapsed real time since boot of the moment when position was last updated. Comparison with this value can be done by converting it to milliseconds and by using getElapsedTime.
Functions
Returns duration if it has a valid duration (see hasDuration), otherwise returns Duration.ZERO.
Returns true
if a duration is not null
and is greater than 0
.
Returns true
if a position is not null
and is equal or greater than 0
.
Returns whether playback is active by looking at the playback speed of a MediaPlaybackTimeInfo.
Returns position if it has a valid position (see hasPosition), otherwise returns Duration.ZERO.