-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -454,6 +454,10 @@ func (srv *Server) WebPost(c echo.Context) error { | |
thumbUrls = append(thumbUrls, postView.Embed.EmbedRecordWithMedia_View.Media.EmbedImages_View.Images[i].Thumb) | ||
} | ||
data["imgThumbUrls"] = thumbUrls | ||
} 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 commentThe reason will be displayed to describe this comment to others. Learn more.
Can 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 commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I've mentioned this:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These should definitely use a CDN URL, not a direct link to blob on the PDS. If it needs to just be a thumbnail image instead of the actual video, that is too bad but fine. cc: @ericvolp12 on thoughts on this specifically. |
||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,11 @@ | |
|
||
{% block html_head_extra -%} | ||
{%- if postView -%} | ||
{%- if videoUrl %} | ||
<meta property="og:type" content="video.other"> | ||
{% else %} | ||
<meta property="og:type" content="article"> | ||
{% endif %} | ||
<meta property="profile:username" content="{{ profileView.Handle }}"> | ||
{%- if requestURI %} | ||
<meta property="og:url" content="{{ requestURI }}"> | ||
|
@@ -33,6 +37,15 @@ | |
{# Don't use avatar image in cards; usually looks bad #} | ||
<meta name="twitter:card" content="summary"> | ||
{% endif %} | ||
{%- if videoUrl %} | ||
<meta property="og:video:type" content="video/mp4"> | ||
<meta property="og:video:height" content="{{ height }}"> | ||
<meta property="og:video:width" content="{{ width }}"> | ||
<meta property="og:image:height" content="{{ height }}"> | ||
<meta property="og:image:width" content="{{ width }}"> | ||
Comment on lines
+44
to
+45
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why both image and video? |
||
<meta property="og:video:secure_url" content="{{ videoUrl }}"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see |
||
<meta property="og:video:url" content="{{ videoUrl }}"> | ||
{% endif %} | ||
<meta name="twitter:label1" content="Posted At"> | ||
<meta name="twitter:value1" content="{{ postView.IndexedAt }}"> | ||
<meta name="article:published_time" content="{{ postView.IndexedAt }}"> | ||
|
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.
I'd prefix all of these fields consistently, like
videoWidth