Skip to content

Commit a690a4a

Browse files
committed
fix showSubtitles flag
1 parent 25b02ab commit a690a4a

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

dotcom-rendering/src/components/SelfHostedVideoPlayer.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,7 @@ export const SelfHostedVideoPlayer = forwardRef(
171171
) => {
172172
const videoId = `video-${uniqueId}`;
173173
const showSubtitles =
174-
videoStyle !== 'Cinemagraph' &&
175-
!!subtitleSource &&
176-
!!subtitleSize &&
177-
!!activeCue?.text;
174+
videoStyle !== 'Cinemagraph' && !!subtitleSource && !!subtitleSize;
178175

179176
const showControls =
180177
videoStyle !== 'Cinemagraph' &&
@@ -236,7 +233,7 @@ export const SelfHostedVideoPlayer = forwardRef(
236233
type={source.mimeType}
237234
/>
238235
))}
239-
{subtitleSource !== undefined && (
236+
{showSubtitles && (
240237
<track
241238
// Don't use default - it forces native rendering on iOS
242239
default={false}
@@ -247,7 +244,7 @@ export const SelfHostedVideoPlayer = forwardRef(
247244
)}
248245
{FallbackImageComponent}
249246
</video>
250-
{showSubtitles && (
247+
{showSubtitles && !!activeCue?.text && (
251248
<SubtitleOverlay
252249
text={activeCue.text}
253250
subtitleSize={subtitleSize}

0 commit comments

Comments
 (0)