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

@lumra/core

v0.1.3

Published

Lumra headless media player engine

Readme

@lumra/core

Headless media player engine for Lumra. Wraps the native <video> element with HLS adaptive streaming, a plugin system, quality switching, and a typed event emitter.

Install

npm install @lumra/core

Basic usage

import { createPlayer } from '@lumra/core'

const player = createPlayer({
  target: '#my-video',          // CSS selector or HTMLVideoElement
  src: 'https://example.com/stream.m3u8',
  autoplay: false,
  muted: false,
})

player.on('play',        () => console.log('playing'))
player.on('pause',       () => console.log('paused'))
player.on('timeupdate',  ({ currentTime, duration }) => console.log(currentTime, duration))
player.on('ended',       () => console.log('ended'))
player.on('error',       ({ code, message }) => console.error(code, message))

// Playback control
await player.play()
player.pause()
player.seek(30)           // seek to 30 seconds
player.setVolume(0.8)     // 0–1
player.mute()
player.unmute()

// Source switching
player.setSrc('https://example.com/other.m3u8')

// Cleanup
player.destroy()

HLS & adaptive streaming

HLS streams (.m3u8) are detected automatically and loaded via hls.js. Safari uses native HLS.

const player = createPlayer({
  target: '#video',
  src: 'https://example.com/stream.m3u8',
  hlsConfig: { maxBufferLength: 30 },   // pass any hls.js config here
})

Quality switching

// Get available quality levels (populated after the HLS manifest loads)
const levels = player.getQualityLevels()
// [{ index: -1, label: 'Auto' }, { index: 0, label: '1080p', bitrate: 5000000 }, ...]

// Set quality — index -1 = ABR auto
player.setQuality(0)    // lock to first level
player.setQuality(-1)   // back to auto

player.on('qualitychange', ({ level, auto }) => console.log(level, auto))
player.on('levelchange',   ({ level }) => console.log(level))

// Live stream detection
console.log(player.isLive)    // true for live HLS
console.log(player.isHls)     // true when hls.js is active

Plugin system

import { createPlayer } from '@lumra/core'
import type { Plugin, PlayerInstance } from '@lumra/core'

const myPlugin: Plugin = {
  name: 'my-plugin',
  init(player: PlayerInstance) {
    player.on('play', () => console.log('plugin saw play'))
  },
  destroy() {
    // cleanup — called when player.destroy() is called
  },
}

player.use(myPlugin)

Events reference

| Event | Payload | |---|---| | play | — | | pause | — | | ended | — | | timeupdate | { currentTime, duration } | | volumechange | { volume, muted } | | seeking | { time } | | seeked | { time } | | buffering | — | | ready | — | | error | { code, message } | | qualitychange | { level, auto } | | levelchange | { level } | | destroy | — |


© 2026 Reel Foundry AU. All rights reserved.
MIT License — see LICENSE