mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
26 lines
770 B
JavaScript
26 lines
770 B
JavaScript
"use client";
|
|
import { useComposedRefs } from "../../utils/use-composed-refs.js";
|
|
import { useMediaAttach } from "../../player/context.js";
|
|
import { forwardRef, useCallback } from "react";
|
|
import { jsx } from "react/jsx-runtime";
|
|
//#region src/media/background-video/media.tsx
|
|
const BackgroundVideo = forwardRef(function BackgroundVideo({ children, ...props }, ref) {
|
|
const setMedia = useMediaAttach();
|
|
return /* @__PURE__ */ jsx("video", {
|
|
ref: useComposedRefs(ref, useCallback((el) => {
|
|
setMedia?.(el);
|
|
}, [setMedia])),
|
|
muted: true,
|
|
autoPlay: true,
|
|
loop: true,
|
|
playsInline: true,
|
|
disableRemotePlayback: true,
|
|
disablePictureInPicture: true,
|
|
...props,
|
|
children
|
|
});
|
|
});
|
|
//#endregion
|
|
export { BackgroundVideo };
|
|
|
|
//# sourceMappingURL=media.js.map
|