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

@ashetian/next-hls-lite

v1.1.2

Published

A tiny, Next.js-friendly React component that plays HLS streams with graceful fallbacks, mobile autoplay fixes, and zero layout jank.

Readme

next-hls-lite

A tiny, Next.js-friendly React component that plays HLS streams with graceful fallbacks, mobile autoplay fixes, and zero layout jank.

npm npm downloads license bundle size


Why?

Most hls.js wrappers don’t play well with Next.js SSR and often break on mobile autoplay. This package solves those pain points:

  • SSR-friendly → No window errors in Next.js.
  • Mobile-ready → Autoplay + playsInline fixes included.
  • Layout-safe → Controlled entirely by the parent container, no jank.

Installation

npm install @ashetian/next-hls-lite

Usage

Component works by covering its parent so make sure you have a parent for video in your layout.

import { HlsVideo } from '@ashetian/next-hls-lite';

export default function MyPage() {
  return (
    <div className="w-screen h-screen">
      <HlsVideo
        src="https://example.com/video.m3u8"
        poster="https://example.com/poster.jpg"
        muted
        autoPlay
        playsInline
        loop
        fit="cover"
      />
    </div>
  );
}

You can also pass children to the component to render overlays. This is perfect for Hero components.

import { HlsVideo } from '@ashetian/next-hls-lite';

export default function MyPage() {
  return (
    <div className="flex items-center justify-center w-screen h-screen">
      <HlsVideo
        src="https://example.com/video.m3u8"
        poster="https://example.com/poster.jpg"
        autoPlay
        playsInline
        loop
        overlayPointerEvents="none"
        fit="cover"
      >
        <div className="absolute inset-0 bg-black/50 flex items-center justify-center">
          <h1 className="text-white text-3xl">
            This is an overlay
          </h1>
        </div>
      </HlsVideo>
    </div>
  );
}

Advanced usage

Error handling & custom overlay:

import { HlsVideo } from '@ashetian/next-hls-lite';

return (
  <HlsVideo
    src="https://example.com/video.m3u8"
    poster="/poster.jpg"
    muted
    autoPlay
    playsInline
    loop
    fit="cover"
    onError={(err) => console.error("Video error:", err)}
  >
    <div className="absolute inset-0 flex items-center justify-center bg-black/30">
      <button className="px-4 py-2 bg-white text-black">Play Again</button>
    </div>
  </HlsVideo>
);

Props

| Prop | Type | Default | Description | | ---------------------- | ---------------------- | ------- | ------------------------------- | | src | string | - | HLS (.m3u8) source | | poster | string | - | Fallback image | | muted | boolean | true | Mute audio | | autoPlay | boolean | true | Autoplay on mobile | | playsInline | boolean | true | Plays inline on mobile | | loop | boolean | true | Loop video | | fit | 'cover' \| 'contain' | cover | Fit mode for parent | | overlayPointerEvents | 'auto' \| 'none' | auto | Control overlay interactions | | overlayZIndex | number | 2 | Overlay z-index | | onLoadStart | () => void | - | Fired when video starts loading | | onCanPlay | () => void | - | Fired when video can play | | onError | (err: Error) => void | - | Fired on video error | | ...videoProps | HTMLVideoElement | - | Other props inherited from video|

Contributing

PRs and issues are welcome. If you want to add features or fix bugs, just fork and open a pull request.

License

MIT© ashetian