Use Media Transformations in a Worker
Media Transformations bindings let Workers transform video or audio from protected sources.
Add the Media Transformations config, call from worker code, and start with the local test path Devflare supports.
Start with the config, wire the binding into worker code, then use the support section to decide whether local tests or Cloudflare-backed tests fit.
- Config key
- Authoring shape
- Best for
- video/audio transformation paths where the Worker calls Cloudflare Media Transformations
Use the binding from application code
After Devflare generates the worker env, import from and keep the first Media Transformations path close to the route, handler, or service method that needs it.
Keep this first path small enough that the config, env binding, and user-visible behavior are easy to review together.
Run one media transformation chain
Local and Remote Support
Devflare has a real lane for Media Transformations, but the local contract is intentionally narrower than Cloudflare's hosted product. The docs call out the supported local path and the remote boundary separately.
Full local support through Miniflare media bindings and deterministic pure mocks for transform chains. Use the documented local lane only for the behavior Devflare explicitly models, and keep the narrower boundary visible in code review.
Use Cloudflare when the assertion depends on cloudflare-hosted product behavior rather than the app calling the binding correctly. This is the lane for full Media Transformations product fidelity, remote state, lifecycle behavior, and platform-specific limits.
When this binding fits best
- Use Media Transformations when video/audio transformation paths where the worker calls cloudflare media transformations.
- Keep binding names stable and uppercase in examples so generated Env declarations remain predictable.
- Prefer Devflare native config while it covers the feature; use only for unsupported Wrangler-only fields.
Testing path
- Start with or with media fixtures for config-backed local worker tests.
- Use / for small unit tests that only need deterministic application behavior.
- Use Cloudflare-backed tests when the assertion depends on hosted platform behavior, account state, limits, billing, or production routing.
Open the next page when you need it
Subpage
Media Transformations internals
InternalsCheck emitted Wrangler , preview behavior, and Cloudflare-specific details.
Subpage
Testing Media Transformations
TestingPick the or with media fixtures path first, then move to remote checks only when the test needs them.
Subpage
Media Transformations example
ExampleCopy a fuller application path when the quick example is too small.