accessibilityStateText

fun accessibilityStateText(status: PlaybackStatus, position: Duration, duration: Duration?): String

What a screen reader should say about the player's state, as one sentence.

One pure function, in common code, because the three views must say the same thing and none of them is a good place to keep the wording: a viewer who switches between a phone and a tablet should not hear the video described two different ways.

The shape is state first, then position, because a screen reader user hears the beginning of a label most reliably and "Playing" is the part they asked for. Position is omitted rather than guessed when the media has no duration to measure against, which is what a live stream is.

Parameters

status

what the player is doing.

position

where playback is now.

duration

how long the media is, or null for a live or unmeasured source.