mirror of
https://github.com/mue/mue.git
synced 2026-07-19 15:04:11 +02:00
24 lines
576 B
JavaScript
24 lines
576 B
JavaScript
import { memo, useMemo } from 'react';
|
|
|
|
/**
|
|
* BackgroundVideo component for rendering video backgrounds
|
|
*/
|
|
function BackgroundVideo({ url, filterStyle }) {
|
|
const isMuted = useMemo(() => localStorage.getItem('backgroundVideoMute') === 'true', []);
|
|
const shouldLoop = useMemo(() => localStorage.getItem('backgroundVideoLoop') === 'true', []);
|
|
|
|
return (
|
|
<video
|
|
autoPlay
|
|
muted={isMuted}
|
|
loop={shouldLoop}
|
|
style={filterStyle}
|
|
id="backgroundVideo"
|
|
>
|
|
<source src={url} />
|
|
</video>
|
|
);
|
|
}
|
|
|
|
export default memo(BackgroundVideo);
|