mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-16 18:38:25 -07:00
Fix fullscreen video in iOS Safari
This commit is contained in:
parent
1787538081
commit
585667067b
@ -18,6 +18,11 @@ define(['events', 'datetime', 'appSettings', 'itemHelper', 'pluginManager', 'pla
|
||||
screenfull.on('change', function () {
|
||||
events.trigger(player, 'fullscreenchange');
|
||||
});
|
||||
} else {
|
||||
// iOS Safari
|
||||
document.addEventListener('webkitfullscreenchange', function () {
|
||||
events.trigger(player, 'fullscreenchange');
|
||||
}, false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1399,6 +1404,11 @@ define(['events', 'datetime', 'appSettings', 'itemHelper', 'pluginManager', 'pla
|
||||
return player.isFullscreen();
|
||||
}
|
||||
|
||||
if (!screenfull.isEnabled) {
|
||||
// iOS Safari
|
||||
return document.webkitIsFullScreen;
|
||||
}
|
||||
|
||||
return screenfull.isFullscreen;
|
||||
};
|
||||
|
||||
@ -1410,6 +1420,16 @@ define(['events', 'datetime', 'appSettings', 'itemHelper', 'pluginManager', 'pla
|
||||
|
||||
if (screenfull.isEnabled) {
|
||||
screenfull.toggle();
|
||||
} else {
|
||||
// iOS Safari
|
||||
if (document.webkitIsFullScreen && document.webkitCancelFullscreen) {
|
||||
document.webkitCancelFullscreen();
|
||||
} else {
|
||||
const elem = document.querySelector('video');
|
||||
if (elem && elem.webkitEnterFullscreen) {
|
||||
elem.webkitEnterFullscreen();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -554,6 +554,11 @@ define(['browser', 'require', 'events', 'apphost', 'loading', 'dom', 'playbackMa
|
||||
|
||||
if (screenfull.isEnabled) {
|
||||
screenfull.exit();
|
||||
} else {
|
||||
// iOS Safari
|
||||
if (document.webkitIsFullScreen && document.webkitCancelFullscreen) {
|
||||
document.webkitCancelFullscreen();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user