npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

playsvideo

v0.4.7

Published

Play any video file in the browser — client-side remuxing and audio transcode, no server required.

Downloads

1,583

Readme

You probably don't need VLC. Play any video file in the browser — no install, no upload.

Try it at playsvideo.com  |  Chrome Extension  |  Drop a file. It plays.


Many video files won't play in a browser — not because the browser can't decode the video, but because it can't open the container or handle the audio codec. playsvideo fixes that entirely client-side: it remuxes containers and transcodes audio on the fly, so your MKV with AC-3 audio just works.

What it handles

| | Formats | Notes | |---|---|---| | Containers | MKV, MP4, AVI, TS, WebM | Demuxed and remuxed to fMP4 | | Video | H.264, H.265 (HEVC), VP9, AV1 | Passthrough — plays ~99% of files (~90% on Firefox; HEVC transcode planned) | | Audio | AAC, MP3, AC-3, E-AC-3, DTS, FLAC, Opus | Transcoded to AAC when the active playback path cannot use them safely | | Subtitles | SRT, ASS/SSA | Extracted and displayed as WebVTT |

See supported media for the full codec matrix, browser compatibility, and transcode details.

How it works

Video file (MKV, MP4, AVI, …)
  → mediabunny demux (streaming, any file size)
  → keyframe-aligned segment plan
  → per segment:
      video remuxed / passed through
      audio transcoded only if needed (AC-3/E-AC-3/DTS/MP3/FLAC/Opus → AAC)
      muxed to fMP4
  → hls.js plays segments on demand
  → subtitles extracted to WebVTT

Note: passthrough/native playback and remuxed HLS/MSE playback are evaluated separately. A source file can play fine via direct passthrough in both Chrome and Safari on macOS, yet still be unsafe once routed through the remuxed HLS/fMP4 pipeline. That is what we observed with AC-3: the original file played directly, but Safari produced audible stalls after remuxing to HLS/fMP4, while Chrome continued to play correctly. The remux pipeline therefore treats AC-3/E-AC-3 as unsafe there and transcodes them to AAC, without affecting native passthrough decisions.

Video transcode is almost never needed — browsers natively decode the vast majority of video codecs. When audio transcode is needed, a lightweight 1.8 MB ffmpeg.wasm build is lazy-loaded entirely in-browser. No SharedArrayBuffer required — works on any host without special CORS headers.

Under the hood

The obvious approach — ffmpeg compiled to WebAssembly — can't handle large files (WORKERFS is catastrophically slow, MEMFS can't hold them). The trick is to split the problem:

  • mediabunny — streaming demux/remux in pure TypeScript, works on any size file
  • ffmpeg.wasm — only transcodes short audio segments via MEMFS
  • hls.js — battle-tested HLS playback via Media Source Extensions

Each piece existed separately. Nobody combined them.

Use as a library

npm install playsvideo
import { PlaysVideoEngine } from 'playsvideo';

const video = document.querySelector('video')!;
const engine = new PlaysVideoEngine(video);

// Play a local file (drag-and-drop, <input type="file">, etc.)
engine.loadFile(file);

// Or play from a URL (requires CORS + range request support)
engine.loadUrl('https://example.com/video.mkv');

// Or attach an external .srt/.vtt subtitle file after loading
await engine.loadExternalSubtitle(subtitleFile);

engine.destroy(); // clean up

See engine API docs for events, properties, and full usage.

Roadmap

See docs/roadmap.md for the full list. Highlights:

  • User-imported subtitles — load external .srt/.vtt files alongside the video
  • WebCodecs — replace ffmpeg.wasm with hardware-accelerated AudioDecoder/AudioEncoder and VideoDecoder/VideoEncoder
pnpm run setup              # install deps + download ffmpeg-core.wasm
pnpm run dev                # vite dev server (simple player)
pnpm run typecheck          # tsc --noEmit
pnpm run test:unit          # fast unit tests
pnpm run lint               # biome lint
pnpm run format             # biome format
pnpm run test:integration   # requires test fixtures in tests/fixtures/
pnpm --filter app dev       # media player dev server (React app)
src/pipeline/       Core modules (demux, mux, segment plan, audio transcode,
                    codec probe, playlist, subtitle extraction)
src/adapters/       Platform adapters (ffmpeg.wasm for browser, node-ffmpeg for tests)
src/worker.ts       Web worker — demux + on-demand segment processing
src/engine.ts       PlaysVideoEngine class (worker, hls.js, subtitles)
src/pwa-player.ts   Browser entry — file picker, drag-and-drop
app/                React media player — library management, folder picker, playlists
tests/              Unit, integration, and e2e (Playwright) tests

License

MIT. Dependencies include MPL-2.0 (mediabunny), Apache-2.0 (hls.js), and LGPL-2.1 (ffmpeg-core.wasm, loaded at runtime). No GPL codecs are compiled in. See licensing details and THIRD_PARTY_LICENSES.