Skip to content

Commit 40d3f04

Browse files
committed
rename posterImage to thumbnailImage
1 parent bd973a3 commit 40d3f04

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

dotcom-rendering/src/components/LoopVideo.importable.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type Props = {
1818
videoId: string;
1919
width?: number;
2020
height?: number;
21-
posterImage: string;
21+
thumbnailImage: string;
2222
fallbackImageComponent: JSX.Element;
2323
hasAudio?: boolean;
2424
};
@@ -28,7 +28,7 @@ export const LoopVideo = ({
2828
videoId,
2929
width = 600,
3030
height = 360,
31-
posterImage,
31+
thumbnailImage,
3232
fallbackImageComponent,
3333
hasAudio = true,
3434
}: Props) => {
@@ -169,7 +169,9 @@ export const LoopVideo = ({
169169
handleKeyDown={handleKeyDown}
170170
onError={onError}
171171
AudioIcon={AudioIcon}
172-
posterImage={prefersReducedMotion ? posterImage : undefined}
172+
thumbnailImage={
173+
prefersReducedMotion ? thumbnailImage : undefined
174+
}
173175
/>
174176
</div>
175177
);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const Default = {
2323
videoId: 'test-video-1',
2424
height: 337.5,
2525
width: 600,
26-
posterImage:
26+
thumbnailImage:
2727
'https://media.guim.co.uk/9bdb802e6da5d3fd249b5060f367b3a817965f0c/0_0_1800_1080/master/1800.jpg',
2828
fallbackImageComponent: (
2929
<CardPicture

dotcom-rendering/src/components/LoopVideoPlayer.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ type Props = {
5656
onError: (event: SyntheticEvent<HTMLVideoElement>) => void;
5757
AudioIcon: (iconProps: IconProps) => JSX.Element;
5858
/**
59-
* We show a poster image when the user has indicated that they do
59+
* We show a thumbnail image when the user has indicated that they do
6060
* not want videos to play automatically, e.g. prefers reduced motion.
6161
*/
62-
posterImage?: string;
62+
thumbnailImage?: string;
6363
};
6464

6565
/**
@@ -75,7 +75,7 @@ export const LoopVideoPlayer = forwardRef(
7575
height,
7676
hasAudio,
7777
fallbackImageComponent,
78-
posterImage,
78+
thumbnailImage,
7979
isPlayable,
8080
setIsPlayable,
8181
isPlaying,
@@ -99,13 +99,13 @@ export const LoopVideoPlayer = forwardRef(
9999
<video
100100
id={loopVideoId}
101101
ref={ref}
102-
preload={posterImage ? 'metadata' : 'none'}
102+
preload={thumbnailImage ? 'metadata' : 'none'}
103103
loop={true}
104104
muted={isMuted}
105105
playsInline={true}
106106
height={height}
107107
width={width}
108-
poster={posterImage ?? undefined}
108+
poster={thumbnailImage ?? undefined}
109109
onPlaying={() => {
110110
setIsPlaying(true);
111111
}}

0 commit comments

Comments
 (0)