1- import { css } from '@emotion/react' ;
2- import { space } from '@guardian/source/foundations' ;
31import type { FEAspectRatio } from '../frontend/feFront' ;
42import { isInteractive } from '../layouts/lib/interactiveLegacyStyling' ;
53import type { ArticleFormat } from '../lib/articleFormat' ;
@@ -13,10 +11,6 @@ import type { VideoPlayerFormat } from '../types/mainMedia';
1311import { Island } from './Island' ;
1412import { SelfHostedVideo } from './SelfHostedVideo.island' ;
1513
16- const containerStyles = css `
17- margin-bottom : ${ space [ 3 ] } px;
18- ` ;
19-
2014type SelfHostedVideoInArticleProps = {
2115 element : MediaAtomBlockElement ;
2216 format : ArticleFormat ;
@@ -49,39 +43,34 @@ export const SelfHostedVideoInArticle = ({
4943 }
5044
5145 return (
52- < div css = { containerStyles } >
53- < Island priority = "critical" defer = { { until : 'visible' } } >
54- < SelfHostedVideo
55- atomId = { element . id }
56- fallbackImage = { posterImageUrl }
57- fallbackImageAlt = { caption }
58- fallbackImageAspectRatio = {
59- ( firstVideoSource ?. aspectRatio ??
60- '5:4' ) as FEAspectRatio
61- }
62- fallbackImageLoading = "lazy"
63- fallbackImageSize = "small"
64- aspectRatio = { aspectRatio }
65- linkTo = "Article-embed-MediaAtomBlockElement"
66- posterImage = { posterImageUrl }
67- posterImageAspectRatio = {
68- firstVideoSource ?. aspectRatio ?? '5:4'
69- }
70- sources = { sources }
71- subtitleSize = "medium"
72- subtitleSource = { getSubtitleAsset ( element . assets ) }
73- videoStyle = { videoStyle }
74- uniqueId = { element . id }
75- caption = { caption }
76- format = { format }
77- isMainMedia = { isMainMedia }
78- role = { role }
79- preventAutoplay = { videoStyle === 'Default' }
80- restrictHeightOnDesktop = {
81- isVerticalVideo && ! isInteractive ( format . design )
82- }
83- />
84- </ Island >
85- </ div >
46+ < Island priority = "critical" defer = { { until : 'visible' } } >
47+ < SelfHostedVideo
48+ atomId = { element . id }
49+ fallbackImage = { posterImageUrl }
50+ fallbackImageAlt = { caption }
51+ fallbackImageAspectRatio = {
52+ ( firstVideoSource ?. aspectRatio ?? '5:4' ) as FEAspectRatio
53+ }
54+ fallbackImageLoading = "lazy"
55+ fallbackImageSize = "small"
56+ aspectRatio = { aspectRatio }
57+ linkTo = "Article-embed-MediaAtomBlockElement"
58+ posterImage = { posterImageUrl }
59+ posterImageAspectRatio = { firstVideoSource ?. aspectRatio ?? '5:4' }
60+ sources = { sources }
61+ subtitleSize = "medium"
62+ subtitleSource = { getSubtitleAsset ( element . assets ) }
63+ videoStyle = { videoStyle }
64+ uniqueId = { element . id }
65+ caption = { caption }
66+ format = { format }
67+ isMainMedia = { isMainMedia }
68+ role = { role }
69+ preventAutoplay = { videoStyle === 'Default' }
70+ restrictHeightOnDesktop = {
71+ isVerticalVideo && ! isInteractive ( format . design )
72+ }
73+ />
74+ </ Island >
8675 ) ;
8776} ;
0 commit comments