Skip to content

Commit 12042e4

Browse files
authored
🐛 Handles potentially undefined thumbnail URLs #3094 (#3095)
1 parent 93e6b5a commit 12042e4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

web/pageComponents/shared/Hero/LoopingVideo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const LoopingVideo = ({ video }: { video: LoopingVideoData }) => {
2626
autoPlay
2727
playButton={false}
2828
title={title}
29-
poster={thumbnailURL.src}
29+
poster={thumbnailURL?.src}
3030
src={url}
3131
videoDescription={thumbnail.alt}
3232
/>

web/pageComponents/shared/VideoPlayer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export const VideoComponentWithCaption = ({
9999
className="object-cover"
100100
src={video.url}
101101
title={video.title}
102-
poster={urlFor(video.thumbnail).width(w).height(h).url()}
102+
poster={urlFor(video.thumbnail?.asset).width(w).height(h).url()}
103103
playsInline
104104
aspectRatio={designOptions.aspectRatio}
105105
useBrandTheme={designOptions?.useBrandTheme}
@@ -143,7 +143,7 @@ export const VideoJsComponent = ({
143143
className="object-cover"
144144
src={video.url}
145145
title={video.title}
146-
poster={video.thumbnail && urlFor(video.thumbnail).width(w).height(h).url()}
146+
poster={video.thumbnail?.asset && urlFor(video.thumbnail).width(w).height(h).url()}
147147
playsInline
148148
aspectRatio={designOptions.aspectRatio}
149149
useBrandTheme={designOptions?.useBrandTheme}

0 commit comments

Comments
 (0)