aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/src/meshbay_hub/static/platform.js
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-10-05 01:16:12 +0200
committerChristophe Besson <cbesson@gmail.com>2026-10-05 01:16:12 +0200
commit243bcf017b4957237b3ddf556bd0a37296eb8798 (patch)
tree7d0820796737aad4dcfb89de7bec1e7271759af6 /packages/meshbay-hub/src/meshbay_hub/static/platform.js
parentac8ed437659d765120d1b0cc9f83e942549b479f (diff)
downloadmeshbay-243bcf017b4957237b3ddf556bd0a37296eb8798.tar.gz
feat(cast): photos on the TV, and a television chosen once for the session
A cast button in Videos' toolbar, at the top of Photos, in an album's bar and in the lightbox, in a group and in Search alike. A television chosen there is kept for the session: a film opened plays on it with the player as its remote from the start, and a photo opened in the lightbox is shown on it, scaled to 1920x1080, upright, as JPEG. The lightbox gains a slideshow. The relay serves one photo at /image behind the stream's token, on the desktop and on Android; the shell, not the page, decides that the receiver loads it as a picture. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/platform.js')
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/platform.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/platform.js b/packages/meshbay-hub/src/meshbay_hub/static/platform.js
index 0174edc..3a0c628 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/platform.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/platform.js
@@ -460,6 +460,15 @@ export const cast = {
if (!bridge || !bridge.cast || !bridge.cast.subtitle) return null;
return bridge.cast.subtitle(sub);
},
+ // A photo for the receiver: `{ bytes, type }`, already scaled to the
+ // television. Absent from an older shell, so callers check `canShowImages`.
+ get canShowImages() {
+ return Boolean(bridge && bridge.cast && bridge.cast.image);
+ },
+ async image(img) {
+ if (!this.canShowImages) return null;
+ return bridge.cast.image(img);
+ },
async finish() {
if (!bridge || !bridge.cast) return false;
return bridge.cast.finish();