Podcastindex-org / activitypub-spec-work

A working repository for activitypub work.
5 stars 1 forks source link

Proposal: Make the Podcast Episode Object more ActivityPub friendly #3

Open sebilasse opened 3 years ago

sebilasse commented 3 years ago

Hello there,

just wanted to mention the attachment property in ActivityPub. This is handled by many generic AP Servers while the description- and audio-property needs active work for other fediverse implementations to support Castopod etc. While I did also ask myself why there is and “image” property but no “audio” or “video” in the Vocab.

So, I'd propose two changes,

And I think it is a nice move to support VTT like caption, transcript, chapters. We could handle them as attachment too with Mime text/vtt and the kind, maybe conformant to WebVTT with these kinds

Please note also that instead of “explicit” the as:sensitive convention / proposed extension exists which others use.

Would love to get your thoughts, in any case, it would be good if projects like Castopod use it to document it in the federation.md document - the best way would be to create a Fediverse Enhancement Proposal for Podcasts …

See also https://socialhub.activitypub.rocks/t/seeking-opinions-on-time-based-content/1566

This is just a proposal …

  "@context": [
    "https://www.w3.org/ns/activitystreams",
    "https://github.com/Podcastindex-org/activitypub-spec-work/blob/main/docs/1.0.md"
  ],
  "type": ["PodcastEpisode", "Note"],
  "id": "https://podcast.demo/podcasts/DemoPodcast/episodes/example-episode",
  "attributedTo": "https://podcast.demo/podcasts/DemoPodcast",
  "to": ["https://www.w3.org/ns/activitystreams#Public"],
  "cc": ["https://podcast.demo/podcasts/DemoPodcast/followers"],
  "name": "An Example PodcastEpisode Object",
  "mediaType": "text/markdown",
  "content": "Here is the description for the **demo episode**!",
  "contentMap": {
    "en": "<p>Here is the description for the <strong>demo episode</strong>!</p>",
    "fr": "<p>Voici la description pour la <strong>démo de l’épisode</strong> !</p>"
  },
  "image": {
    "type": "Image",
    "mediaType": "image/jpeg",
    "url": "https://podcast.demo/media/example-episode_cover.jpg"
  },
  "attachment": [
  {
    "id": "https://podcast.demo/podcasts/activitypub/episodes/example-episode.mp3",
    "type": "Audio",
    "name": "An Example PodcastEpisode Object",
    "size": 1962804,
    "bitrate": 320000,
    "duration": 42,
    "url": {
      "href": "https://podcast.demo/media/example-episode.mp3",
      "type": "Link",
      "mediaType": "audio/mpeg"
    },
    "caption": "https://podcast.demo/media/example-episode/caption",
    "transcript": "https://podcast.demo/media/example-episode/transcript",
    "chapters": "https://podcast.demo/media/example-episode/chapters"
  }
  ],
  "partOfSeason": "https://podcast.demo/podcasts/DemoPodcast/seasons/1",
  "episodeNumber": 1,
  "explicit": false,
  "location": {
    "@type": "Place",
    "geo": {
      "@type": "GeoCoordinates",
      "latitude": "48.8566969",
      "longitude": "2.3514616"
    },
    "name": "Paris, France"
  },
  "discoverable": true,
  "replies": "https://podcast.demo/podcasts/DemoPodcast/episodes/example-episode/replies",
  "published": "2021-04-15T18:00:00Z"
}
aschrijver commented 3 years ago

(See also Using ActivityPub for Podcast Comments on SocialHub where this is discussed) and #4 (because you're invited to join).

yassinedoghri commented 3 years ago

Hey @sebilasse,

I didn't know that the type property could be an array, is it something that other activitypub implementations can parse? Won't they expect a string?

Is there a reason on why the attachment property is an array? Or, maybe I'm not understanding it correctly, I guess there could be more than one attachment (as you mentioned, captions and chapters could maybe go there).

Also, just a thought: podcasting comes with its own vocabulary, so there needs to be great care into naming as there could be trade-offs on both sides.

sebilasse commented 3 years ago

I didn't know that the type property could be an array, is it something that other activitypub implementations can parse? Won't they expect a string?

Is there a reason on why the attachment property is an array?

In ActivityPub anything (which is not marked as Functional in the spec. ) is an Array …

“Properties marked as being "Functional" can have only one value. Items not marked as "Functional" can have multiple values.” https://www.w3.org/TR/activitystreams-vocabulary/#h-properties

aschrijver commented 3 years ago

I didn't know that the type property could be an array, is it something that other activitypub implementations can parse? Won't they expect a string?

You can see an example of this in Example 8 of ActivityStreams Core spec. You are correct about possibility that other impls cannot parse this. In this case it is those impls that are not spec-compliant, so technically a bug on their end. I think spec compliance means they should take the first type specified in the array, which is in the activitystreams namespace, and ignore the other types they don't understand.

If you define an entire new actor type, like Podcast, then you are more flexible to create its definition as you want to set it up, and I'd encourage spec compliance in that. But it definitely needs some proper investigation before doing so.