Starting working towards migrating the help camera popup

This commit is contained in:
David Négrier 2021-06-01 09:08:02 +02:00
parent ce645a83ab
commit 9d6b597552
7 changed files with 150 additions and 14 deletions

View file

@ -12,6 +12,7 @@ import {
import {
screenSharingLocalStreamStore
} from "../Stores/ScreenSharingStore";
import {helpCameraSettingsVisibleStore} from "../Stores/HelpCameraSettingsStore";
export type UpdatedLocalStreamCallback = (media: MediaStream|null) => void;
export type StartScreenSharingCallback = (media: MediaStream) => void;
@ -29,7 +30,6 @@ export class MediaManager {
startScreenSharingCallBacks : Set<StartScreenSharingCallback> = new Set<StartScreenSharingCallback>();
stopScreenSharingCallBacks : Set<StopScreenSharingCallback> = new Set<StopScreenSharingCallback>();
showReportModalCallBacks : Set<ShowReportCallBack> = new Set<ShowReportCallBack>();
helpCameraSettingsCallBacks : Set<HelpCameraSettingsCallBack> = new Set<HelpCameraSettingsCallBack>();
private focused : boolean = true;
@ -64,7 +64,7 @@ export class MediaManager {
if (result.type === 'error') {
console.error(result.error);
layoutManager.addInformation('warning', 'Camera access denied. Click here and check your browser permissions.', () => {
this.showHelpCameraSettingsCallBack();
helpCameraSettingsVisibleStore.set(true);
}, this.userInputManager);
return;
}
@ -74,7 +74,7 @@ export class MediaManager {
if (result.type === 'error') {
console.error(result.error);
layoutManager.addInformation('warning', 'Screen sharing denied. Click here and check your browser permissions.', () => {
this.showHelpCameraSettingsCallBack();
helpCameraSettingsVisibleStore.set(true);
}, this.userInputManager);
return;
}
@ -395,16 +395,6 @@ export class MediaManager {
this.showReportModalCallBacks.add(callback);
}
public setHelpCameraSettingsCallBack(callback: HelpCameraSettingsCallBack){
this.helpCameraSettingsCallBacks.add(callback);
}
private showHelpCameraSettingsCallBack(){
for(const callBack of this.helpCameraSettingsCallBacks){
callBack();
}
}
//FIX ME SOUNDMETER: check stalability of sound meter calculation
/*updateSoudMeter(){
try{