File tree Expand file tree Collapse file tree
dotcom-rendering/src/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { css } from '@emotion/react' ;
2- import {
3- space ,
4- textSans15 ,
5- textSans17 ,
6- textSans20 ,
7- } from '@guardian/source/foundations' ;
2+ import { space } from '@guardian/source/foundations' ;
83import type { IconProps } from '@guardian/source/react-components' ;
94import type { ReactElement , SyntheticEvent } from 'react' ;
105import { forwardRef } from 'react' ;
@@ -38,15 +33,21 @@ const interactiveStyles = css`
3833 cursor : pointer;
3934` ;
4035
41- const subtitleStyles = ( subtitleSize : SubtitleSize | undefined ) => css `
36+ const nativeSubtitleStyles = css `
4237 ::cue {
4338 /* Hide the cue by default as we prefer custom overlay */
4439 visibility : hidden;
45-
4640 color : ${ palette ( '--video-subtitle-text' ) } ;
47- ${ subtitleSize === 'small' && textSans15 } ;
48- ${ subtitleSize === 'medium' && textSans17 } ;
49- ${ subtitleSize === 'large' && textSans20 } ;
41+ }
42+
43+ /* Display the native cues when in fullscreen */
44+
45+ & : fullscreen ::cue {
46+ visibility : visible;
47+ }
48+
49+ & : -webkit-full-screen ::cue {
50+ visibility : visible;
5051 }
5152` ;
5253
@@ -206,7 +207,7 @@ export const SelfHostedVideoPlayer = forwardRef(
206207 css = { [
207208 videoStyles ( aspectRatio ) ,
208209 isInteractive && interactiveStyles ,
209- showSubtitles && subtitleStyles ( subtitleSize ) ,
210+ showSubtitles && nativeSubtitleStyles ,
210211 ] }
211212 crossOrigin = "anonymous"
212213 ref = { ref }
You can’t perform that action at this time.
0 commit comments