Skip to content

Commit

Permalink
Show short silent videos as 'gifs' (i.e. looped and without controls)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmz committed Feb 4, 2025
1 parent dc20d18 commit cc759e3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/components/post/attachments/visual-container.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export function VisualContainer({
videoSrc: attachmentPreviewUrl(a.id, 'video'),
msrc: attachmentPreviewUrl(a.id, 'image'),
meta: a.meta ?? {},
duration: a.duration ?? 0,
}),
originalSrc: attachmentPreviewUrl(a.id, 'original'),
width: a.previewWidth ?? a.width,
Expand Down
2 changes: 1 addition & 1 deletion src/services/lightbox-actual.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ function initLightbox() {
lightbox.on('contentLoad', ({ content }) => {
const { data, element } = content;
if (data.type === 'video') {
if (data.meta.animatedImage) {
if (data.meta.animatedImage || (data.meta.silent && data.duration <= 5)) {
element.muted = true;
element.loop = true;
element.controls = false;
Expand Down

0 comments on commit cc759e3

Please sign in to comment.