/** @format */ import 'video-react/dist/video-react.css'; // import css import './index.less'; import merge from 'lodash/merge'; import React, { useEffect, useRef, useState } from 'react'; import { ControlBar, CurrentTimeDisplay, ForwardControl, // 前进按钮 PlaybackRateMenuButton, // 倍速播放选项 Player, PlayToggle, // PlayToggle 播放/暂停按钮 若需禁止加 disabled ReplayControl, // 后退按钮 TimeDivider, VolumeMenuButton, } from 'video-react'; const styleBase = { width: 460, height: 260, }; interface VideoProps { size?: Record; url: string; autoPlay: boolean; muted: boolean; loop: boolean; title?: string; } const Video = (props: VideoProps) => { const { size, url, autoPlay = true, muted = false, loop = false } = props; const videoRef = useRef(null); const style = merge(styleBase, size); useEffect(() => {}, [videoRef]); return (
); }; export default Video;