fix(core): fixed fullscreen on ios safari (#211)

Co-authored-by: Wesley Luyten <me@wesleyluyten.com>
This commit is contained in:
Lachlan Rumery
2025-12-15 15:17:17 -06:00
committed by GitHub
co-authored by Wesley Luyten
parent a41f39d157
commit 6068633be0
@@ -58,16 +58,19 @@ export const fullscreenable = {
return false;
},
set(value: boolean, stateOwners: any): void {
const { container } = stateOwners;
if (!container || !globalThis?.document) return;
const { container, media } = stateOwners;
if (!container || !media || !globalThis?.document) return;
try {
if (value) {
// Enter fullscreen
if (container.requestFullscreen) {
container.requestFullscreen();
} else if (media._playbackEngine?.element?.webkitEnterFullscreen) {
// Safari support (IOS)
media._playbackEngine.element.webkitEnterFullscreen();
} else if (container.webkitRequestFullscreen) {
// Safari support
// Safari support (non IOS)
container.webkitRequestFullscreen();
} else if (container.mozRequestFullScreen) {
// Firefox support