Skip to content

Commit 8850973

Browse files
abeddow91Fweddi
authored andcommitted
Limit slideshows to cards which have explicitly set canPlayInline to true
1 parent 9ef6c5a commit 8850973

File tree

1 file changed

+12
-5
lines changed
  • dotcom-rendering/src/components/Card

1 file changed

+12
-5
lines changed

dotcom-rendering/src/components/Card/Card.tsx

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,14 @@ export type Props = {
9696
showClock?: boolean;
9797
mainMedia?: MainMedia;
9898
/**
99-
* Note YouTube recommends a minimum width of 480px @see https://developers.google.com/youtube/terms/required-minimum-functionality#embedded-youtube-player-size
100-
* At 300px or below, the player will begin to lose functionality e.g. volume controls being omitted.
101-
* Youtube requires a minimum width 200px.
99+
* For interactive media (e.g., video or slideshow), certain card sizes are restricted from displaying
100+
* the interactive content because controls may be unavailable or inaccessible at those sizes.
101+
*
102+
* Note:
103+
* - YouTube recommends a minimum embed width of 480px
104+
* @see https://developers.google.com/youtube/terms/required-minimum-functionality#embedded-youtube-player-size
105+
* - At widths of 300px or below, the player may lose functionality (e.g., volume controls may be omitted).
106+
* - YouTube requires an absolute minimum width of 200px.
102107
*/
103108
canPlayInline?: boolean;
104109
kickerText?: string;
@@ -281,7 +286,9 @@ const getMedia = ({
281286
mainMedia,
282287
} as const;
283288
}
284-
if (slideshowImages) return { type: 'slideshow', slideshowImages } as const;
289+
if (slideshowImages && canPlayInline) {
290+
return { type: 'slideshow', slideshowImages } as const;
291+
}
285292
if (avatarUrl) return { type: 'avatar', avatarUrl } as const;
286293
if (
287294
mainMedia?.type === 'Audio' &&
@@ -353,7 +360,7 @@ export const Card = ({
353360
avatarUrl,
354361
showClock,
355362
mainMedia,
356-
canPlayInline,
363+
canPlayInline = false,
357364
kickerText,
358365
showPulsingDot,
359366
starRating,

0 commit comments

Comments
 (0)