FIX: Video playback on iOS (#25513)

This commit is contained in:
Blake Erickson 2024-01-31 20:09:57 -07:00 committed by GitHub
parent 44f8418093
commit 969ab0fd6e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 1 deletions

View File

@ -54,7 +54,16 @@ export default {
});
video.addEventListener("canplay", function () {
video.play();
if (caps.isIOS) {
// This is needed to fix video playback on iOS.
// Without it, videos will play, but they won't always be visible.
discourseLater(() => {
video.play();
}, 100);
} else {
video.play();
}
wrapper.remove();
video.style.display = "";
parentDiv.classList.remove("video-placeholder-container");