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

@knitui/media

v0.2.0

Published

Audio and video players, playlists and visualizers for Knit UI.

Readme

@knitui/media

Hybrid, cross-platform audio + video for Knit UI. Each domain drives a real browser backend on the web (HTMLAudioElement / <video> + Web Audio / MediaSession / Fullscreen / PiP) and expo-audio / expo-video on native, both behind one isolated controller contract per surface.

Install

# Expo
npx expo install @knitui/media react-native-reanimated

# bare React Native / web
npm install @knitui/media react-native-reanimated

@knitui/media builds on @knitui/core + @knitui/components; install those alongside the kit as usual. react-native-reanimated is a required peer.

Mount the provider once

The root entry exports the one cross-domain piece — <MediaProvider>. It owns the single shared <audio> / <video> element and is required for any player to render: each surface teleports into the active player, so without the provider there is nothing to mount the real element into. Mount it once near your app root, inside the Knit UI <Provider>:

import { Provider } from "@knitui/core";
import { MediaProvider } from "@knitui/media";

export default function App({ children }) {
  return (
    <Provider>
      <MediaProvider>{children}</MediaProvider>
    </Provider>
  );
}

useMediaState() reads the reactive cross-domain state (what's playing, etc.).

Audio & video are separate entry points

The two domains share several engine helper names with different meanings, so there is no flat barrel — import each domain from its own subpath:

// audio: <Audio> player, playlist, recorder, live meter, Skia visualizer …
import { Audio, AudioPlaylist, useAudioController } from "@knitui/media/audio";

// video: <Video> player + chrome (fullscreen, PiP, captions) …
import { Video, useVideoController } from "@knitui/media/video";

A third subpath, @knitui/media/dsp, exposes the pure-TS DSP surface (FFT / spectrum analyzer + the useAudioSpectrum hook) for building custom visualizations off the audio sample stream.

Truly-shared, dependency-free primitives (TypedEmitter, formatTime) live in @knitui/core.

Src-ship & Next.js

Like the rest of the kit, @knitui/media ships its TypeScript source (see docs/ci-cd-plan.md §3). Expo/Metro consumes it out of the box; Next.js must transpile the @knitui/* scope — the withKnitui wrapper from @knitui/plugins/next-plugin does this for you.

Development

  • pnpm --filter @knitui/media test — Jest (jsdom) suites for both domains
  • pnpm --filter @knitui/media typecheck / lint
  • pnpm --filter @knitui/media storybook — combined Storybook on port 6010

Part of Knit UI.