Skip to content

Commit

Permalink
Maximize every app when fullscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
vince-hz committed Aug 29, 2023
1 parent bc82edf commit 7e23ca1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/bridge/Room.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,12 @@ function addSlideApp(scenePath: string, title: string, scenes: SceneDefinition[]
taskId,
url,
} as SlideAttributes,
});
}).then((id)=> {
if (window.fullScreen || false) {
window.manager!.setMaximized(true);
}
return id;
})
} else {
return window.manager!.addApp({
kind: BuiltinApps.DocsViewer,
Expand All @@ -97,6 +102,11 @@ function addSlideApp(scenePath: string, title: string, scenes: SceneDefinition[]
title,
scenes,
},
}).then((id)=> {
if (window.fullScreen || false) {
window.manager!.setMaximized(true);
}
return id;
});
}
} catch (err) {
Expand Down Expand Up @@ -615,6 +625,9 @@ export class RoomAsyncBridge {
responseCallback(appId)
});
}
if (window.fullScreen || false) {
window.manager.setMaximized(true);
}
}
}

Expand Down
1 change: 1 addition & 0 deletions src/bridge/SDK.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ class SDKBridge {
roomState = { ...roomState, ...{ windowBoxState: manager.boxState }, cameraState: manager.cameraState, sceneState: manager.sceneState, ...{ pageState: manager.pageState } };

const fullscreen = windowParams && (windowParams as any).fullscreen;
window.fullScreen = fullscreen;
if (fullscreen) {
manager.setMaximized(true);
document.body.appendChild(document.createElement("style")).textContent = `
Expand Down
1 change: 1 addition & 0 deletions src/utils/ParamTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ declare global {
sdk?: WhiteWebSdk;
player?: Player;
combinePlayer?: CombinePlayer;
fullScreen?: boolean;
bridge?: any;
__nativeTags?: any;
__platform?: any;
Expand Down

0 comments on commit 7e23ca1

Please sign in to comment.