mediastream-upload
v0.1.0
Published
Composite live MediaStreams and upload them incrementally as seekable WebM chunks during the session
Maintainers
Readme
mediastream-upload
Composite live browser MediaStreams and upload them as seekable WebM chunks during the session — not one giant blob at the end.
Zero runtime dependencies. Backend-agnostic (init / sendChunk / finalize / abort). R2 and S3 HTTP adapters included.
Install
pnpm add mediastream-uploadQuick start
import { ChunkRecorder } from "mediastream-upload";
import { createR2Backend } from "mediastream-upload/adapters/r2";
const stream = await navigator.mediaDevices.getUserMedia({ video: true, audio: true });
const recorder = new ChunkRecorder({ onStateChange: console.log });
await recorder.start({
sources: { main: stream },
backend: createR2Backend("https://your-worker.example.com"),
});
const { videoUrl, localBlob } = await recorder.stop();Call start() from a user gesture. Details: docs/getting-started.md.
Docs
| Doc | Purpose | |-----|---------| | Getting started | Camera, PiP, errors | | Architecture | Why / how | | API | Public surface | | Backend contract | Integrator spec | | Testing | What CI proves |
Demo: vanilla-js · react (pnpm build → pnpm dlx serve . or pnpm example:react).
Develop
pnpm install
pnpm lint && pnpm typecheck && pnpm test && pnpm buildFirst publish is 0.1.0. Ship 1.0.0 only when the public API is intentionally stable.
License
MIT
