|
33 | 33 | </svg> |
34 | 34 | </button> |
35 | 35 |
|
36 | | - <!-- Photo display --> |
| 36 | + <!-- Photo/Video display --> |
37 | 37 | <div class="lychee-lightbox-content"> |
38 | 38 | <div class="lychee-lightbox-image-container"> |
| 39 | + <!-- Video player --> |
| 40 | + <video |
| 41 | + v-if="currentPhoto && currentPhoto.is_video" |
| 42 | + :src="getVideoUrl(currentPhoto)" |
| 43 | + class="lychee-lightbox-image" |
| 44 | + controls |
| 45 | + autoplay |
| 46 | + @loadeddata="handleImageLoad" |
| 47 | + @error="handleImageError" |
| 48 | + @click.stop |
| 49 | + :title="currentPhoto.title || undefined" |
| 50 | + > |
| 51 | + Your browser does not support the video tag. |
| 52 | + </video> |
| 53 | + |
| 54 | + <!-- Image display --> |
39 | 55 | <img |
40 | | - v-if="currentPhoto" |
| 56 | + v-else-if="currentPhoto" |
41 | 57 | :src="getPhotoUrl(currentPhoto)" |
42 | 58 | :alt="currentPhoto.title || 'Photo'" |
43 | 59 | class="lychee-lightbox-image" |
|
66 | 82 | <span>{{ [currentPhoto.exif.make, currentPhoto.exif.model].filter(Boolean).join(" ") }}</span> |
67 | 83 | </div> |
68 | 84 |
|
69 | | - <div v-if="currentPhoto.exif.lens" class="lychee-lightbox-exif-item"> |
| 85 | + <div v-if="!currentPhoto.is_video && currentPhoto.exif.lens" class="lychee-lightbox-exif-item"> |
70 | 86 | <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"> |
71 | 87 | <circle cx="12" cy="12" r="10"></circle> |
72 | 88 | <circle cx="12" cy="12" r="3"></circle> |
73 | 89 | </svg> |
74 | 90 | <span>{{ currentPhoto.exif.lens }}</span> |
75 | 91 | </div> |
76 | 92 |
|
77 | | - <div v-if="currentPhoto.exif.focal" class="lychee-lightbox-exif-item"> |
78 | | - <span class="lychee-lightbox-exif-label">{{ currentPhoto.exif.focal }}</span> |
| 93 | + <!-- Photo-specific EXIF (focal length, aperture, shutter) --> |
| 94 | + <div |
| 95 | + v-if=" |
| 96 | + !currentPhoto.is_video && |
| 97 | + (currentPhoto.exif.focal || |
| 98 | + currentPhoto.exif.aperture || |
| 99 | + currentPhoto.exif.shutter || |
| 100 | + currentPhoto.exif.iso) |
| 101 | + " |
| 102 | + class="lychee-lightbox-exif-item" |
| 103 | + > |
| 104 | + <span v-if="currentPhoto.exif.focal" class="lychee-lightbox-exif-label">{{ currentPhoto.exif.focal }}</span> |
79 | 105 | <span v-if="currentPhoto.exif.aperture" class="lychee-lightbox-exif-label" |
80 | 106 | >f/{{ currentPhoto.exif.aperture }}</span |
81 | 107 | > |
|
85 | 111 | <span v-if="currentPhoto.exif.iso" class="lychee-lightbox-exif-label">ISO {{ currentPhoto.exif.iso }}</span> |
86 | 112 | </div> |
87 | 113 |
|
| 114 | + <!-- Video-specific metadata (duration and framerate) --> |
| 115 | + <div |
| 116 | + v-if="currentPhoto.is_video && (currentPhoto.duration || currentPhoto.exif.focal)" |
| 117 | + class="lychee-lightbox-exif-item" |
| 118 | + > |
| 119 | + <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"> |
| 120 | + <rect x="2" y="2" width="20" height="20" rx="2.18" ry="2.18"></rect> |
| 121 | + <line x1="7" y1="2" x2="7" y2="22"></line> |
| 122 | + <line x1="17" y1="2" x2="17" y2="22"></line> |
| 123 | + <line x1="2" y1="12" x2="22" y2="12"></line> |
| 124 | + </svg> |
| 125 | + <span v-if="currentPhoto.duration" class="lychee-lightbox-exif-label">{{ currentPhoto.duration }}</span> |
| 126 | + <span v-if="currentPhoto.exif.focal" class="lychee-lightbox-exif-label" |
| 127 | + >{{ currentPhoto.exif.focal }} fps</span |
| 128 | + > |
| 129 | + <span v-if="currentPhoto.exif.iso" class="lychee-lightbox-exif-label">ISO {{ currentPhoto.exif.iso }}</span> |
| 130 | + </div> |
| 131 | + |
88 | 132 | <div v-if="currentPhoto.exif.taken_at" class="lychee-lightbox-exif-item"> |
89 | 133 | <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"> |
90 | 134 | <circle cx="12" cy="12" r="10"></circle> |
@@ -172,6 +216,14 @@ function getPhotoUrl(photo: Photo): string { |
172 | 216 | ); |
173 | 217 | } |
174 | 218 |
|
| 219 | +/** |
| 220 | + * Get the video URL for lightbox playback |
| 221 | + */ |
| 222 | +function getVideoUrl(photo: Photo): string { |
| 223 | + // For videos, always use the original size variant |
| 224 | + return photo.size_variants.original?.url || ""; |
| 225 | +} |
| 226 | +
|
175 | 227 | /** |
176 | 228 | * Format date for display |
177 | 229 | */ |
|
0 commit comments