
Research
/Security News
Miasma Mini Shai-Hulud Hits ImmobiliareLabs npm Packages
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.
peertube-video-element
Advanced tools
A custom element for the PeerTube player with an API that matches the `<video>` API
<peertube-video>A custom element
for the PeerTube player with an API that matches the
<video> API.
HTMLMediaElement APImedia-tracksThese are constraints of the PeerTube embed API that affect Media Chrome integration:
el.buffered always returns empty. The Media Chrome time range will not show a buffered region ahead of the playhead.<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.<script type="module" src="https://cdn.jsdelivr.net/npm/peertube-video-element@1.0/+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>
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/peertube-video-element@1.0/+esm"></script>
This will register the custom elements with the browser so they can be used as HTML.
<script type="importmap">
{ "imports": { "media-tracks": "https://cdn.jsdelivr.net/npm/media-tracks@0.3/+esm" } }
</script>
<script type="module" src="https://cdn.jsdelivr.net/npm/peertube-video-element@1.0/+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 propPass 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 |
<youtube-video> A custom element for the YouTube player.<spotify-audio> A custom element for the Spotify player.<jwplayer-video> A custom element for the JW player.<videojs-video> A custom element for Video.js.<wistia-video> A custom element for the Wistia player.<cloudflare-video> A custom element for the Cloudflare player.<hls-video> A custom element for playing HTTP Live Streaming (HLS) videos.castable-video Cast your video element to the big screen with ease!<mux-player> The official Mux-flavored video player custom element.<mux-video> A Mux-flavored HTML5 video element w/ hls.js and Mux data builtin.FAQs
A custom element for the PeerTube player with an API that matches the `<video>` API
We found that peertube-video-element demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.

Security News
Rolldown paused Rust React Compiler integration after a 5MB binary size increase raised concerns about shipping React-specific code to all Vite users.

Security News
/Research
Mini Shai-Hulud expands into the Go ecosystem after hitting LeoPlatform npm packages and targeting GitHub Actions workflows.