From 3a9f18aaa55df75e0ad91c4b3e2f2eb47369feda Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Sat, 3 Oct 2026 14:12:39 +0200 Subject: Player: redesigned cast remote Skip buttons with circular arrows, filled scrubber, large play/pause, device header; the remote is its own component. Co-Authored-By: Claude Opus 5.5 --- .../src/meshbay_hub/static/video-player.js | 101 ++++++++++++++------- 1 file changed, 70 insertions(+), 31 deletions(-) (limited to 'packages/meshbay-hub/src/meshbay_hub/static/video-player.js') diff --git a/packages/meshbay-hub/src/meshbay_hub/static/video-player.js b/packages/meshbay-hub/src/meshbay_hub/static/video-player.js index a9d41b6..2c424fb 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/video-player.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/video-player.js @@ -279,6 +279,64 @@ function formatClock(seconds) { return h > 0 ? `${h}:${String(m).padStart(2, '0')}:${sec}` : `${m}:${sec}`; } +/** + * The player as a remote, while a television plays the film. + * + * Only what it is told: the receiver's position on the film's timeline (null + * until the receiver has answered), its state, and whether a seek is on its + * way. The scrubber reports a drag as it moves and a seek once let go. + */ +function CastRemote({ device, position, duration, playerState, moving, + onDrag, onSeek, onToggle, onStop }) { + const known = position !== null; + const paused = playerState === 'PAUSED'; + const busy = !known || moving || playerState === 'BUFFERING' || playerState === 'LOADING'; + const pct = known && duration > 0 ? Math.min(100, (position / duration) * 100) : 0; + return html` +
+
+ <${Icon} name="cast" /> + ${t('cast.casting_to')} + ${device} + + ${busy ? html`${' '}${t('cast.waiting')}` : ''} + +
+
+ 0)} + aria-label=${t('cast.seek')} + onInput=${(e) => onDrag(+e.target.value)} + onChange=${(e) => onSeek(+e.target.value)} /> +
+ ${known ? formatClock(position) : '–:––'} + ${duration > 0 ? formatClock(duration) : '–:––'} +
+
+
+ + + +
+ +
+ `; +} + /** * Where *this account on this device* last left off in a given file. * @@ -1907,7 +1965,7 @@ function VideoPlayer({ entry, transportRef, gekRef, onClose, onDownload }) { ${(phase === 'streaming' || phase === 'loading') && html` -
+