mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
fix(core): fixed fullscreen on ios safari (#211)
Co-authored-by: Wesley Luyten <me@wesleyluyten.com>
This commit is contained in:
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
|
||||
|
||||
Reference in New Issue
Block a user