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

feat: 视频回放增加进度条

parent 80ed985d
......@@ -31,10 +31,11 @@ const RecVideo = (props, ref) => {
useEffect(() => {
let current = percent;
if (loading) timeRef.current = setInterval(() => {
current = current + 1;
setPercent(current > 99 ? 99 : current);
}, 40);
if (loading)
timeRef.current = setInterval(() => {
current = current + 1;
setPercent(current > 99 ? 99 : current);
}, 20);
return () => {
if (timeRef.current) {
......@@ -42,7 +43,7 @@ const RecVideo = (props, ref) => {
timeRef.current = null;
setPercent(0);
}
}
};
}, [loading]);
useImperativeHandle(ref, () => {
......@@ -143,7 +144,11 @@ const RecVideo = (props, ref) => {
{loading ? (
<>
<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>
</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