Fix video thumbnail fallback
This commit is contained in:
parent
a13cfc9c33
commit
0f61a6272f
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue