Skip to content

Commit bf2b308

Browse files
committed
fix showSubtitles flag
1 parent f8109d0 commit bf2b308

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

dotcom-rendering/src/components/LoopVideoPlayer.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,7 @@ export const LoopVideoPlayer = forwardRef(
171171
) => {
172172
const loopVideoId = `loop-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 LoopVideoPlayer = 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 LoopVideoPlayer = 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)