Fix video thumbnail fallback

This commit is contained in:
MerlinScheurer 2025-02-15 11:42:08 +01:00
parent a13cfc9c33
commit 0f61a6272f
1 changed files with 8 additions and 4 deletions

View File

@ -45,10 +45,14 @@ const VideoListItem = ({
>
<div className={`video-thumb-wrap ${viewLayout}`}>
<div className="video-thumb">
<picture>
<img src={`${getApiUrl()}${video.vid_thumb_url}`} alt="video-thumb" />
<source srcSet={defaultVideoThumb} />
</picture>
<img
src={`${getApiUrl()}${video.vid_thumb_url}`}
alt="video-thumb"
onError={({ currentTarget }) => {
currentTarget.onerror = null; // prevents looping
currentTarget.src = defaultVideoThumb;
}}
/>
{video.player.progress && (
<div