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

peertube-video-element

v1.1.0

Published

A custom element for the PeerTube player with an API that matches the `<video>` API

Downloads

69

Readme

<peertube-video>

NPM Version NPM Downloads jsDelivr hits (npm) npm bundle size

A custom element for the PeerTube player with an API that matches the <video> API.

Known limitations

These are constraints of the PeerTube embed API that affect Media Chrome integration:

  • Buffer progress bar is not available — The embed API does not expose download/buffer progress, so el.buffered always returns empty. The Media Chrome time range will not show a buffered region ahead of the playhead.
  • Auto quality does not enable ABR — The "Auto" option in <media-rendition-menu> only works when the PeerTube instance streams in p2p-media-loader mode (HLS). In the default web-video mode (plain MP4), adaptive bitrate is not supported and selecting Auto falls back to the highest fixed resolution. Pass config={{ mode: 'p2p-media-loader' }} to opt into HLS mode on instances that support it.

Example

<script type="module" src="https://cdn.jsdelivr.net/npm/[email protected]/+esm"></script>
<peertube-video controls src="https://video.mshparisnord.fr/w/7r2FxoQdYjun6tYWJfHUCa"></peertube-video>

Supported URL formats:

https://instance.example/videos/watch/<id>
https://instance.example/videos/embed/<id>
https://instance.example/w/<id>

Install

First install the NPM package:

npm install peertube-video-element

Import in your app javascript (e.g. src/App.js):

import 'peertube-video-element';

Optionally, you can load the script directly from a CDN using JSDelivr:

<script type="module" src="https://cdn.jsdelivr.net/npm/[email protected]/+esm"></script>

This will register the custom elements with the browser so they can be used as HTML.

Usage with Media Chrome

<script type="importmap">
  { "imports": { "media-tracks": "https://cdn.jsdelivr.net/npm/[email protected]/+esm" } }
</script>
<script type="module" src="https://cdn.jsdelivr.net/npm/[email protected]/+esm"></script>
<script type="module" src="https://cdn.jsdelivr.net/npm/media-chrome@4/+esm"></script>
<script type="module" src="https://cdn.jsdelivr.net/npm/media-chrome@4/menu/+esm"></script>

<media-controller>
  <peertube-video slot="media" src="https://video.mshparisnord.fr/w/7r2FxoQdYjun6tYWJfHUCa"></peertube-video>
  <media-captions-menu hidden anchor="auto"></media-captions-menu>
  <media-rendition-menu anchor="auto" hidden>
    <div slot="header">Quality</div>
  </media-rendition-menu>
  <media-control-bar>
    <media-play-button></media-play-button>
    <media-mute-button></media-mute-button>
    <media-volume-range></media-volume-range>
    <media-time-range></media-time-range>
    <media-time-display show-duration></media-time-display>
    <media-captions-menu-button></media-captions-menu-button>
    <media-rendition-menu-button></media-rendition-menu-button>
    <media-fullscreen-button></media-fullscreen-button>
  </media-control-bar>
</media-controller>

config prop

Pass PeerTube embed URL parameters via the config property to customize player behavior:

const player = document.querySelector('peertube-video');
player.config = {
  p2p: 0,             // disable P2P
  mode: 'web-video',  // 'web-video' (MP4) or 'p2p-media-loader' (HLS/ABR)
  subtitle: 'en',     // auto-select caption language on load
  playbackRate: 1.5,  // initial playback speed
};

| Option | Type | Description | | ------ | ---- | ----------- | | p2p | 0 \| 1 | Enable/disable P2P (default: 1) | | mode | 'web-video' \| 'p2p-media-loader' | Player engine. Use p2p-media-loader for HLS and adaptive bitrate | | subtitle | string | ISO language code to auto-select on load (e.g. 'en', 'fr') | | playbackRate | number | Initial playback speed (e.g. 0.75, 1.5) | | playlistPosition | number | Starting position in a playlist (1-based) | | waitPasswordFromEmbedAPI | 0 \| 1 | Delay load until password is supplied via api.setVideoPassword() | | peertubeLink | 0 \| 1 | Show/hide the PeerTube instance link | | title | 0 \| 1 | Show/hide the video title overlay | | warningTitle | 0 \| 1 | Show/hide the P2P warning | | controlBar | 0 \| 1 | Show/hide the native control bar during playback | | start | number | Start time in seconds | | stop | number | Stop time in seconds | | bigPlayBackgroundColor | string | Play button background color | | foregroundColor | string | Text/icon foreground color |

Related