fix(player): resolve Safari infinite loading by refining play overlay and loading logic

This commit is contained in:
Michael committed 2026-03-09 23:05:10 +01:00
1 parent dbb6559640
commit a256ca87b6
3 files changed
+14 -10

No files matched your search

+4 -6
View File
@@ -188,16 +188,13 @@
});
video.addEventListener('pause', () => {
// Only show play overlay if not loading
if (loading.style.display === 'none') {
// If we're paused and not playing, and it looks like it was blocked or stopped
if (video.currentTime === 0 || video.paused) {
loading.style.display = 'none';
playOverlay.style.display = 'flex';
}
});
video.addEventListener('waiting', () => {
loading.style.display = 'flex';
playOverlay.style.display = 'none';
});
video.addEventListener('error', () => {
loading.style.display = 'none';
@@ -222,6 +219,7 @@
video.load();
video.play().catch(e => {
log('Autoplay blocked by Safari, showing overlay');
loading.style.display = 'none';
playOverlay.style.display = 'flex';
});
return;