-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Video Embeds #5320
base: main
Are you sure you want to change the base?
Video Embeds #5320
Conversation
bskyweb/cmd/bskyweb/server.go
Outdated
} else if postView.Embed.EmbedVideo_View != nil { | ||
data["width"] = postView.Embed.EmbedVideo_View.AspectRatio.Width | ||
data["height"] = postView.Embed.EmbedVideo_View.AspectRatio.Height | ||
data["videoUrl"] = fmt.Sprintf("https://%s/xrpc/com.atproto.sync.getBlob?did=did:plc:%s&cid=%s", srv.xrpcc.Host, did, postView.Embed.EmbedVideo_View.Cid) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is rather janky, but it should work, open to more real suggestions
} else if postView.Embed.EmbedVideo_View != nil { | ||
data["width"] = postView.Embed.EmbedVideo_View.AspectRatio.Width | ||
data["height"] = postView.Embed.EmbedVideo_View.AspectRatio.Height | ||
data["videoUrl"] = fmt.Sprintf("https://%s/xrpc/com.atproto.sync.getBlob?did=%s&cid=%s", srv.xrpcc.Host, did, postView.Embed.EmbedVideo_View.Cid) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
xrpcc
is instantiated with the AppView URL, and AppView does not store raw blobs, so this doesn't actually work- We'd have to resolve the actual PDS that the user actually resides in
- Problem is, this can incur unexpected egress for third-party PDSes, especially noticaeble as videos in Bluesky app itself is taken care of by the CDN. Might not matter much to PDSes hosted in datacenters, but it's a dealbreaker for PDSes in home servers.
Can og:video:url
be pointed to a web page or somewhere? Not sure if pointing to an HLS stream (.m3u8
) is possible or not (it probably isn't, because the only browser supporting HLS natively is Safari), not sure how sites like Discord handles this sort of thing.
The easiest alternative right now would be to just show the video thumbnail, it's definitely not great but it's better than nothing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
video urls can technically be any random object of your desire, for example youtube provides <meta property="og:video:url" content="https://www.youtube.com/embed/kq39g2vSsKo">
. However most sites will have a whitelist of what providers are allowed to use an html embed, and all others are forced to use a well-known video container/encoding. If there's no such cdn asset available and bluesky relies on m3u8, and this appview doesn't provide a whitelisted player embed like youtube does, a thumbnail is probably the best you can do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since cbsky.app already handles video embeds properly, I wonder how it would react to a video stored on an external PDS (or even a currently-offline PDS). I wonder if it would be considered "sanitary" to link to the blob directly like cbsky does, just fetching it from the PDS directly instead of going through the CDN.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I've mentioned this:
Problem is, this can incur unexpected egress for third-party PDSes, especially noticaeble as videos in Bluesky app itself is taken care of by the CDN. Might not matter much to PDSes hosted in datacenters, but it's a dealbreaker for PDSes in home servers.
I've started an attempt at allowing video embeds for other platforms such as Discord as requested in #5267. I'm not sure how to properly get the video URL or if that is even available in the atprotocol spec yet so I'm leaving this as a draft for now.