Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,4 @@ A collection of HTMLMediaElement compatible elements and add-ons.
| [`<jwplayer-video>`](packages/jwplayer-video-element) | A custom video element for JW Player. |
| [`<twitch-video>`](packages/twitch-video-element) | A custom video element for Twitch player. |
| [`<cloudflare-video>`](packages/cloudflare-video-element) | A custom video element for Cloudflare Stream. |
| [`<peertube-video>`](packages/peertube-video-element) | A custom video element for PeerTube player. |

## Browser support

The packages in this repo are distributed as **ESNext** — including modern JavaScript features like [private class fields](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Private_properties). This is intentional: these packages are designed to be imported and processed by your own bundler or build tool, which is responsible for transpiling to your target browsers.

If you need to support browsers that don't have these features natively (e.g. Safari < 14.1), configure your bundler to include these packages in its transpilation step and set your desired target (e.g. `es2019`).

> **Note:** Unlike [`media-chrome`](https://github.com/muxinc/media-chrome), which ships pre-transpiled to `es2019`, the packages in this repository are distributed as ESNext. You are responsible for configuring your build pipeline to handle any necessary transpilation for your target environments.
| [`<peertube-video>`](packages/peertube-video-element) | A custom video element for PeerTube player. |
2 changes: 1 addition & 1 deletion packages/peertube-video-element/peertube-video-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class PublicPromise extends Promise {
}
}

class PeerTubeVideoElement extends MediaPlayedRangesMixin(MediaTracksMixin(globalThis.HTMLElement ?? class {})) {
class PeerTubeVideoElement extends MediaPlayedRangesMixin(MediaTracksMixin(HTMLElement)) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SSR fallback removed for HTMLElement base class

High Severity

The globalThis.HTMLElement ?? class {} fallback was replaced with a bare HTMLElement reference. Every other element in the codebase (e.g., cloudflare-video-element, spotify-audio-element, tiktok-video-element, twitch-video-element) uses the globalThis.HTMLElement ?? class {} pattern to avoid a ReferenceError in non-browser environments like SSR or Node.js. This change breaks that SSR safety for PeerTubeVideoElement.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 6612e3a. Configure here.

static getTemplateHTML = getTemplateHTML;
static shadowRootOptions = { mode: "open" };
static observedAttributes = [
Expand Down
Loading