< Home

e-flv-js

Hybrid TypeScript/JavaScript implementation, with most core modules ported to TypeScript, for playing enhanced FLV (E‑FLV) and legacy FLV files in the browser via Media Source Extensions (MSE). Bundles a reusable mux/demux/remux library with a demo app. Currently supports main‑thread only; the worker pipeline is disabled.

Browse the live GitHub repository → <e-flv-js>

Background and scope

Project layout

Prerequisites

Install dependencies

npm install

Run the demo app

  1. Build in watch mode: npm run dev
  2. In another terminal, start the static server: npm run serve
  3. Open http://localhost:8080/index.html
  4. Pick a source clip, adjust settings, and press Create Player

The demo ships with AV1 and Opus samples. Reload the page after adding new .flv files to ../assets/ (shared) or assets/ (local).

Production build

npm run build    # outputs bundles into dist/

Quality gates

npm run type-check
npm run lint          # temporary relaxed lint rules, will tighten later
npm run check         # runs both commands above

Using the library directly

The mux/remux player lives under src/mux-lib and is exported via the path alias @/mux-lib.

import { eflv, defaultConfig } from '@/mux-lib';
...
const player = eflv.createPlayer(mediaDataSource, config);
player.attachMediaElement(document.querySelector('video')!);
player.load();
player.play();

Review src/demo-app.ts for a wiring example that includes UI controls, telemetry hooks, and toggles between MP4 and WebM transmuxing paths.

License

Apache License 2.0. Portions derived from the original mpegts.js, project retain their upstream notices.