fix(tracker): fix videofeed windows

This commit is contained in:
sylenien 2022-09-22 12:30:54 +02:00 committed by Delirium
parent 9e25f8ef69
commit 556c486698

View file

@ -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<typeof setInterval>
@ -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')