0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-25 02:31:59 -05:00

Refined video player UI behavior

refs https://github.com/TryGhost/Team/issues/1229

- allows pausing video by clicking on video overlay
This commit is contained in:
Rishabh 2021-12-14 21:50:27 +05:30
parent 441307c6ad
commit b8b0a29a2e

View file

@ -113,6 +113,13 @@
}
}
videoEl.addEventListener('click', () => {
const isPlaying = !!(videoEl.currentTime > 0 && !videoEl.paused && !videoEl.ended && videoEl.readyState > 2);
if (isPlaying) {
handleOnPause();
}
});
videoEl.onplay = () => {
largePlayIcon.classList.add("kg-video-hide");
videoOverlay.classList.add("kg-video-hide");