feat(preview): play videos inline in the lightbox overlay
Switch the preview overlay from a still <img> to a <video> tag when the focused photo's Type is "video". Uses PhotoPrism's /api/v1/videos/:hash endpoint with the existing previewToken, falls back to a still thumb as the poster, and autoplays muted so the controls reveal without clobbering whatever else is on the page. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -87,3 +87,14 @@ export function thumbUrl(hash: string, size = 'tile_500'): string {
|
||||
if (!session.previewToken) return '';
|
||||
return `/api/v1/t/${hash}/${session.previewToken}/${size}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a video stream URL. PhotoPrism's endpoint is
|
||||
* /api/v1/videos/:hash/:token/:format — same previewToken as thumbnails.
|
||||
* `format=avc` is the standard h264 transcode; HEVC sources are
|
||||
* transcoded on first request and cached server-side.
|
||||
*/
|
||||
export function videoUrl(hash: string, format = 'avc'): string {
|
||||
if (!session.previewToken) return '';
|
||||
return `/api/v1/videos/${hash}/${session.previewToken}/${format}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user