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

mattebox

v0.6.0

Published

Modular adaptive-streaming engine for HLS and DASH.

Readme

Quality npm version node license: MIT

Mattebox is a modular adaptive-streaming engine for HLS and DASH. It is a small kernel plus stages. You add the stages you need, and the rest stays out of your bundle. It has zero runtime dependencies and uses only MSE, EME, and standard web platform APIs.

Quick start

Install the package:

npm install mattebox --save

Create an engine with the stages you need, attach it to a <video> element, and load a manifest.

import { mattebox } from 'mattebox';
import hlsCmaf from 'mattebox/protocols/hls-cmaf';
import abr from 'mattebox/stages/abr';

const engine = mattebox({ stages: [hlsCmaf(), abr()] });

await engine.attach(document.querySelector('video'));
engine.load('https://example.com/stream/master.m3u8');

The element keeps its native API. Call play(), read currentTime, and use the browser controls as usual.

Without a bundler, one script tag loads everything behind a mattebox global with the same API.

<script src="https://cdn.jsdelivr.net/npm/mattebox/dist/cdn/mattebox.min.js"></script>
<script>
  const engine = mattebox({ stages: [mattebox.hlsCmaf(), mattebox.abr()] });
</script>

The guide covers the rest, starting with Getting started.

Player

Mattebox is the engine. Try it in the playground, which lets you load streams and pick stages in the browser. If you want a finished player on top of it, with controls, a theme, and a UI you can customize, use the sibling projects:

Presets

A preset is an engine with a fixed set of stages, exported from mattebox/presets/<name>:

import hls from 'mattebox/presets/hls';

const engine = hls({ config: { bufferGoalSeconds: 40 } });

Every preset plays on demand and live, adapts quality, recovers, switches audio, and renders WebVTT and CEA-608 captions. The name says what it adds: -ts for MPEG-TS segments, -drm for protected content.

| Preset | Line | MPEG-TS | DRM | | ------------- | ---------- | ------- | --- | | hls | HLS | | | | hls-drm | HLS | | yes | | hls-ts | HLS | yes | | | hls-ts-drm | HLS | yes | yes | | dash | DASH | | | | dash-drm | DASH | | yes | | dual | HLS + DASH | | | | dual-drm | HLS + DASH | | yes | | dual-ts | HLS + DASH | yes | | | dual-ts-drm | HLS + DASH | yes | yes | | full | HLS + DASH | yes | yes | | kernel | none | | |

full is the Mattebox bar in the chart above. See Size per preset for the others.

Documentation

  • Guide: how to use the engine, one chapter per topic.
  • Architecture: how the engine is built and how a stage plugs in.
  • Playground: try streams and stages in the browser.

Contributing

See the contributing guide. Participation is governed by the Code of Conduct. Vulnerabilities go through SECURITY.md.

License

MIT, see LICENSE.