Move video style to const var
This commit is contained in:
parent
9d19157654
commit
5b199b52b4
@ -230,18 +230,20 @@ const Video = forwardRef<VideoRef, ReactVideoProps>(
|
|||||||
onVolumeChange?.({volume: nativeRef.current.volume});
|
onVolumeChange?.({volume: nativeRef.current.volume});
|
||||||
}}
|
}}
|
||||||
onEnded={onEnd}
|
onEnded={onEnd}
|
||||||
style={{
|
style={videoStyle}
|
||||||
position: 'absolute',
|
|
||||||
inset: 0,
|
|
||||||
objectFit: 'contain',
|
|
||||||
width: '100%',
|
|
||||||
height: '100%',
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const videoStyle = {
|
||||||
|
position: 'absolute',
|
||||||
|
inset: 0,
|
||||||
|
objectFit: 'contain',
|
||||||
|
width: '100%',
|
||||||
|
height: '100%',
|
||||||
|
} satisfies React.CSSProperties;
|
||||||
|
|
||||||
const useMediaSession = (
|
const useMediaSession = (
|
||||||
metadata: VideoMetadata | undefined,
|
metadata: VideoMetadata | undefined,
|
||||||
nativeRef: RefObject<HTMLVideoElement>,
|
nativeRef: RefObject<HTMLVideoElement>,
|
||||||
|
Loading…
Reference in New Issue
Block a user