Changeset 6100ce9 in Klonkt
- Timestamp:
- 07/29/2026 12:12:38 PM (6 weeks ago)
- Branches:
- main
- Children:
- d56d471
- Parents:
- 08ab8ad
- Files:
-
- 2 edited
-
src/services/ActivityPubService.js (modified) (1 diff)
-
test/gated-settings.test.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/services/ActivityPubService.js
r08ab8ad r6100ce9 3099 3099 // player for PeerTube. Without one the card stays a thumbnail. 3100 3100 const player = playback ? playerUrlFor(e.url) : null; 3101 return player ? { ...e, 'shaer:playerUrl': player } : e; 3101 if (player) return { ...e, 'shaer:playerUrl': player }; 3102 // The gate is shut and there IS something behind it. Saying so costs 3103 // nothing (the card already shows a video thumbnail) and saves the child 3104 // from tapping a card that will never answer: the app can explain instead 3105 // of doing nothing. It stays a statement of fact, never a way in. 3106 return playerUrlFor(e.url) ? { ...e, 'shaer:playable': true } : e; 3102 3107 } catch { return undefined; } 3103 3108 } -
test/gated-settings.test.js
r08ab8ad r6100ce9 162 162 assert.ok(shut && shut.url, 'the card itself still travels'); 163 163 assert.equal(shut['shaer:playerUrl'], undefined, 'no player without the gate'); 164 // But the card says there IS something behind the gate, so the app can 165 // explain the silence instead of ignoring a tap. Robin tapped a video that 166 // could not answer and nothing happened, which reads as broken, not as shut. 167 assert.equal(shut['shaer:playable'], true, 'a shut gate still admits that a player exists'); 164 168 165 169 const open = AP2.timelineEmbed(yt, { playback: true }); … … 173 177 const page = JSON.stringify({ url: 'https://yougubrands.com/about', title: 'About', media: [] }); 174 178 assert.equal(AP2.timelineEmbed(page, { playback: true })['shaer:playerUrl'], undefined); 179 // And no promise of one either: a news article is not a shut gate, it is 180 // simply not a video, and the app must not offer to ask for it. 181 assert.equal(AP2.timelineEmbed(page)['shaer:playable'], undefined); 175 182 assert.equal(AP2.playerUrlFor('https://nos.nl/artikel/1'), null); 176 183 // PeerTube is decentralised, so it is matched by shape, not by a host list.
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)