Install Mediabunny using your favorite package manager:Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Vanilagy/mediabunny/llms.txt
Use this file to discover all available pages before exploring further.
Requirements
JavaScript environment
Mediabunny requires any JavaScript environment that can run ECMAScript 2021 or later. It’s designed to run in modern browsers.
TypeScript
For TypeScript projects, you’ll need TypeScript 5.7 or later for type definitions.Browser compatibility
Mediabunny works in modern browsers that support:- ECMAScript 2021 features
- WebCodecs API (for encoding/decoding)
- Modern JavaScript APIs (Promises, async/await, etc.)
- Chrome 94+
- Edge 94+
- Safari 16.4+
- Firefox (with WebCodecs behind a flag)
Node.js support
Mediabunny also works in Node.js environments. However, WebCodecs API features may require polyfills or may not be available depending on your Node.js version.Import the library
Once installed, import Mediabunny in your project:Using a script tag
You can also include Mediabunny directly in your HTML using a script tag:Mediabunny object to the global scope, giving you access to all exports:
Download distribution files
You can download built distribution files from the releases page.- Standard script tag
- ES modules
Use the
*.cjs builds for normal script tag inclusion:TypeScript types for global usage
If you’re using TypeScript with the script tag approach, include themediabunny.d.ts declaration file in your project. This will declare a global Mediabunny namespace with full type support.
Bundle size
One of Mediabunny’s key advantages is its tree-shakable architecture:- Minimum size: 5 kB gzipped (when using only specific features)
- Full library: Varies based on which formats and codecs you use
- Smart bundling: Only the formats and codecs you import are included
Next steps
Now that you have Mediabunny installed, you’re ready to start building:Quick start
Jump right in with code examples for common tasks
Read media files
Learn how to extract metadata and media data
Write media files
Create new media files from scratch
Convert files
Convert between different media formats