Skip to content

Commit

Permalink
feat(route/bsky): replace video thumbnail with video player (#17499)
Browse files Browse the repository at this point in the history
* feat(route/bsky): replace video thumbnail with video player

* Update lib/routes/bsky/templates/post.art

---------
  • Loading branch information
AiraNadih authored Nov 10, 2024
1 parent d2905cf commit 468bfcd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 0 additions & 1 deletion lib/routes/bsky/posts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ async function handler(ctx) {
text: post.record.text.replaceAll('\n', '<br>'),
embed: post.embed,
// embed.$type "app.bsky.embed.record#view" and "app.bsky.embed.recordWithMedia#view" are not handled
// "app.bsky.embed.video#view" is rendered as image
}),
author: post.author.displayName,
pubDate: parseDate(post.record.createdAt),
Expand Down
9 changes: 8 additions & 1 deletion lib/routes/bsky/templates/post.art
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@
<img src="{{ i.fullsize }}" alt="{{ i.alt }}"><br>
{{ /each }}
{{ else if embed.$type === 'app.bsky.embed.video#view' }}
<img src="{{ embed.thumbnail }}"><br>
<video
controls
poster="{{ embed.thumbnail }}"
style="max-width: 100%; height: auto;"
preload="metadata">
<source src="{{ embed.playlist }}" type="application/x-mpegURL">
Your browser does not support HTML5 video playback.
</video><br>
{{ else if embed.$type === 'app.bsky.embed.external#view' }}
<a href="{{ embed.external.uri }}"><b>{{ embed.external.title }}</b><br>
{{ embed.external.description }}
Expand Down

0 comments on commit 468bfcd

Please sign in to comment.