From 556c486698e9071c7ef5be832124eee1f7963df1 Mon Sep 17 00:00:00 2001 From: sylenien Date: Thu, 22 Sep 2022 12:30:54 +0200 Subject: [PATCH] fix(tracker): fix videofeed windows --- tracker/tracker-assist/src/CallWindow.ts | 29 ++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tracker/tracker-assist/src/CallWindow.ts b/tracker/tracker-assist/src/CallWindow.ts index 32ceaff38..fa99cd7fe 100644 --- a/tracker/tracker-assist/src/CallWindow.ts +++ b/tracker/tracker-assist/src/CallWindow.ts @@ -16,6 +16,8 @@ export default class CallWindow { private remoteControlContainer: HTMLElement | null = null private remoteControlEndBtn: HTMLElement | null = null private controlsContainer: HTMLElement | null = null + private remoteVideoOn = false + private localVideoOn = false private tsInterval: ReturnType @@ -171,10 +173,23 @@ export default class CallWindow { this.load .then(() => { if (this.videoContainer) { + this.remoteVideoOn = enable if (enable) { this.videoContainer.classList.add('remote') + if (this.localVideoOn) { + this.vLocal && Object.assign(this.vLocal.style, { + width: '35%', + height: 'unset', + }) + } } else { this.videoContainer.classList.remove('remote') + if (this.localVideoOn) { + this.vLocal && Object.assign(this.vLocal.style, { + width: 'unset', + height: '100%', + }) + } } this.adjustIframeSize() } @@ -228,9 +243,23 @@ export default class CallWindow { if (!this.videoBtn || !this.videoContainer) { return } + this.localVideoOn = enabled if (enabled) { this.videoContainer.classList.add('local') this.videoBtn.classList.remove('off') + if (this.remoteVideoOn) { + this.vLocal && Object.assign(this.vLocal.style, { + width: '35%', + height: 'unset', + }) + } else { + if (this.remoteVideoOn) { + this.vLocal && Object.assign(this.vLocal.style, { + width: 'unset', + height: '100%', + }) + } + } } else { this.videoContainer.classList.remove('local') this.videoBtn.classList.add('off')