#200 motion photo (Live Photo) support
Show a badge on the gallery thumbnail and a lightbox toggle that plays the photo's clip over the still, matching Immich's own viewer. The clip is a hidden Immich asset, but the existing share key already authorises it - checkSharedLinkAccess whitelists each shared asset's livePhotoVideoId - so no new upstream access is involved. The video route accepts a clip id only when a shared still points at it. Both enumeration paths already carry the field (AssetResponseDto for individual shares, TimeBucketAssetResponseDto for album buckets), so album shares cost no extra upstream requests. Gated by ipp.motionPhotos (default true). The clip is preload="none" and is only fetched when a visitor presses the toggle.
This commit is contained in:
@@ -139,6 +139,28 @@ html.pswp-no-arrows .pswp__button--arrow {
|
||||
background: #000;
|
||||
}
|
||||
|
||||
/* Motion photo (Live Photo) clip. It lives inside the slide's zoom wrap, which
|
||||
carries PhotoSwipe's pan/zoom transform, so it stays pinned to the still
|
||||
underneath through zoom, pan and resize with no geometry tracking in JS. */
|
||||
.pswp__motion-video {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: contain;
|
||||
pointer-events: none; /* PhotoSwipe keeps handling drag / zoom / swipe */
|
||||
}
|
||||
|
||||
.pswp__zoom-wrap.pswp--motion-playing .pswp__img {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
/* PhotoSwipe's `.pswp__button { display: block }` outranks the browser's
|
||||
`[hidden]` rule, so a toolbar button that hides itself needs this. */
|
||||
.pswp__button[hidden] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Smooth backdrop fade in/out to match Immich's open/close feel */
|
||||
.pswp__bg {
|
||||
transition: opacity var(--pswp-transition-duration);
|
||||
|
||||
@@ -213,6 +213,24 @@ html, body {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
/* Motion photo (Live Photo) indicator, top-right to match Immich's grid */
|
||||
.motion-icon {
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
right: 4px;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
color: #fff;
|
||||
opacity: 0.85;
|
||||
filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.motion-icon svg {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* ===== Header (title + asset count + download action) ===== */
|
||||
|
||||
#header {
|
||||
|
||||
Reference in New Issue
Block a user