Changeset 80797d7 in Klonkt


Ignore:
Timestamp:
06/30/2026 01:23:32 AM (2 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
f2eacca
Parents:
e954722
Message:

feat(federation): add schema.org/PeerTube embedUrl to playable-audio notes (experiment)

Mirrors how PeerTube exposes an embed endpoint: a playable-audio Note now carries an
embedUrl pointing at the gated /embed player page (no audio file is exposed — anti-steal
intact). If a Mastodon client honours embedUrl on a Note it can show an inline player;
otherwise it degrades to the existing twitter:player card. To be confirmed in the official
Mastodon mobile app (where external player cards don't play inline).

  • src/services/ActivityPubService.js (buildNote) — note.embedUrl = <base>/embed?post=<slug> for playable-audio posts

Co-Authored-By: Claude <noreply@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/services/ActivityPubService.js

    re954722 r80797d7  
    290290    if (cov) note.image = { type: 'Image', mediaType: mediaType(cov), url: cov };
    291291  }
     292  // Experiment (mirrors PeerTube / schema.org `embedUrl`): point at the GATED player page
     293  // (/embed) so a client that honours embedUrl can show an inline player WITHOUT ever
     294  // getting the audio file — the anti-steal posture is untouched. `embedUrl` is a real
     295  // standard field name (not a Klonkt invention); if Mastodon's apps honour it on a Note we
     296  // make it JSON-LD-clean with a context term, otherwise it degrades to the player card.
     297  if (playable) note.embedUrl = `${base}/embed?post=${encodeURIComponent(post.slug)}`;
    292298  return note;
    293299}
Note: See TracChangeset for help on using the changeset viewer.