KiteFFmpegWeb

Loads the codec, which on the web is a separate wasm module fetched over the network.

Every other target links FFmpeg into the same binary and can answer FFmpeg.identity the instant the process starts. A browser cannot, and cannot block waiting either, so the web needs one explicit step that the common API has nowhere to put (PLANNING.md). Call this once, await it, and the rest of kiteffmpeg behaves normally:

KiteFFmpegWeb.load("/kite.mjs")
check(FFmpeg.identity.isAcceptable)

Web only. It exists in no common source set, so no other platform's API changes to accommodate it.

Types

Link copied to clipboard

Thrown when the module was built without the runtime pieces this backend reads.

Link copied to clipboard

Thrown when the codec is used before load has completed. Names the fix, not the symptom.

Properties

Link copied to clipboard
const val DEFAULT_URL: String

The conventional name emscripten writes beside the wasm, resolved against the page.

Link copied to clipboard

True once load has completed. Every codec call before that throws NotLoaded.

Functions

Link copied to clipboard
fun attach(codecModule: JsAny)

Adopts a codec module the page has already instantiated.

Link copied to clipboard
suspend fun load(url: String = DEFAULT_URL)

Fetches and instantiates the codec module at url itself.