Closing game webcame in Jitsi
When stepping in Jitsi, the game webcam (from mediaManager) was not shut down. And when enabling/disabling the webcam in Jitsi, the webcam in mediaManager was also enabled/disabled. This PR fixes those issues. It also fixes a race condition when closing a Jitsi where the mic/cam would be enabled at the same time.
This commit is contained in:
parent
23bf78a026
commit
ad39b43df3
3 changed files with 50 additions and 30 deletions
|
@ -1475,6 +1475,8 @@ ${escapedMessage}
|
|||
mediaManager.addTriggerCloseJitsiFrameButton('close-jisi',() => {
|
||||
this.stopJitsi();
|
||||
});
|
||||
|
||||
this.onVisibilityChange();
|
||||
}
|
||||
|
||||
public stopJitsi(): void {
|
||||
|
@ -1483,6 +1485,7 @@ ${escapedMessage}
|
|||
mediaManager.showGameOverlay();
|
||||
|
||||
mediaManager.removeTriggerCloseJitsiFrameButton('close-jisi');
|
||||
this.onVisibilityChange();
|
||||
}
|
||||
|
||||
//todo: put this into an 'orchestrator' scene (EntryScene?)
|
||||
|
@ -1519,6 +1522,12 @@ ${escapedMessage}
|
|||
}
|
||||
|
||||
private onVisibilityChange(): void {
|
||||
// If the overlay is not displayed, we are in Jitsi. We don't need the webcam.
|
||||
if (!mediaManager.isGameOverlayVisible()) {
|
||||
mediaManager.blurCamera();
|
||||
return;
|
||||
}
|
||||
|
||||
if (document.visibilityState === 'visible') {
|
||||
mediaManager.focusCamera();
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue