Commit e750c85e authored by 李纪文's avatar 李纪文

feat: 视频回放增加进度条

parent 80ed985d
...@@ -31,10 +31,11 @@ const RecVideo = (props, ref) => { ...@@ -31,10 +31,11 @@ const RecVideo = (props, ref) => {
useEffect(() => { useEffect(() => {
let current = percent; let current = percent;
if (loading) timeRef.current = setInterval(() => { if (loading)
timeRef.current = setInterval(() => {
current = current + 1; current = current + 1;
setPercent(current > 99 ? 99 : current); setPercent(current > 99 ? 99 : current);
}, 40); }, 20);
return () => { return () => {
if (timeRef.current) { if (timeRef.current) {
...@@ -42,7 +43,7 @@ const RecVideo = (props, ref) => { ...@@ -42,7 +43,7 @@ const RecVideo = (props, ref) => {
timeRef.current = null; timeRef.current = null;
setPercent(0); setPercent(0);
} }
} };
}, [loading]); }, [loading]);
useImperativeHandle(ref, () => { useImperativeHandle(ref, () => {
...@@ -143,7 +144,11 @@ const RecVideo = (props, ref) => { ...@@ -143,7 +144,11 @@ const RecVideo = (props, ref) => {
{loading ? ( {loading ? (
<> <>
<div className={classNames(`${prefixCls}-load`)}> <div className={classNames(`${prefixCls}-load`)}>
<Progress className={classNames(`${prefixCls}-progress`)} strokeWidth={14} percent={percent} /> <Progress
className={classNames(`${prefixCls}-progress`)}
strokeWidth={14}
percent={percent}
/>
<span>视频回放信息获取中,请稍后...</span> <span>视频回放信息获取中,请稍后...</span>
</div> </div>
</> </>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment