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