0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Refined video controls behavior

refs https://github.com/TryGhost/Team/issues/1229
This commit is contained in:
Rishabh 2021-12-14 21:01:12 +05:30
parent 97c68dd388
commit 64b3bbf1a6

View file

@ -101,6 +101,25 @@
});
}
videoElementContainer.onmouseover = () => {
videoPlayerContainer.classList.remove("kg-video-hide");
}
videoElementContainer.onmouseleave = () => {
const isPlaying = !!(videoEl.currentTime > 0 && !videoEl.paused && !videoEl.ended && videoEl.readyState > 2);
if (isPlaying) {
videoPlayerContainer.classList.add("kg-video-hide");
}
}
videoEl.onplay = () => {
largePlayIcon.classList.add("kg-video-hide");
videoOverlay.classList.add("kg-video-hide");
playIconContainer.classList.add("kg-video-hide");
pauseIconContainer.classList.remove("kg-video-hide");
videoPlayerContainer.classList.add("kg-video-hide");
};
const handleOnPlay = () => {
largePlayIcon.classList.add("kg-video-hide");
videoOverlay.classList.add("kg-video-hide");