mirror of
https://github.com/PlayEdu/frontend.git
synced 2025-06-28 02:30:17 +08:00
播放结束退出全屏
This commit is contained in:
parent
c2420798d2
commit
1996340699
@ -181,6 +181,7 @@ const CoursePalyPage = () => {
|
||||
setPlayingTime(0);
|
||||
setPlayendedStatus(true);
|
||||
playTimeUpdate(parseInt(window.player.video.currentTime), true);
|
||||
exitFullscreen();
|
||||
window.player && window.player.destroy();
|
||||
});
|
||||
setLoading(false);
|
||||
@ -214,6 +215,18 @@ const CoursePalyPage = () => {
|
||||
}
|
||||
};
|
||||
|
||||
const exitFullscreen = () => {
|
||||
let de: any;
|
||||
de = document;
|
||||
if (de.fullscreenElement !== null) {
|
||||
de.exitFullscreen();
|
||||
} else if (de.mozCancelFullScreen) {
|
||||
de.mozCancelFullScreen();
|
||||
} else if (de.webkitCancelFullScreen) {
|
||||
de.webkitCancelFullScreen();
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={styles["video-mask"]}>
|
||||
<div className={styles["top-cont"]}>
|
||||
|
Loading…
x
Reference in New Issue
Block a user