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

@structyl/video-player

v1.0.3

Published

React video player with HLS adaptive streaming (hls.js), SRT/VTT subtitles, playlists, chapters, video filters, and full keyboard control.

Readme

@structyl/video-player

A full-featured, accessible React video player with HLS streaming, subtitles, playlists, and chapters.

npm license

@structyl/video-player is a single-component, drop-in React video player built on the native <video> element and hls.js. It adds adaptive HLS streaming, SRT/VTT subtitles, playlists, chapter markers, live video filters, picture-in-picture, and complete keyboard control — styled with the structyl Tailwind theme tokens. It is intended for product teams who need a capable, themable player without wiring up the media stack by hand.

Installation

pnpm add @structyl/video-player
npm install @structyl/video-player
yarn add @structyl/video-player

react, react-dom, and tailwindcss are peer dependencies. The player renders with structyl theme tokens (bg, fg, primary), so use it within an app configured with @structyl/styled / a structyl theme.

Usage

import { VideoPlayer } from '@structyl/video-player';
import type { SubtitleTrack, Chapter, PlaylistItem } from '@structyl/video-player';

const subtitles: SubtitleTrack[] = [
  { label: 'English', language: 'en', src: '/subs/en.vtt' },
  { label: 'Español', language: 'es', src: '/subs/es.srt' },
];

const chapters: Chapter[] = [
  { id: '1', title: 'Intro', startTime: 0, endTime: 30 },
  { id: '2', title: 'Demo', startTime: 30, endTime: 120 },
];

const playlist: PlaylistItem[] = [
  { id: '1', title: 'Episode 1', src: '/videos/ep1.m3u8', poster: '/posters/ep1.jpg' },
  { id: '2', title: 'Episode 2', src: '/videos/ep2.mp4', poster: '/posters/ep2.jpg' },
];

export function Player() {
  return (
    <VideoPlayer
      src="/videos/stream.m3u8"
      poster="/posters/stream.jpg"
      subtitles={subtitles}
      chapters={chapters}
      playlist={playlist}
      onTimeUpdate={(time) => console.log('current time', time)}
      onEnded={() => console.log('playback finished')}
    />
  );
}

Plain MP4/WebM works with just a src:

<VideoPlayer src="/videos/clip.mp4" />

YouTube URLs are detected automatically and rendered through an embedded player.

Features

  • Adaptive HLS streaming.m3u8 sources play through hls.js, with native HLS fallback on Safari.
  • Quality selection — HLS renditions are surfaced as selectable quality levels.
  • Subtitles & captions — load SRT and VTT tracks, switch languages, upload local files, and customize font, color, background opacity, and position.
  • Playlists — multi-item playback with next/previous, shuffle, and none / one / all repeat modes.
  • Chapters — chapter markers rendered on the timeline with title lookup.
  • Live video filters — adjust brightness, contrast, saturation, hue, blur, and grayscale in real time.
  • Picture-in-picture & fullscreen — toggle both from the controls or keyboard.
  • Thumbnail scrubbing — hover the timeline to preview frames.
  • Full keyboard control — space/k play, arrows seek and adjust volume, m mute, f fullscreen, p PiP, c captions, ,/. frame step.
  • Playback callbacksonPlay, onPause, onEnded, onTimeUpdate, and onVolumeChange.
  • Auto-hiding controls and structyl-themed styling out of the box.

API

VideoPlayer

The single exported component. Props:

| Prop | Type | Default | Description | | --- | --- | --- | --- | | src | string | — | Video source URL. Supports MP4/WebM, HLS (.m3u8), and YouTube links. Required. | | poster | string | — | Poster image shown before playback. | | autoPlay | boolean | false | Start playback automatically. | | loop | boolean | false | Loop the current video. | | muted | boolean | false | Start muted. | | className | string | '' | Extra classes merged onto the player container. | | subtitles | SubtitleTrack[] | [] | Subtitle/caption tracks to load. | | playlist | PlaylistItem[] | [] | Items for multi-video playback. | | chapters | Chapter[] | [] | Chapter markers for the timeline. | | onPlay | () => void | — | Fired when playback starts. | | onPause | () => void | — | Fired when playback pauses. | | onEnded | () => void | — | Fired when the current video ends. | | onTimeUpdate | (currentTime: number) => void | — | Fired as the playback position changes. | | onVolumeChange | (volume: number) => void | — | Fired when the volume changes. |

Exported types

| Type | Shape | | --- | --- | | VideoPlayerProps | Props for <VideoPlayer /> (above). | | SubtitleTrack | { label, language, src, kind? } | | SubtitleCue | { start, end, text } | | SubtitleStyle | { fontSize, fontFamily, textColor, backgroundColor, backgroundOpacity, position } | | PlaylistItem | { id, title, src, poster?, duration? } | | Chapter | { id, title, startTime, endTime } | | QualityLevel | { height, width, bitrate, label } | | VideoFilters | { brightness, contrast, saturation, hue, blur, grayscale } |

Part of structyl

This package is part of structyl — the React UI library with structure. Full documentation lives at www.structyl.com.

License

MIT