readMediaSource

fun BufferedSource.readMediaSource(hint: FormatHint? = null): MediaSource(source)

Reads the whole of this source into a media source, consuming it.

Every byte lands in memory at once, so this is for small assets and for the browser, where a path means nothing.

Parameters

hint

What container the bytes hold, or null to let the backend sniff it.