You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds schema.org VideoObject to the JSON-LD blob bskyweb already emits for posts and profiles. When a post has a video embed, the DiscussionForumPosting (and Comment, and profile hasPart[]) entries now include a video field with @type: VideoObject, name, description, thumbnailUrl, uploadDate, contentUrl (HLS playlist), embedUrl (canonical post URL), and width/height when the aspect ratio is available.
Refactors video-embed lookup into a shared findVideoEmbed helper used by both extractVideoMeta (og:video) and buildVideoObject (JSON-LD), so the two outputs cannot drift.
name falls back to Video by @<handle> when alt text is empty, then to Video on Bluesky for handle.invalid. description falls back to name when post text is empty, so Google rich-result requirements are always satisfied.
Honors the existing embedHidden gate (self/post-view labels) so labeled posts do not surface video metadata.
duration is omitted because the appview does not expose it.
Cross-check against schema.org VideoObject requirements
Post review
Summary
Nice refactor — pulling findVideoEmbed out of extractVideoMeta and sharing it with buildVideoObject is the right move; the two outputs are now structurally guaranteed to agree on whether a post has a video at all. Fallback chain (alt → Video by @handle → Video on Bluesky) and the empty-text→name description fallback satisfy Google's rich-result requirements. Test coverage is good (alt+aspect, both fallbacks, no playlist, hidden embed, record-with-media, reply, profile hasPart).
A few things worth a look:
1. embedUrl will be empty when the post's handle is handle.invalid
buildPostNode (bskyweb/cmd/bskyweb/jsonld.go:438-449) computes postURL via bskyPostURLFromATURI, which returns "" for handle.invalid per bskyPostURL (jsonld.go:131), then passes that as embedURL to buildVideoObject. With omitempty on EmbedURL, the video object on a handle.invalid post will have neither contentUrl-only is sometimes treated as a weaker rich-result signal by Google, and the surrounding discussionForumPosting.URL already falls back to the canonical URL in buildPostJSONLD (jsonld.go:538-540) — but that fallback doesn't propagate down to Video.EmbedURL.
You already have TestBuildPostJSONLD_HandleInvalidAuthor; consider either (a) passing the resolved post URL (canonical-form-fallback) into buildVideoObject, or (b) deriving the fallback inside buildVideoObject from pv.Uri/DID. Probably (a) — feed it the already-fallback node.URL.
2. contentUrl is the HLS playlist (.m3u8)
Google's video indexer docs ask contentUrl to be "the URL pointing to the actual video media file" in a supported encoding format, with HLS/DASH manifests being a known grey area (some properties get indexed, some don't). embedUrl (an HTML page with the player) is the more reliable signal for Bluesky's stack. Worth a short comment on videoObject.ContentURL noting the choice (and that the appview has no direct-media URL to offer) so future readers don't second-guess it.
3. width / height semantics
schema.org/VideoObject's width/height mean pixel dimensions. The appview's AspectRatio field name is misleading — the lexicon says it carries pixel counts, but many clients normalize to a reduced ratio like 16/9 before upload, in which case Google sees a 16×9-pixel video. Not a blocker (it's still a valid declaration of the ratio), but for sites that surface aspect ratio specifically the Rich Results test sometimes flags low absolute pixel counts as suspicious. Consider either omitting width/height entirely, or only emitting them when both values exceed, say, 100 (i.e. clearly pixel counts and not a reduced ratio).
4. uploadDate = pv.IndexedAt
IndexedAt is the appview's index timestamp, not when the video was uploaded. For most posts these are the same minute, but for backfilled or relay-delayed records they can diverge significantly. pv.Record.Val.(*appbsky.FeedPost).CreatedAt would be semantically closer to "uploadDate", with IndexedAt as a fallback if CreatedAt is missing or implausibly in the future. The existing DatePublished field on the post already uses IndexedAt, so there's a consistency argument for the current choice — fine to leave, but worth a comment.
5. Minor: buildVideoObject doesn't trim alt text
If a poster pastes a multi-kilobyte alt blob (unusual, but no enforcement), it lands verbatim in name. Google's title fields are de-facto short. A strings.TrimSpace plus a soft cap (e.g. first 110 chars) would be defensive without changing typical output. Optional.
6. Tests look good
The video-on-reply test (jsonld_test.go:1277) and the record-with-media test (jsonld_test.go:1251) cover the important fan-out cases. One small gap: there's no test covering EmbedURL for a handle.invalid author — adding one would have caught issue #1 above.
Nits
videoObject doc comment (jsonld.go:72) mentions duration omission, good — also worth noting interactionStatistic is omitted (Google recommends it for videos; viewCount via WatchAction is possible if/when the appview exposes it).
buildVideoObject signature (jsonld.go:215) takes postText even though that text is already available on the parent node. Not wrong, just a minor coupling — keeps the helper standalone, which is probably worth it.
Overall LGTM with #1 worth fixing before merge.
• Branch: app-2279
app-2279 - social-app PR #10814—d503e44e
Deployed
Jun 10, 2026 by
arcalinea
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds schema.org
VideoObjectto the JSON-LD blob bskyweb already emits for posts and profiles. When a post has a video embed, theDiscussionForumPosting(andComment, and profilehasPart[]) entries now include avideofield with@type: VideoObject, name, description, thumbnailUrl, uploadDate, contentUrl (HLS playlist), embedUrl (canonical post URL), and width/height when the aspect ratio is available.findVideoEmbedhelper used by bothextractVideoMeta(og:video) andbuildVideoObject(JSON-LD), so the two outputs cannot drift.namefalls back toVideo by @<handle>when alt text is empty, then toVideo on Blueskyforhandle.invalid.descriptionfalls back tonamewhen post text is empty, so Google rich-result requirements are always satisfied.embedHiddengate (self/post-view labels) so labeled posts do not surface video metadata.durationis omitted because the appview does not expose it.Tests