File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 10
10
width : 100% ;
11
11
height : 100% ;
12
12
filter : none;
13
+ object-fit : contain;
14
+ & .fill {
15
+ object-fit : cover;
16
+ }
13
17
}
14
18
15
19
.ie .video {
Original file line number Diff line number Diff line change @@ -181,11 +181,9 @@ const Video = ({
181
181
if ( isIE ( ) ) attributes . className = 'ie' ;
182
182
if ( autoplay ) attributes . autoPlay = true ;
183
183
184
- useEffect ( ( ) => {
185
- const videoEl = videoRef . current ;
186
- if ( ! videoEl ) return ;
187
- videoEl . style . objectFit = fill ? 'cover' : 'contain' ;
188
- } , [ fill , videoRef . current ] ) ;
184
+ let videoCl = styles . video ;
185
+ if ( fill ) videoCl += ' ' + styles . fill ;
186
+
189
187
190
188
return (
191
189
< div className = { styles . wrapper } >
@@ -200,7 +198,7 @@ const Video = ({
200
198
aria-label = { video ?. name || '' }
201
199
playsInline
202
200
disableRemotePlayback
203
- className = { styles . video }
201
+ className = { videoCl }
204
202
poster = { thumbnail && thumbnail . url ? thumbnail . url : video && video . thumbnail }
205
203
preload = { preload }
206
204
{ ...attributes }
You can’t perform that action at this time.
0 commit comments