Package-level declarations

Types

Link copied to clipboard

A door could not open or read its bytes. The message names the file and the reason.

Functions

Link copied to clipboard

Plays a file from the app's assets directory. The asset must be stored uncompressed, because a compressed asset has no descriptor and fails at open. The Android build stores common media extensions, such as mp4 and mkv, uncompressed already.

Link copied to clipboard
fun ERROR CLASS: Symbol not found for MediaIo.Companion.ofChannel(channel: FileChannel): ERROR CLASS: Symbol not found for MediaIoFactory

Plays from a channel you already have. Reads are positional, so the position of channel never moves, and no reader closes it. You own channel: keep it open while a reader from this factory is open, and close it yourself.

Link copied to clipboard
fun ERROR CLASS: Symbol not found for MediaIo.Companion.ofFile(file: File): ERROR CLASS: Symbol not found for MediaIoFactory

Plays file. Each open reads through its own channel, so two sessions never share a position.

Link copied to clipboard
fun ERROR CLASS: Symbol not found for MediaIo.Companion.ofPath(path: Path): ERROR CLASS: Symbol not found for MediaIoFactory

Plays the file at path. Each open reads through its own channel, so two sessions never share a position.

Plays the file at path. Each open opens the file itself and reads it by position, so two sessions never share a position. MediaItem(path) also plays a plain path, through FFmpeg's own file reader. This door is for code that wants every read to pass through Kotlin.

Link copied to clipboard

Plays the address a Compose Multiplatform resource has on Android (#457), the file:///android_asset/composeResources/... that Res.getUri returns there, from the app's assets through context. An asset stored uncompressed reads by position, as through ofAsset; one stored compressed reads as a stream that seeks by opening it again, which costs little for a clip an app bundles. Null for any other address, which then plays as it is.

Plays the address a Compose Multiplatform resource has in a packaged desktop app (#457), the jar:file:...!/composeResources/... that Res.getUri returns there, by reading the entry out of the app's jar. The entry seeks, by opening it again when a seek goes back, because it is stored compressed. Null for any other address, which then plays as it is: a file: address through FFmpeg's own file reader, as when Res.getUri runs from the build directory.

Link copied to clipboard
fun ERROR CLASS: Symbol not found for MediaIo.Companion.ofStream(open: () -> InputStream): ERROR CLASS: Symbol not found for MediaIoFactory

Plays a stream. A stream reads forward only, so the player cannot seek in it or switch its video track. Each open reads from the start, so open must return a new stream on every call. The reader closes the stream it got.

Link copied to clipboard

Plays what a content provider serves, such as a file from the system picker. Each open asks the provider for a new descriptor and reads it by position, so a reopen never moves a descriptor that someone else holds. A provider that answers with a pipe plays forward only.

Link copied to clipboard

Plays a file URL, such as one from a document picker. Each open starts security-scoped access to url, and the reader stops that access when it closes. So a picked file stays readable while the player reads it, and the caller has nothing to release.