update 当前播放视频时长
This commit is contained in:
parent
f92523c333
commit
f0ef2a827d
@ -74,9 +74,12 @@ export default function VideoIndex() {
|
||||
useEffect(loadList, [])
|
||||
const totalDuration = useMemo(() => {
|
||||
if (!videoData || videoData.length == 0) return 0;
|
||||
if(state.playingIndex == -1 || state.playingIndex >= videoData.length) return 0
|
||||
const v= videoData[state.playingIndex] as VideoInfo;
|
||||
return Math.ceil(v.duration / 1000)
|
||||
// 计算总时长
|
||||
return videoData.reduce((sum, v) => sum + Math.ceil(v.duration / 1000), 0);
|
||||
}, [videoData])
|
||||
//return videoData.reduce((sum, v) => sum + Math.ceil(v.duration / 1000), 0);
|
||||
}, [videoData,state.playingIndex])
|
||||
|
||||
return (<div className="container py-10 page-live">
|
||||
{contextHolder}
|
||||
@ -171,6 +174,7 @@ export default function VideoIndex() {
|
||||
</DndContext>
|
||||
</div>
|
||||
}
|
||||
<div className="h-[100px]"></div>
|
||||
</InfiniteScroller>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user