open

suspend fun open(media: MediaItem)

Opens media and returns once the first frame is on screen and the player is paused on it.

Legal from Idle, Ended and Failed. From anything else it throws: replacing what is playing needs an explicit stop first, so that a caller cannot half replace a session by accident. Cancelling this call leaves the player Idle rather than half open.

Throws

when the media cannot be reached, is not media, holds nothing this build can decode, or no audio device could be opened for a file with no video to fall back on.