Skip to content

Commit

Permalink
fix: Safari top/bottom border bug (#323)
Browse files Browse the repository at this point in the history
  • Loading branch information
luwes authored Dec 20, 2024
1 parent 439d96a commit d60d080
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/players/default-player.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const DefaultPlayer = forwardRef<HTMLVideoElement, Omit<MediaProps, 'ref'> & Pla
const showCustomBlur = isCustomPoster && blurDataURL !== asset?.blurDataURL;

if (showGeneratedBlur || showCustomBlur) {
imgStyleProps.gridArea = '1 / 1';
imgStyleProps.gridArea = '1/1';
imgStyleProps.width = '100%';
imgStyleProps.height = '100%';
imgStyleProps.color = 'transparent';
Expand Down Expand Up @@ -112,7 +112,7 @@ const DefaultPlayer = forwardRef<HTMLVideoElement, Omit<MediaProps, 'ref'> & Pla
suppressHydrationWarning
ref={forwardedRef}
style={{
gridArea: '1 / 1',
gridArea: '1/1',
}}
slot="media"
poster={poster}
Expand Down Expand Up @@ -140,7 +140,7 @@ const DefaultPlayer = forwardRef<HTMLVideoElement, Omit<MediaProps, 'ref'> & Pla
suppressHydrationWarning
ref={forwardedRef}
style={{
gridArea: '1 / 1',
gridArea: '1/1',
...style,
}}
controls={controls === false ? undefined : true}
Expand Down
1 change: 1 addition & 0 deletions src/components/video.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ const NextVideo = forwardRef<HTMLVideoElement, VideoProps>((props, forwardedRef)
<style>{
/* css */`
.next-video-container {
display: grid; /* Fixes a Safari aspect-ratio + height bug. */
position: relative;
width: 100%;
aspect-ratio: 16 / 9;
Expand Down

0 comments on commit d60d080

Please sign in to comment.