Merge pull request #1508 from thecodingmachine/fixSilentZones
FIX: being in a silent zone new forces mediaConstraints to false
This commit is contained in:
commit
60eefbce94
@ -15,6 +15,7 @@
|
|||||||
import {onDestroy} from "svelte";
|
import {onDestroy} from "svelte";
|
||||||
|
|
||||||
function screenSharingClick(): void {
|
function screenSharingClick(): void {
|
||||||
|
if (isSilent) return;
|
||||||
if ($requestedScreenSharingState === true) {
|
if ($requestedScreenSharingState === true) {
|
||||||
requestedScreenSharingState.disableScreenSharing();
|
requestedScreenSharingState.disableScreenSharing();
|
||||||
} else {
|
} else {
|
||||||
@ -23,6 +24,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function cameraClick(): void {
|
function cameraClick(): void {
|
||||||
|
if (isSilent) return;
|
||||||
if ($requestedCameraState === true) {
|
if ($requestedCameraState === true) {
|
||||||
requestedCameraState.disableWebcam();
|
requestedCameraState.disableWebcam();
|
||||||
} else {
|
} else {
|
||||||
@ -31,6 +33,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function microphoneClick(): void {
|
function microphoneClick(): void {
|
||||||
|
if (isSilent) return;
|
||||||
if ($requestedMicrophoneState === true) {
|
if ($requestedMicrophoneState === true) {
|
||||||
requestedMicrophoneState.disableMicrophone();
|
requestedMicrophoneState.disableMicrophone();
|
||||||
} else {
|
} else {
|
||||||
|
@ -177,6 +177,11 @@ function createVideoConstraintStore() {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A store containing if user is silent, so if he is in silent zone. This permit to show et hide camera of user
|
||||||
|
*/
|
||||||
|
export const isSilentStore = writable(false);
|
||||||
|
|
||||||
export const videoConstraintStore = createVideoConstraintStore();
|
export const videoConstraintStore = createVideoConstraintStore();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -234,6 +239,7 @@ export const mediaStreamConstraintsStore = derived(
|
|||||||
audioConstraintStore,
|
audioConstraintStore,
|
||||||
privacyShutdownStore,
|
privacyShutdownStore,
|
||||||
cameraEnergySavingStore,
|
cameraEnergySavingStore,
|
||||||
|
isSilentStore,
|
||||||
],
|
],
|
||||||
(
|
(
|
||||||
[
|
[
|
||||||
@ -245,6 +251,7 @@ export const mediaStreamConstraintsStore = derived(
|
|||||||
$audioConstraintStore,
|
$audioConstraintStore,
|
||||||
$privacyShutdownStore,
|
$privacyShutdownStore,
|
||||||
$cameraEnergySavingStore,
|
$cameraEnergySavingStore,
|
||||||
|
$isSilentStore,
|
||||||
],
|
],
|
||||||
set
|
set
|
||||||
) => {
|
) => {
|
||||||
@ -294,6 +301,11 @@ export const mediaStreamConstraintsStore = derived(
|
|||||||
//currentAudioConstraint = false;
|
//currentAudioConstraint = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($isSilentStore === true) {
|
||||||
|
currentVideoConstraint = false;
|
||||||
|
currentAudioConstraint = false;
|
||||||
|
}
|
||||||
|
|
||||||
// Let's make the changes only if the new value is different from the old one.
|
// Let's make the changes only if the new value is different from the old one.
|
||||||
if (
|
if (
|
||||||
previousComputedVideoConstraint != currentVideoConstraint ||
|
previousComputedVideoConstraint != currentVideoConstraint ||
|
||||||
@ -607,13 +619,3 @@ localStreamStore.subscribe((streamResult) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
|
||||||
* A store containing the real active media is mobile
|
|
||||||
*/
|
|
||||||
export const obtainedMediaConstraintIsMobileStore = writable(false);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A store containing if user is silent, so if he is in silent zone. This permit to show et hide camera of user
|
|
||||||
*/
|
|
||||||
export const isSilentStore = writable(false);
|
|
||||||
|
Loading…
Reference in New Issue
Block a user