@@ -17,8 +17,9 @@ import Transcript from '../Transcript/Transcript'
1717export type VideoDesignOptionsType = {
1818 aspectRatio : AspectRatioVariants
1919 height ?: number
20- width ?: 'normal' | 'extraWide'
20+ width ?: 'normal' | 'extraWide' | 'narrow'
2121 useBrandTheme ?: boolean
22+ clipRoundedCornersPortrait ?: boolean
2223}
2324
2425export type VideoPlayerBlockProps = {
@@ -55,44 +56,60 @@ const VideoPlayerBlock = ({
5556 return (
5657 < section
5758 className = { twMerge (
58- `${ bg } ${ dark ? 'dark' : '' } ${ width === 'extraWide' ? 'px-layout-md' : 'px-layout-lg' } ` ,
59+ `mx-auto max-w-content ${ bg } ${ dark ? 'dark' : '' } ${ width === 'extraWide' ? 'px-layout-md' : 'px-layout-lg' } ` ,
5960 className ,
6061 ) }
6162 id = { anchor }
6263 >
63- { /* classname mb-2 pb-2 or common heading 2 styling pb-8 and inheriting pt-20 if applicable */ }
64- { title && < Blocks value = { title } variant = 'h2' /> }
65- { ingress && (
66- < Blocks
67- variant = 'ingress'
68- value = { ingress }
69- blockClassName = { `${ action ?. label && actionUrl ? 'mb-4' : 'mb-8' } ` }
70- />
71- ) }
72- { action ?. label && actionUrl && (
73- < ResourceLink
74- href = { actionUrl || '' }
75- file = { {
76- ...action ?. file ,
77- label : action ?. label ,
78- } }
79- variant = 'fit'
80- hrefLang = {
81- action ?. type === 'internalUrl'
82- ? getIsoFromName ( action ?. link ?. lang )
83- : undefined
84- }
85- className = 'mt-4 mb-8'
86- >
87- { action . label }
88- </ ResourceLink >
89- ) }
64+ < div className = { twMerge ( ( title || ingress || action ?. label ) && 'pb-6' ) } >
65+ { title && < Blocks value = { title } variant = 'h2' /> }
66+ { ingress && (
67+ < Blocks
68+ variant = 'ingress'
69+ value = { ingress }
70+ blockClassName = { `${ action ?. label && actionUrl ? 'mb-4' : 'mb-8' } ` }
71+ />
72+ ) }
73+ { action ?. label && actionUrl && (
74+ < ResourceLink
75+ href = { actionUrl || '' }
76+ file = { {
77+ ...action ?. file ,
78+ label : action ?. label ,
79+ } }
80+ variant = 'fit'
81+ hrefLang = {
82+ action ?. type === 'internalUrl'
83+ ? getIsoFromName ( action ?. link ?. lang )
84+ : undefined
85+ }
86+ className = 'mt-4 mb-8'
87+ >
88+ { action . label }
89+ </ ResourceLink >
90+ ) }
91+ </ div >
9092 { /*@ts -ignore: TODO*/ }
91- < VideoPlayer
92- { ...video }
93- { ...videoPlayerDesignOptions }
94- { ...videoControls }
95- />
93+ < div
94+ className = { twMerge (
95+ width === 'narrow' && 'mx-auto' ,
96+ width === 'narrow' &&
97+ videoPlayerDesignOptions ?. aspectRatio === '9:16' &&
98+ 'aspect-9/16 w-101.5 overflow-hidden rounded-card' ,
99+ width === 'narrow' &&
100+ videoPlayerDesignOptions ?. aspectRatio === '16:9' &&
101+ 'aspect-video w-200 overflow-hidden rounded-card' ,
102+ width === 'narrow' &&
103+ videoPlayerDesignOptions ?. aspectRatio === '1:1' &&
104+ 'aspect-square w-150 overflow-hidden rounded-card' ,
105+ ) }
106+ >
107+ < VideoPlayer
108+ { ...video }
109+ { ...videoPlayerDesignOptions }
110+ { ...videoControls }
111+ />
112+ </ div >
96113 < Transcript transcript = { transcript } ariaTitle = { video . title } />
97114 </ section >
98115 )
0 commit comments