0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Fixed hidden controls for videos on loop

refs https://github.com/TryGhost/Team/issues/1229
This commit is contained in:
Rishabh 2021-12-14 21:53:31 +05:30
parent 2364de5696
commit 9ec83214ba

View file

@ -103,7 +103,9 @@
}
videoElementContainer.onmouseover = () => {
videoPlayerContainer.classList.remove("kg-video-hide-animated");
if (!videoEl.loop) {
videoPlayerContainer.classList.remove("kg-video-hide-animated");
}
}
videoElementContainer.onmouseleave = () => {
@ -114,9 +116,11 @@
}
videoEl.addEventListener('click', () => {
const isPlaying = !!(videoEl.currentTime > 0 && !videoEl.paused && !videoEl.ended && videoEl.readyState > 2);
if (isPlaying) {
handleOnPause();
if (!videoEl.loop) {
const isPlaying = !!(videoEl.currentTime > 0 && !videoEl.paused && !videoEl.ended && videoEl.readyState > 2);
if (isPlaying) {
handleOnPause();
}
}
});