From 858692d595b2e38c71b7d0cdb0b3045e51dbe995 Mon Sep 17 00:00:00 2001 From: ronalduQualabs Date: Mon, 4 May 2026 11:34:32 -0300 Subject: [PATCH 1/3] Merge remote-tracking branch 'upstream/main' into fix/peertube-sample-urls --- README.md | 10 +--------- .../peertube-video-element/peertube-video-element.js | 2 +- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 22482ea..6d23b7b 100644 --- a/README.md +++ b/README.md @@ -21,12 +21,4 @@ A collection of HTMLMediaElement compatible elements and add-ons. | [``](packages/jwplayer-video-element) | A custom video element for JW Player. | | [``](packages/twitch-video-element) | A custom video element for Twitch player. | | [``](packages/cloudflare-video-element) | A custom video element for Cloudflare Stream. | -| [``](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. +| [``](packages/peertube-video-element) | A custom video element for PeerTube player. | \ No newline at end of file diff --git a/packages/peertube-video-element/peertube-video-element.js b/packages/peertube-video-element/peertube-video-element.js index c0390ee..019be6e 100644 --- a/packages/peertube-video-element/peertube-video-element.js +++ b/packages/peertube-video-element/peertube-video-element.js @@ -143,7 +143,7 @@ class PublicPromise extends Promise { } } -class PeerTubeVideoElement extends MediaPlayedRangesMixin(MediaTracksMixin(globalThis.HTMLElement ?? class {})) { +class PeerTubeVideoElement extends MediaPlayedRangesMixin(MediaTracksMixin(HTMLElement)) { static getTemplateHTML = getTemplateHTML; static shadowRootOptions = { mode: "open" }; static observedAttributes = [ From 6612e3a3aed8b4ffb435a1c57f788c92fc2c5d3b Mon Sep 17 00:00:00 2001 From: ronalduQualabs Date: Mon, 4 May 2026 11:44:12 -0300 Subject: [PATCH 2/3] fix: remove redundant optional chaining in castable-mixin getters --- packages/castable-video/castable-mixin.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/castable-video/castable-mixin.js b/packages/castable-video/castable-mixin.js index 2ae9d05..960a521 100644 --- a/packages/castable-video/castable-mixin.js +++ b/packages/castable-video/castable-mixin.js @@ -297,7 +297,7 @@ export const CastableMediaMixin = (superclass) => } get muted() { - if (this.#castPlayer) return this.#castPlayer?.isMuted; + if (this.#castPlayer) return this.#castPlayer.isMuted; return super.muted; } @@ -315,7 +315,7 @@ export const CastableMediaMixin = (superclass) => } get volume() { - if (this.#castPlayer) return this.#castPlayer?.volumeLevel ?? 1; + if (this.#castPlayer) return this.#castPlayer.volumeLevel ?? 1; return super.volume; } @@ -330,15 +330,15 @@ export const CastableMediaMixin = (superclass) => get duration() { // castPlayer duration returns `0` when no media is loaded. - if (this.#castPlayer && this.#castPlayer?.isMediaLoaded) { - return this.#castPlayer?.duration ?? NaN; + if (this.#castPlayer && this.#castPlayer.isMediaLoaded) { + return this.#castPlayer.duration ?? NaN; } return super.duration; } get currentTime() { - if (this.#castPlayer && this.#castPlayer?.isMediaLoaded) { - return this.#castPlayer?.currentTime ?? 0; + if (this.#castPlayer && this.#castPlayer.isMediaLoaded) { + return this.#castPlayer.currentTime ?? 0; } return super.currentTime; } From 76c6c5ac96efb8eda6c80148e2d5454a7f707c0d Mon Sep 17 00:00:00 2001 From: ronalduQualabs Date: Mon, 4 May 2026 14:07:10 -0300 Subject: [PATCH 3/3] restore un-need changes --- packages/castable-video/castable-mixin.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/castable-video/castable-mixin.js b/packages/castable-video/castable-mixin.js index 960a521..2ae9d05 100644 --- a/packages/castable-video/castable-mixin.js +++ b/packages/castable-video/castable-mixin.js @@ -297,7 +297,7 @@ export const CastableMediaMixin = (superclass) => } get muted() { - if (this.#castPlayer) return this.#castPlayer.isMuted; + if (this.#castPlayer) return this.#castPlayer?.isMuted; return super.muted; } @@ -315,7 +315,7 @@ export const CastableMediaMixin = (superclass) => } get volume() { - if (this.#castPlayer) return this.#castPlayer.volumeLevel ?? 1; + if (this.#castPlayer) return this.#castPlayer?.volumeLevel ?? 1; return super.volume; } @@ -330,15 +330,15 @@ export const CastableMediaMixin = (superclass) => get duration() { // castPlayer duration returns `0` when no media is loaded. - if (this.#castPlayer && this.#castPlayer.isMediaLoaded) { - return this.#castPlayer.duration ?? NaN; + if (this.#castPlayer && this.#castPlayer?.isMediaLoaded) { + return this.#castPlayer?.duration ?? NaN; } return super.duration; } get currentTime() { - if (this.#castPlayer && this.#castPlayer.isMediaLoaded) { - return this.#castPlayer.currentTime ?? 0; + if (this.#castPlayer && this.#castPlayer?.isMediaLoaded) { + return this.#castPlayer?.currentTime ?? 0; } return super.currentTime; }