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

vailcast-player

v1.1.0

Published

Secure canvas-based video player with teleporting watermarks

Downloads

399

Readme

vailcast-player

A canvas-based HLS video player with moving watermark overlays, plus optional React and Angular adapters.

Features

  • Framework-agnostic core engine
  • UI modes: headless or Cinema-style custom controls
  • React adapter via vailcast-player/react
  • Angular adapter via vailcast-player/angular
  • Strict TypeScript declarations for all public APIs
  • npm-friendly ESM + CJS bundles

Installation

npm install vailcast-player hls.js

Usage (Core)

import { VailcastPlayer } from 'vailcast-player';
import 'vailcast-player/styles.css';

const host = document.getElementById('player-root');

if (!host) {
  throw new Error('Missing player container');
}

const player = new VailcastPlayer(host, {
  manifestUrl: 'https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8',
  userID: 'viewer-123',
  ui: {
    mode: 'cinema',
    speedOptions: [0.5, 0.75, 1, 1.25, 1.5, 2],
    previewVttUrl: 'https://cdn.example.com/thumbs/preview.vtt',
  },
  watermark: {
    enabled: true,
    jumpIntervalMs: 3000,
  },
});

void player.play();

Usage (React)

import { VailcastReactPlayer } from 'vailcast-player/react';
import type { VailcastOptions } from 'vailcast-player';
import 'vailcast-player/styles.css';

const config: VailcastOptions = {
  manifestUrl: 'https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8',
  userID: 'react-user',
};

export function PlayerView() {
  return <VailcastReactPlayer config={config} />;
}

UI Modes

VailcastOptions.ui accepts:

{
  mode?: 'headless' | 'cinema';
  controls?: boolean;
  speedOptions?: number[];
  previewVttUrl?: string;
  attemptPreviewVtt?: boolean;
  inputTheme?: {
    accentColor?: string;
    trackColor?: string;
    focusColor?: string;
    selectedColor?: string;
  };
}
  • headless (default): hides the native <video> element and renders frames on canvas.
  • cinema: enables a clean custom control bar with speed + resolution dials and timeline preview support.
  • controls: optional override for Cinema controls behavior (defaults to true in cinema mode).
  • speedOptions: playback rates shown in the speed dial (defaults to [0.75, 1, 1.25, 1.5, 2]).
  • previewVttUrl: thumbnail VTT URL for timeline preview hover cards.
  • attemptPreviewVtt: when true, tries to infer a VTT URL from the manifest (defaults to true in cinema mode).
  • inputTheme: customize the Cinema control input colors (accent, focus, track, selected menu state).

Security

userID is immutable by default after player initialization.

{
  security?: {
    lockUserID?: boolean; // default true
  };
}

When lockUserID is enabled, calling updateOptions with a different userID throws an error.

Usage (Angular)

import { Component } from '@angular/core';
import type { VailcastOptions } from 'vailcast-player';
import { VailcastComponent } from 'vailcast-player/angular';

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [VailcastComponent],
  template: `<vailcast-player [config]="config"></vailcast-player>`,
})
export class AppComponent {
  config: VailcastOptions = {
    manifestUrl: 'https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8',
    userID: 'angular-user',
  };
}

Development

npm install
npm run validate
npm run build

Local Examples

  • Vanilla HTML: examples/vanilla-html/index.html
  • Next.js integration app: examples/nextjs-app

Scripts

  • npm run build: Build TypeScript bundles and copy CSS
  • npm run typecheck: Strict TS typecheck
  • npm run lint: ESLint checks
  • npm run test: Vitest test suite
  • npm run validate: typecheck + lint + test + build

Repository

  • Source: https://github.com/Omar0Gamal/vailcast-player
  • Issues: https://github.com/Omar0Gamal/vailcast-player/issues
  • Discussions: https://github.com/Omar0Gamal/vailcast-player/discussions
  • Security reports: https://github.com/Omar0Gamal/vailcast-player/security/advisories/new

License

MIT