播放页面优化

This commit is contained in:
禺狨 2023-07-03 17:18:11 +08:00
parent 3780b8afc8
commit 8e96e2e844

View File

@ -36,6 +36,7 @@ const CoursePlayPage = () => {
const totalRef = useRef(0); const totalRef = useRef(0);
useEffect(() => { useEffect(() => {
window.player && window.player.destroy();
getCourse(); getCourse();
getDetail(); getDetail();
}, [params.courseId, params.hourId]); }, [params.courseId, params.hourId]);
@ -179,11 +180,11 @@ const CoursePlayPage = () => {
window.player.seek(playRef.current); window.player.seek(playRef.current);
return; return;
} }
setPlayingTime(0);
playTimeUpdate(parseInt(window.player.video.currentTime), true);
exitFullscreen(); exitFullscreen();
window.player && window.player.destroy(); window.player && window.player.destroy();
setPlayingTime(0);
setPlayendedStatus(true); setPlayendedStatus(true);
playTimeUpdate(parseInt(window.player.video.currentTime), true);
}); });
setLoading(false); setLoading(false);
}; };