attach

fun attach(codecModule: JsAny)

Adopts a codec module the page has already instantiated.

This is the reliable way to supply it and the one a bundled application should use. A bundler rewrites import(url) at BUILD time, so load can fail with "Cannot find module" inside webpack, Vite or Rollup even though the file is served correctly. Loading the module from a plain <script type="module"> on the page and handing it here has no such problem:

<script type="module">
const factory = (await import("./kite.mjs")).default;
globalThis.kiteCodecModule = await factory();
</script>
KiteFFmpegWeb.attach(kiteCodecModule())   // your own external accessor

Calling twice is a no-op rather than a swap: the module holds FFmpeg's global codec registry and its handle table, so a second one would be a second registry and a second set of handles.