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

@captionhub/timbra.js

v2.0.0

Published

Add Timbra captions to your video player

Readme

Timbra.js

Add live captions from CaptionHub's Timbra to your video player. Plugins are included for Video.js 7 and 8 (including Brightcove), HLS.js, Mux Player and OptiView Player (THEOplayer 8.6+). The upcoming Video.js 10 rewrite is not yet supported.

👉 Full documentation · Upgrading from the 1.x hosted plugins

Installation

npm install @captionhub/timbra.js

or

yarn add @captionhub/timbra.js

No bundler? Versioned static bundles are hosted on timbra.com — they expose the same API on window.Timbra:

<script src="https://timbra.com/@2.0.0.js"></script>

Quick start

Get the captions URL for your stream from the CaptionHub UI or API, then construct the plugin for your player and start captions:

import { Timbra } from '@captionhub/timbra.js';

const player = videojs('my-video');

const timbra = new Timbra.VideoJSPlugin({
  video: player,
  captionsURL: 'https://…', // from the CaptionHub UI or API
});

timbra.startCaptions();

The same pattern works for the other players: Timbra.HLSJSPlugin ({ video, hls, captionsURL }), Timbra.MuxPlugin ({ video } — the captions URL is derived from the player's playback ID) and Timbra.OptiViewPlugin ({ player, captionsURL }).

Content Security Policy

If your site sets a CSP, the plugins need:

  • script-src https://timbra.com — when using the hosted script tag (not needed for the NPM package).
  • connect-src https://cdn.captionhub.com wss://ws-eu.pusher.com https://sockjs-eu.pusher.com — caption delivery (HTTPS polling and WebSocket) and playback metrics. Use the host of your captions URL if it differs.
  • media-src data:OptiView Player only: the player backs its custom text tracks with data:text/vtt URLs.

Troubleshooting

Captions not appearing? Check, in order:

  1. The stream is live in CaptionHub and the player is actually playing — captions only start with playback.
  2. The captions URL responds: open it in a browser; it should return JSON. Mistyped or stale URLs are the most common cause (the plugin throws immediately if a required option is missing entirely).
  3. The caption track is selected: the plugin adds a subtitle track to the player's CC menu; viewers still need to turn it on (the stream's default language track enables itself).
  4. Turn on logging: pass loglevel: 'debug' and watch the browser console — every fetch, track and caption placement is logged with a [Timbra#…] prefix. Include these logs in support tickets.
  5. CSP errors in the console? See the Content Security Policy section above.

Support and feedback

Raise a support ticket at CaptionHub Support.

License

CaptionHub user terms and license