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:
parent
97c68dd388
commit
64b3bbf1a6
1 changed files with 19 additions and 0 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Reference in a new issue