mediadecode-webcodecs 0.0.0

WebCodecs adapter for the `mediadecode` abstraction layer β€” implements its `VideoAdapter` / `AudioAdapter` traits on top of the browser's WebCodecs API via `web-sys`, for `wasm32` targets.
docs.rs failed to build mediadecode-webcodecs-0.0.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.

WebCodecs adapter for the mediadecode abstraction layer, built on top of web-sys.

Implements mediadecode's VideoAdapter and AudioAdapter traits (plus the matching push-style *StreamDecoder traits) on top of the browser's WebCodecs API.

Target

This crate is wasm32-only. On non-wasm32 targets it compiles to an empty stub so the workspace cargo build / cargo check continue to work in native dev loops.

Status: scaffolded, public API not yet released. Track the CHANGELOG for the first published version.

# Once published. Until then consume via git or path dep.
[dependencies]
mediadecode-webcodecs = "0.0"

Built and run via wasm-bindgen on wasm32-unknown-unknown. The crate intentionally does not implement SubtitleAdapter β€” WebCodecs has no subtitle surface; captions live in JavaScript-side parsers.

Required cfg flag

web-sys gates the WebCodecs APIs behind --cfg web_sys_unstable_apis because the WebIDL is not yet stable across all browsers. Add the flag to your project's .cargo/config.toml:

[target.wasm32-unknown-unknown]
rustflags = ["--cfg=web_sys_unstable_apis"]

…or set RUSTFLAGS="--cfg=web_sys_unstable_apis" in your build environment / CI. Without the flag, the crate emits an explicit compile_error! pointing here.

Bindings

There is no high-level WebCodecs wrapper crate that meets the ergonomics bar; the crate uses web-sys directly as the FFI layer (the same source videocall.rs, livekit-rust, and other active WebCodecs Rust users build on) and layers an idiomatic mediadecode-shaped surface on top.

License

mediadecode-webcodecs is under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE, LICENSE-MIT for details.

Copyright (c) 2026 FinDIT Studio authors.