index.tsx 768 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { FC, memo } from "react";
  2. import { Include, Plugin } from "..";
  3. import { is121Version } from "../../utils";
  4. export interface WebVRProps {
  5. url: string;
  6. [key: string]: unknown;
  7. }
  8. const WEBVR_121_CONFIG = {
  9. keep: true,
  10. devices: "webgl",
  11. };
  12. const WEBVR_119_CONFIG = {
  13. name: "WebVR",
  14. keep: true,
  15. devices: "html5",
  16. "multireslock.desktop": true,
  17. "multireslock.mobile.or.tablet": false,
  18. mobilevr_support: true,
  19. mobilevr_fake_support: true,
  20. };
  21. export const WebVR: FC<WebVRProps> = memo(({ url, ...attrs }) => {
  22. return (
  23. <>
  24. <Include url={url} />
  25. <Plugin
  26. name="WebVR"
  27. {...Object.assign(
  28. { ...(is121Version ? WEBVR_121_CONFIG : WEBVR_119_CONFIG) },
  29. attrs
  30. )}
  31. />
  32. </>
  33. );
  34. });