fluvie_web_encoder library

Render Fluvie videos to MP4 fully in the browser with ffmpeg.wasm.

Import this single barrel:

import 'package:fluvie_web_encoder/fluvie_web_encoder.dart';

The capture half is Fluvie's own frame-driven pipeline (renderToSandbox); this package adds the in-browser ffmpeg.wasm encode, which runs the exact same argument plan as the desktop and server paths. Clips decode on-device through WebCodecs via createWebClipDecoder. It is opt-in, so apps that only render via the API stay free of the wasm payload. src/ stays private.

Classes

BundleWebAudioMaterializer
The default WebAudioMaterializer: reads bundled assets through an AssetBundle and fetches network audio (subject to a NetworkAllowlist).
FluvieWebStage
Wrap your app's root in a FluvieWebStage to enable in-browser rendering.
WebAudioMaterializer
Loads a Fluvie audio source string into bytes for the in-browser encoder.
WebCaptureHost
Drives one off-screen render surface for the in-browser capture loop.
WebVideoEncoder
Encodes the frames a render captured into a RenderSandbox to MP4 bytes, using ffmpeg.wasm through Fluvie's WasmRuntime.
WebVideoRenderer
Renders a Fluvie composition to an MP4 entirely in the browser.

Functions

createWebClipDecoder() → WebClipDecoder
The non-browser fallback: a WebClipDecoder that fails on use, so the symbol is importable on the VM (tests, analysis) while real decoding stays browser-only. The real bridge ships in clip_decoder_web.dart.
downloadBytes(Uint8List bytes, {required String filename, String mimeType = 'video/mp4'}) → void
The non-web stub of downloadBytes: there is no browser to download into, so it fails clearly. The real implementation ships only in a web build.

Typedefs

WebAudioFetch = Future<Uint8List> Function(Uri url)
Fetches the bytes at a network url.
WebCaptureHostFactory = WebCaptureHost Function(Size size)
Builds the off-screen WebCaptureHost for a render at size logical pixels.