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