Production-ready WebCodecs implementation examples
npm install webcodecs-examplesComplete, production-ready WebCodecs implementation examples for WebCodecs Fundamentals.
Usage: import { WebCodecsPlayer } from 'webcodecs-examples'
Demo: npm run dev
Source: /src/player
---
Usage: import { VideoTranscoder } from 'webcodecs-examples/transcoding'
Demo: npm run dev:transcoding
Source: /src/transcoding
---
Live Demo: Coming soon
Source: /editing
---
Live Demo: Coming soon
Source: /live-streaming
---
These examples complement the WebCodecs Fundamentals documentation by providing:
- Working code you can study and learn from
- Live demos you can interact with
- Starter templates you can clone for your own projects
The fundamentals docs teach concepts. These examples show production implementation.
``bash`
npm install webcodecs-examples
`typescript
import { WebCodecsPlayer } from 'webcodecs-examples';
const player = new WebCodecsPlayer({
src: videoFile,
canvas: document.querySelector('canvas')
});
await player.initialize();
await player.play();
`
`html`
`bash``
git clone https://github.com/sb2702/webcodecs-examples.git
cd webcodecs-examples
npm install
npm run dev # Run player demo
- WebCodecs Fundamentals - Learn WebCodecs concepts
- webcodecs-utils - Utility library used in these examples
- MediaBunny - Full-featured WebCodecs library
These examples require:
- Chrome 94+ or Edge 94+ (full support)
- Safari 17.4+ (partial support)
All examples include feature detection and graceful degradation.
Contributions welcome! Please:
1. Keep examples focused and production-quality
2. Follow existing code style
3. Include inline comments explaining WebCodecs patterns
4. Test in Chrome, Edge, and Safari
MIT
Built for WebCodecs Fundamentals by Sam Bhattacharyya (@sb2702)
Created by the team at Free.Upscaler.Video