@@ -13,12 +13,10 @@ import type {
1313 SyntheticEvent ,
1414} from 'react' ;
1515import { forwardRef } from 'react' ;
16- import type { ActiveCue } from '../lib/useSubtitles' ;
1716import type { Source } from '../lib/video' ;
1817import { palette } from '../palette' ;
1918import { narrowPlayIconWidth , PlayIcon } from './Card/components/PlayIcon' ;
2019import { LoopVideoProgressBar } from './LoopVideoProgressBar' ;
21- import { SubtitleOverlay } from './SubtitleOverlay' ;
2220
2321export type SubtitleSize = 'small' | 'medium' | 'large' ;
2422
@@ -37,10 +35,8 @@ const videoStyles = (
3735 object- fit: cover;
3836
3937 ::cue {
40- /* Hide the cue by default as we prefer custom overlay */
41- visibility : hidden;
42-
4338 color: ${ palette ( '--loop-video-subtitle-text' ) } ;
39+
4440 ${ subtitleSize === 'small' && textSans15 } ;
4541 ${ subtitleSize === 'medium' && textSans17 } ;
4642 ${ subtitleSize === 'large' && textSans20 } ;
@@ -123,8 +119,6 @@ type Props = {
123119 showPlayIcon : boolean ;
124120 subtitleSource ?: string ;
125121 subtitleSize : SubtitleSize ;
126- /* used in custom subtitle overlays */
127- activeCue ?: ActiveCue | null ;
128122} ;
129123
130124/**
@@ -164,11 +158,11 @@ export const LoopVideoPlayer = forwardRef(
164158 showPlayIcon,
165159 subtitleSource,
166160 subtitleSize,
167- activeCue,
168161 } : Props ,
169162 ref : React . ForwardedRef < HTMLVideoElement > ,
170163 ) => {
171164 const loopVideoId = `loop-video-${ uniqueId } ` ;
165+
172166 return (
173167 < >
174168 { /* eslint-disable-next-line jsx-a11y/media-has-caption -- Captions will be considered later. */ }
@@ -219,23 +213,13 @@ export const LoopVideoPlayer = forwardRef(
219213 ) ) }
220214 { subtitleSource !== undefined && (
221215 < track
222- // Don't use default - it forces native rendering on iOS
223- default = { false }
216+ default = { true }
224217 kind = "subtitles"
225218 src = { subtitleSource }
226- // Add label to ensure iOS recognizes it
227- label = "English"
228- srcLang = "en"
229219 />
230220 ) }
231221 { FallbackImageComponent }
232222 </ video >
233- { ! ! activeCue ?. text && (
234- < SubtitleOverlay
235- text = { activeCue . text }
236- subtitleSize = { subtitleSize }
237- />
238- ) }
239223 { ref && 'current' in ref && ref . current && isPlayable && (
240224 < >
241225 { /* Play icon */ }
0 commit comments