1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-04-26 19:08:26 -04:00

dynamically load react-player

This commit is contained in:
Jake Jarvis 2022-01-04 13:43:51 -05:00
parent 70778db89d
commit 6cde2944fc
Signed by: jake
GPG Key ID: 2B0C9CF251E69A39

View File

@ -1,8 +1,10 @@
import ReactPlayer from "react-player/lazy"; import dynamic from "next/dynamic";
import type { ReactPlayerProps } from "react-player"; import type { ReactPlayerProps } from "react-player";
import styles from "./FullPageVideo.module.scss"; import styles from "./FullPageVideo.module.scss";
const ReactPlayer = dynamic(() => import("react-player"));
const FullPageVideo = (props: ReactPlayerProps) => ( const FullPageVideo = (props: ReactPlayerProps) => (
<div className={styles.wrapper}> <div className={styles.wrapper}>
<ReactPlayer className={styles.react_player} width="100%" height="100%" {...props} /> <ReactPlayer className={styles.react_player} width="100%" height="100%" {...props} />