mirror of
https://github.com/PlayEdu/h5.git
synced 2025-06-07 14:14:11 +08:00
视频播放优化
This commit is contained in:
parent
aa54835a7b
commit
2859caf7a5
@ -44,7 +44,6 @@ const CoursePlayPage = () => {
|
||||
const totalRef = useRef(0);
|
||||
|
||||
useEffect(() => {
|
||||
window.player && window.player.destroy();
|
||||
getCourse();
|
||||
getDetail();
|
||||
}, [params.courseId, params.hourId]);
|
||||
@ -129,6 +128,7 @@ const CoursePlayPage = () => {
|
||||
const getVideoUrl = (data: any) => {
|
||||
Course.playUrl(Number(params.courseId), Number(params.hourId)).then(
|
||||
(res: any) => {
|
||||
window.player && window.player.destroy();
|
||||
setPlayUrl(res.data.url);
|
||||
initDPlayer(res.data.url, 0, data);
|
||||
}
|
||||
@ -236,7 +236,6 @@ const CoursePlayPage = () => {
|
||||
};
|
||||
|
||||
const playVideo = (cid: number, id: number) => {
|
||||
window.player && window.player.destroy();
|
||||
navigate(`/course/${cid}/hour/${id}`, { replace: true });
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user