probe

fun MediaSource.Companion.probe(path: String, options: Map<String, String> = emptyMap()): MediaProbe

Opens path, reads what it says about itself, and closes it again.

Blocking, exactly like MediaSource.Companion.open, which it is: a probe is an open, a read of already-parsed fields, and a close. Call it off the UI thread, and expect a network URL to cost what opening one costs.

An extension on the companion rather than a member of it: MediaSource is an expect class, so a member would owe an actual in four platform source sets for a body that is the same everywhere and calls only what each of them already has.

Throws

when the source cannot be opened, the same way MediaSource.Companion.open does.


The same over caller-supplied bytes. The source owns io and closes it, so io is spent when this returns, exactly as it would be after an MediaSource.Companion.open and a close.