Skip to content

Commit d398cad

Browse files
committed
Use correct image for media atom
1 parent 1c373fe commit d398cad

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

dotcom-rendering/src/model/enhanceCards.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,11 @@ const decideMediaAtomImage = (
176176
videoReplace: boolean,
177177
mediaAtom: FEMediaAtom,
178178
cardTrailImage?: string,
179+
isSelfHostedVideo?: boolean,
179180
) => {
180-
const largestMediaAtomImage = getLargestImageUrl(
181-
mediaAtom.trailImage?.allImages,
182-
);
181+
const largestMediaAtomImage = isSelfHostedVideo
182+
? getLargestImageUrl(mediaAtom.posterImage?.allImages)
183+
: getLargestImageUrl(mediaAtom.trailImage?.allImages);
183184

184185
if (videoReplace) {
185186
return largestMediaAtomImage ?? cardTrailImage;
@@ -213,6 +214,7 @@ export const getActiveMediaAtom = (
213214
videoReplace,
214215
mediaAtom,
215216
cardTrailImage,
217+
firstVideoAsset.platform === 'Url',
216218
);
217219

218220
/**

0 commit comments

Comments
 (0)