Skip to content

Commit 2e6e8ad

Browse files
committed
Merge branch 'bose/3800' into staging
2 parents 5d18049 + 456f872 commit 2e6e8ad

4 files changed

Lines changed: 54 additions & 34 deletions

File tree

studio/schemas/objects/videoPlayer.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ export default {
9191
list: [
9292
{ title: 'Normal', value: 'normal' },
9393
{ title: 'Extra wide', value: 'extraWide' },
94+
{ title: 'Narrow', value: 'narrow' },
9495
],
9596
layout: 'dropdown',
9697
},

web/core/VideoJsPlayer/Video.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export type AspectRatioVariants =
2020
| '10:3'
2121
| '4:3'
2222
| '21:9'
23+
| '1:1'
2324

2425
export type Variants = 'default' | 'fullwidth'
2526

web/core/VideoJsPlayer/VideoPlayer.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ export const VideoPlayer: React.FC<VideoPlayerProps> = ({
139139
'9:16': 'aspect-9/16',
140140
'2:1': 'aspect-2/1',
141141
'4:3': 'aspect-4/3',
142+
'1:1': 'aspect-square',
142143
}
143144

144145
const variantClassName: Record<Variants, string> = {

web/sections/VideoPlayerBlock/VideoPlayerBlock.tsx

Lines changed: 51 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ import Transcript from '../Transcript/Transcript'
1717
export 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

2425
export 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

Comments
 (0)