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

Updated loop behavior for video player on theme

refs https://github.com/TryGhost/Team/issues/1229
This commit is contained in:
Rishabh 2021-12-13 17:31:57 +05:30
parent 7487d6e2e7
commit f237879251
3 changed files with 24 additions and 6 deletions

View file

@ -73,11 +73,29 @@
displayDuration();
setSliderMax();
displayBufferedAmount();
if (videoEl.autoplay) {
raf = requestAnimationFrame(whilePlaying);
playIconContainer.classList.add("kg-video-hide");
pauseIconContainer.classList.remove("kg-video-hide");
}
if (videoEl.muted) {
unmuteIconContainer.classList.add("kg-video-hide");
muteIconContainer.classList.remove("kg-video-hide");
}
} else {
videoEl.addEventListener('loadedmetadata', () => {
displayDuration();
setSliderMax();
displayBufferedAmount();
if (videoEl.autoplay) {
raf = requestAnimationFrame(whilePlaying);
playIconContainer.classList.add("kg-video-hide");
pauseIconContainer.classList.remove("kg-video-hide");
}
if (videoEl.muted) {
unmuteIconContainer.classList.add("kg-video-hide");
muteIconContainer.classList.remove("kg-video-hide");
}
});
}
@ -85,7 +103,7 @@
playIconContainer.classList.add("kg-video-hide");
pauseIconContainer.classList.remove("kg-video-hide");
videoEl.play();
requestAnimationFrame(whilePlaying);
raf = requestAnimationFrame(whilePlaying);
});
pauseIconContainer.addEventListener('click', () => {

View file

@ -73,7 +73,7 @@
"@tryghost/job-manager": "0.8.16",
"@tryghost/kg-card-factory": "3.1.0",
"@tryghost/kg-default-atoms": "3.1.0",
"@tryghost/kg-default-cards": "5.13.5",
"@tryghost/kg-default-cards": "5.13.6",
"@tryghost/kg-markdown-html-renderer": "5.1.0",
"@tryghost/kg-mobiledoc-html-renderer": "5.3.1",
"@tryghost/limit-service": "1.0.6",

View file

@ -1503,10 +1503,10 @@
resolved "https://registry.npmjs.org/@tryghost/kg-default-atoms/-/kg-default-atoms-3.1.0.tgz"
integrity sha512-FfROzVgqJWqJ7cVdS9dcALz7rnzNfV8zcrymAJrDTHDsqzAdMfSLe1tNQRm8zas9pyZLsD8zBGmLxG9dr4WFSA==
"@tryghost/kg-default-cards@5.13.5":
version "5.13.5"
resolved "https://registry.yarnpkg.com/@tryghost/kg-default-cards/-/kg-default-cards-5.13.5.tgz#96d5b5c9eb3a6de6867b67e5d84516d65472e3b7"
integrity sha512-gc/Kj1CDPvzTnMFt+2OJAzWNCQbq51nECRW+1VMzsI47SsIrDhH4LB9uQefgqbGIpBa7zV+YzHoRs2aUBTI3Ew==
"@tryghost/kg-default-cards@5.13.6":
version "5.13.6"
resolved "https://registry.yarnpkg.com/@tryghost/kg-default-cards/-/kg-default-cards-5.13.6.tgz#340c9551a6800474981a7307d2eb7f2e941a73a8"
integrity sha512-EBz4LeR5AiIqRMTC2XlnS+bnOawCV81/kiiQEsd2Mf/IdTnQPsUyIQ289fB1WEhLUVQcl6nOX7ikpfFDBaZAWQ==
dependencies:
"@tryghost/kg-markdown-html-renderer" "^5.1.0"
"@tryghost/url-utils" "^2.0.0"