Skip to content

Commit ae9dfc3

Browse files
committed
Standard article card with video main media should play inline. Added a story.
1 parent b10f6ba commit ae9dfc3

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

dotcom-rendering/src/components/FeatureCard.stories.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,13 @@ export const YoutubeVideoCannotPlayInline = {
346346
},
347347
} satisfies Story;
348348

349+
export const YoutubeVideoMainMediaCannotPlayInline = {
350+
args: {
351+
...YoutubeVideoMainMedia.args,
352+
canPlayInline: false,
353+
},
354+
} satisfies Story;
355+
349356
export const WithTrailText = {
350357
args: {
351358
kickerText: undefined,

dotcom-rendering/src/components/FeatureCard.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,16 +256,14 @@ const getMedia = ({
256256
imageUrl,
257257
imageAltText,
258258
mainMedia,
259-
isVideoArticle,
260259
showVideo,
261260
}: {
262261
imageUrl?: string;
263262
imageAltText?: string;
264263
mainMedia?: MainMedia;
265-
isVideoArticle: boolean;
266264
showVideo?: boolean;
267265
}): Media | undefined => {
268-
if (isVideoArticle && mainMedia?.type === 'YoutubeVideo' && showVideo) {
266+
if (mainMedia?.type === 'YoutubeVideo' && showVideo) {
269267
return {
270268
type: 'youtube-video',
271269
mainMedia,
@@ -408,7 +406,6 @@ export const FeatureCard = ({
408406
imageUrl: image?.src,
409407
imageAltText: image?.altText,
410408
mainMedia,
411-
isVideoArticle,
412409
showVideo: showVideo && canPlayInline,
413410
});
414411

0 commit comments

Comments
 (0)