Skip to content

Commit 59aa2a4

Browse files
committed
Implement video support in ImageDescription component, allowing .MP4 and other video formats to be displayed.
1 parent aa644ed commit 59aa2a4

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

src/lib/components/ImageDescription.svelte

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,19 @@
88
}
99
1010
let { src, alt, children }: Props = $props();
11+
12+
const videoExtensions = ['.mp4', '.webm', '.mov', '.avi', '.m4v'];
13+
const isVideo = videoExtensions.some((ext) => src.toLowerCase().endsWith(ext.toLowerCase()));
1114
</script>
1215

1316
<figure class="image-description">
14-
<img {src} {alt} loading="lazy" />
17+
{#if isVideo}
18+
<video {src} title={alt} autoplay loop muted playsinline>
19+
<source {src} type={`video/${src.split('.').pop() ?? 'mp4'}`} />
20+
</video>
21+
{:else}
22+
<img {src} {alt} loading="lazy" />
23+
{/if}
1524
{#if children}
1625
<figcaption>{@render children()}</figcaption>
1726
{/if}
@@ -27,7 +36,8 @@
2736
align-items: center;
2837
}
2938
30-
.image-description img {
39+
.image-description img,
40+
.image-description video {
3141
max-width: 100%;
3242
max-height: 60vh;
3343
height: auto;

src/lib/posts/aira.en.svx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ For service enhancement, I developed a **V2 version** implementing a **new inter
8383

8484
### Shorts-style Navigation & iOS 26 Liquid Glass
8585

86-
<ImageDescription src="/images/aira/aira_v2_main.gif" alt="aira V2 Shorts UI and Liquid Glass demo"/>
86+
<ImageDescription src="/images/aira/aira_v2_main.MP4" alt="aira V2 Shorts UI and Liquid Glass demo"/>
8787

8888
I introduced a **Full-screen Swipe UI** so users can enjoy characters like content.
8989

src/lib/posts/aira.ko.svx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ techStack: ['React Native', 'Expo', 'Flashlist', 'Reanimated', 'Firebase']
8383

8484
### 숏폼(Shorts) 스타일의 탐색 경험과 iOS 26 Liquid Glass
8585

86-
<ImageDescription src="/images/aira/aira_v2_main.gif" alt="aira V2 Shorts UI and Liquid Glass demo"/>
86+
<ImageDescription src="/images/aira/aira_v2_main.MP4" alt="aira V2 Shorts UI and Liquid Glass demo"/>
8787

8888
사용자가 캐릭터를 콘텐츠처럼 즐길 수 있도록 **풀스크린 스와이프 UI**를 도입했습니다.
8989

0 commit comments

Comments
 (0)