[mirotalksfu] - #171 fix videoMenuBar width

هذا الالتزام موجود في:
Miroslav Pejic
2024-10-31 20:49:50 +01:00
الأصل e6a6e81e9f
التزام 320b0ced4c
2 ملفات معدلة مع 27 إضافات و0 حذوفات

عرض الملف

@@ -3532,6 +3532,7 @@ class RoomClient {
} }
} }
rc.resizeVideoMenuBar();
setCamerasBorderNone(); setCamerasBorderNone();
if (videoBar.classList.contains('hidden')) { if (videoBar.classList.contains('hidden')) {
@@ -3549,6 +3550,22 @@ class RoomClient {
} }
} }
resizeVideoMenuBar() {
const somethingPinned =
this.isVideoPinned ||
this.isChatPinned ||
this.isEditorPinned ||
this.isPollPinned ||
transcription.isPin();
const menuBarWidth =
this.isVideoPinned || this.isChatPinned || this.isPollPinned || transcription.isPin() ? '75%' : '70%';
const videoMenuBar = rc.getEcN('videoMenuBar');
for (let i = 0; i < videoMenuBar.length; i++) {
const menuBar = videoMenuBar[i];
menuBar.style.width = somethingPinned ? menuBarWidth : '100%';
}
}
addCloseVBButton(containerElement) { addCloseVBButton(containerElement) {
const closeBtn = document.createElement('div'); const closeBtn = document.createElement('div');
closeBtn.className = `${html.close} videoMenuBarClose`; closeBtn.className = `${html.close} videoMenuBarClose`;
@@ -3586,6 +3603,7 @@ class RoomClient {
this.videoMediaContainer.style.top = 0; this.videoMediaContainer.style.top = 0;
this.videoMediaContainer.style.width = '75%'; this.videoMediaContainer.style.width = '75%';
this.videoMediaContainer.style.height = '100%'; this.videoMediaContainer.style.height = '100%';
this.resizeVideoMenuBar();
} }
videoMediaContainerUnpin() { videoMediaContainerUnpin() {
@@ -3593,6 +3611,7 @@ class RoomClient {
this.videoMediaContainer.style.right = null; this.videoMediaContainer.style.right = null;
this.videoMediaContainer.style.width = '100%'; this.videoMediaContainer.style.width = '100%';
this.videoMediaContainer.style.height = '100%'; this.videoMediaContainer.style.height = '100%';
this.resizeVideoMenuBar();
} }
adaptVideoObjectFit(index) { adaptVideoObjectFit(index) {
@@ -3843,6 +3862,7 @@ class RoomClient {
this.chatPinned(); this.chatPinned();
this.isChatPinned = true; this.isChatPinned = true;
setColor(chatTogglePin, 'lime'); setColor(chatTogglePin, 'lime');
this.resizeVideoMenuBar();
resizeVideoMedia(); resizeVideoMedia();
chatRoom.style.resize = 'none'; chatRoom.style.resize = 'none';
if (!this.isMobileDevice) this.makeUnDraggable(chatRoom, chatHeader); if (!this.isMobileDevice) this.makeUnDraggable(chatRoom, chatHeader);
@@ -3861,6 +3881,7 @@ class RoomClient {
this.chatCenter(); this.chatCenter();
this.isChatPinned = false; this.isChatPinned = false;
setColor(chatTogglePin, 'white'); setColor(chatTogglePin, 'white');
this.resizeVideoMenuBar();
resizeVideoMedia(); resizeVideoMedia();
if (!this.isMobileDevice) this.makeDraggable(chatRoom, chatHeader); if (!this.isMobileDevice) this.makeDraggable(chatRoom, chatHeader);
if (!this.isPlistOpen()) this.toggleShowParticipants(); if (!this.isPlistOpen()) this.toggleShowParticipants();
@@ -4489,6 +4510,7 @@ class RoomClient {
this.pollPinned(); this.pollPinned();
this.isPollPinned = true; this.isPollPinned = true;
setColor(pollTogglePin, 'lime'); setColor(pollTogglePin, 'lime');
this.resizeVideoMenuBar();
resizeVideoMedia(); resizeVideoMedia();
pollRoom.style.resize = 'none'; pollRoom.style.resize = 'none';
if (!this.isMobileDevice) this.makeUnDraggable(pollRoom, pollHeader); if (!this.isMobileDevice) this.makeUnDraggable(pollRoom, pollHeader);
@@ -4503,6 +4525,7 @@ class RoomClient {
this.pollCenter(); this.pollCenter();
this.isPollPinned = false; this.isPollPinned = false;
setColor(pollTogglePin, 'white'); setColor(pollTogglePin, 'white');
this.resizeVideoMenuBar();
resizeVideoMedia(); resizeVideoMedia();
if (!this.isMobileDevice) this.makeDraggable(pollRoom, pollHeader); if (!this.isMobileDevice) this.makeDraggable(pollRoom, pollHeader);
} }
@@ -4834,6 +4857,7 @@ class RoomClient {
this.editorPinned(); this.editorPinned();
this.isEditorPinned = true; this.isEditorPinned = true;
setColor(editorTogglePin, 'lime'); setColor(editorTogglePin, 'lime');
this.resizeVideoMenuBar();
resizeVideoMedia(); resizeVideoMedia();
document.documentElement.style.setProperty('--editor-height', '80vh'); document.documentElement.style.setProperty('--editor-height', '80vh');
//if (!this.isMobileDevice) this.makeUnDraggable(editorRoom, editorHeader); //if (!this.isMobileDevice) this.makeUnDraggable(editorRoom, editorHeader);
@@ -4848,6 +4872,7 @@ class RoomClient {
this.pollCenter(); this.pollCenter();
this.isEditorPinned = false; this.isEditorPinned = false;
setColor(editorTogglePin, 'white'); setColor(editorTogglePin, 'white');
this.resizeVideoMenuBar();
resizeVideoMedia(); resizeVideoMedia();
document.documentElement.style.setProperty('--editor-height', '85vh'); document.documentElement.style.setProperty('--editor-height', '85vh');
//if (!this.isMobileDevice) this.makeDraggable(editorRoom, editorHeader); //if (!this.isMobileDevice) this.makeDraggable(editorRoom, editorHeader);

عرض الملف

@@ -318,6 +318,7 @@ class Transcription {
transcriptionRoom.style.transform = null; transcriptionRoom.style.transform = null;
document.documentElement.style.setProperty('--transcription-width', '25%'); document.documentElement.style.setProperty('--transcription-width', '25%');
document.documentElement.style.setProperty('--transcription-height', '100%'); document.documentElement.style.setProperty('--transcription-height', '100%');
rc.resizeVideoMenuBar();
} }
unpinned() { unpinned() {
@@ -334,6 +335,7 @@ class Transcription {
this.center(); this.center();
this.isPinned = false; this.isPinned = false;
setColor(transcriptionTogglePinBtn, 'white'); setColor(transcriptionTogglePinBtn, 'white');
rc.resizeVideoMenuBar();
resizeVideoMedia(); resizeVideoMedia();
resizeTranscriptionRoom(); resizeTranscriptionRoom();
transcriptionRoom.style.resize = 'both'; transcriptionRoom.style.resize = 'both';