Skip to content

Commit

Permalink
1 - Fix player hidden on jitsi open
Browse files Browse the repository at this point in the history
  • Loading branch information
YglesEyes committed Sep 11, 2023
1 parent 8986628 commit d987f99
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 16 deletions.
16 changes: 2 additions & 14 deletions core/client/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,20 +108,8 @@ updateViewport = (scene, mode) => {
lemverseTag.classList.toggle('dockToTheLeft', Session.get('screenSide') === 'left');
lemverseTag.classList.toggle('dockToTheRight', Session.get('screenSide') === 'right');

const { width, height } = document.querySelector('#gameModules').getBoundingClientRect();
let computedWidth = width;
let computedHeight = height;
if (Session.get('screenMode') === 'locked') {
if (mode === viewportModes.small) {
computedWidth = width * 3.0;
computedHeight = height;
} else if (mode === viewportModes.splitScreen) {
computedWidth = width * 2.0;
computedHeight = height;
}
}

scene.cameras.main.setViewport(0, 0, computedWidth, computedHeight);
const { width, height } = getSimulationSize();
scene.cameras.main.setViewport(0, 0, width, height);
scene.viewportMode = mode;

const event = new CustomEvent(eventTypes.onViewportUpdated);
Expand Down
4 changes: 2 additions & 2 deletions core/client/ui/components/resizable/resizable.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ Template.resizable.onCreated(() => {
const containerId = `.${Template.instance().data.id}`;

window.addEventListener('onLevelLoaded', () => {
Session.set('screenMode', 'locked');
Session.set('screenMode', 'unlocked');
Session.set('screenSide', 'right');

makeResizableDiv(containerId);
Expand All @@ -175,7 +175,7 @@ Template.resizable.events({
const cornerResizers = document.querySelectorAll(`${containerId} .corner-resizer`);
const widthResizers = document.querySelector(`${containerId} .width-resizers`);

resizable.style.top = '25%';
resizable.style.top = '0%';
resizable.style.left = '25%';
resizable.style.height = '50%';
resizable.style.width = '50%';
Expand Down
4 changes: 4 additions & 0 deletions core/client/ui/components/resizable/resizable.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
max-height: 100%;
min-height: 100px;

&.resizableMeet {
z-index: 120;
}

.corner-resizers {
width: 100%;
height: 100%;
Expand Down
18 changes: 18 additions & 0 deletions core/modules/meet/client/meet.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,24 @@ const onZoneEntered = e => {
const meetingRoomService = jitsiLowLevel ? meetLowLevel : meetHighLevel;
meetingRoom.setMeetingRoomService(meetingRoomService);

const containerId = '.resizableMeet';
const resizable = document.querySelector(containerId);
const cornerResizers = document.querySelectorAll(`${containerId} .corner-resizer`);
const widthResizers = document.querySelector(`${containerId} .width-resizers`);

resizable.style.top = '0%';
resizable.style.left = '25%';
resizable.style.height = '50%';
resizable.style.width = '50%';
cornerResizers.forEach(resizer => resizer.classList.add('show'));
widthResizers.classList.remove('show');

Session.set('screenMode', 'unlocked');
Session.set('screenSide', 'right');

updateViewport(game.scene.keys.WorldScene);
updateViewport(game.scene.keys.UIScene);

if (!meetingRoomService.api && roomName) {
const user = Meteor.user();
if (user.profile.guest && !guestAllowed(permissionType)) {
Expand Down

0 comments on commit d987f99

Please sign in to comment.