removed silentStore
This commit is contained in:
parent
61c68b0875
commit
7385ce522f
@ -95,7 +95,7 @@ export class User implements Movable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public get silent(): boolean {
|
public get silent(): boolean {
|
||||||
return this.status === AvailabilityStatus.SILENT;
|
return this.status === AvailabilityStatus.SILENT || this.status === AvailabilityStatus.JITSI;
|
||||||
}
|
}
|
||||||
|
|
||||||
get following(): User | undefined {
|
get following(): User | undefined {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { isSilentStore, requestedCameraState, requestedMicrophoneState } from "../../Stores/MediaStore";
|
import { availabilityStatusStore, requestedCameraState, requestedMicrophoneState } from "../../Stores/MediaStore";
|
||||||
import { get } from "svelte/store";
|
import { get } from "svelte/store";
|
||||||
import { WorkAdventureDesktopApi } from "@wa-preload-app";
|
import { WorkAdventureDesktopApi } from "@wa-preload-app";
|
||||||
|
import { AvailabilityStatus } from "../../Messages/ts-proto-generated/protos/messages";
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface Window {
|
interface Window {
|
||||||
@ -36,8 +37,8 @@ class DesktopApi {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
isSilentStore.subscribe((value) => {
|
availabilityStatusStore.subscribe((status) => {
|
||||||
this.isSilent = value;
|
this.isSilent = status === AvailabilityStatus.SILENT;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { requestedScreenSharingState, screenSharingAvailableStore } from "../Stores/ScreenSharingStore";
|
import { requestedScreenSharingState, screenSharingAvailableStore } from "../Stores/ScreenSharingStore";
|
||||||
import { isSilentStore, requestedCameraState, requestedMicrophoneState } from "../Stores/MediaStore";
|
import { availabilityStatusStore, requestedCameraState, requestedMicrophoneState } from "../Stores/MediaStore";
|
||||||
import monitorImg from "./images/monitor.svg";
|
import monitorImg from "./images/monitor.svg";
|
||||||
import monitorCloseImg from "./images/monitor-close.svg";
|
import monitorCloseImg from "./images/monitor-close.svg";
|
||||||
import cinemaImg from "./images/cinema.svg";
|
import cinemaImg from "./images/cinema.svg";
|
||||||
@ -18,6 +18,7 @@
|
|||||||
import { followRoleStore, followStateStore, followUsersStore } from "../Stores/FollowStore";
|
import { followRoleStore, followStateStore, followUsersStore } from "../Stores/FollowStore";
|
||||||
import { gameManager } from "../Phaser/Game/GameManager";
|
import { gameManager } from "../Phaser/Game/GameManager";
|
||||||
import { currentPlayerGroupLockStateStore } from "../Stores/CurrentPlayerGroupStore";
|
import { currentPlayerGroupLockStateStore } from "../Stores/CurrentPlayerGroupStore";
|
||||||
|
import { AvailabilityStatus } from "../Messages/ts-proto-generated/protos/messages";
|
||||||
|
|
||||||
const gameScene = gameManager.getCurrentGameScene();
|
const gameScene = gameManager.getCurrentGameScene();
|
||||||
|
|
||||||
@ -77,8 +78,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
let isSilent: boolean;
|
let isSilent: boolean;
|
||||||
const unsubscribeIsSilent = isSilentStore.subscribe((value) => {
|
const unsubscribeIsSilent = availabilityStatusStore.subscribe((status) => {
|
||||||
isSilent = value;
|
isSilent = status === AvailabilityStatus.SILENT;
|
||||||
});
|
});
|
||||||
onDestroy(unsubscribeIsSilent);
|
onDestroy(unsubscribeIsSilent);
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { localVolumeStore, obtainedMediaConstraintStore } from "../Stores/MediaStore";
|
import { availabilityStatusStore, localVolumeStore, obtainedMediaConstraintStore } from "../Stores/MediaStore";
|
||||||
import { localStreamStore, isSilentStore } from "../Stores/MediaStore";
|
import { localStreamStore } from "../Stores/MediaStore";
|
||||||
import SoundMeterWidget from "./SoundMeterWidget.svelte";
|
import SoundMeterWidget from "./SoundMeterWidget.svelte";
|
||||||
import { onDestroy, onMount } from "svelte";
|
import { onDestroy, onMount } from "svelte";
|
||||||
import { srcObject } from "./Video/utils";
|
import { srcObject } from "./Video/utils";
|
||||||
import LL from "../i18n/i18n-svelte";
|
import LL from "../i18n/i18n-svelte";
|
||||||
|
import { AvailabilityStatus } from "../Messages/ts-proto-generated/protos/messages";
|
||||||
|
|
||||||
let stream: MediaStream | null;
|
let stream: MediaStream | null;
|
||||||
|
|
||||||
@ -21,8 +22,8 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
let isSilent: boolean;
|
let isSilent: boolean;
|
||||||
const unsubscribeIsSilent = isSilentStore.subscribe((value) => {
|
const unsubscribeIsSilent = availabilityStatusStore.subscribe((status) => {
|
||||||
isSilent = value;
|
isSilent = status === AvailabilityStatus.SILENT;
|
||||||
});
|
});
|
||||||
|
|
||||||
let cameraContainer: HTMLDivElement;
|
let cameraContainer: HTMLDivElement;
|
||||||
|
@ -11,6 +11,7 @@ export class PlayerStatusDot extends Phaser.GameObjects.Container {
|
|||||||
[AvailabilityStatus.AWAY]: { filling: 0xf5931e, outline: 0x875d13 },
|
[AvailabilityStatus.AWAY]: { filling: 0xf5931e, outline: 0x875d13 },
|
||||||
[AvailabilityStatus.ONLINE]: { filling: 0x8cc43f, outline: 0x427a25 },
|
[AvailabilityStatus.ONLINE]: { filling: 0x8cc43f, outline: 0x427a25 },
|
||||||
[AvailabilityStatus.SILENT]: { filling: 0xe74c3c, outline: 0xc0392b },
|
[AvailabilityStatus.SILENT]: { filling: 0xe74c3c, outline: 0xc0392b },
|
||||||
|
[AvailabilityStatus.JITSI]: { filling: 0x74b9ff, outline: 0x0984e3 },
|
||||||
[AvailabilityStatus.UNRECOGNIZED]: { filling: 0xffffff, outline: 0xffffff },
|
[AvailabilityStatus.UNRECOGNIZED]: { filling: 0xffffff, outline: 0xffffff },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -9,7 +9,6 @@ import { Companion } from "../Companion/Companion";
|
|||||||
import type { GameScene } from "../Game/GameScene";
|
import type { GameScene } from "../Game/GameScene";
|
||||||
import { DEPTH_INGAME_TEXT_INDEX } from "../Game/DepthIndexes";
|
import { DEPTH_INGAME_TEXT_INDEX } from "../Game/DepthIndexes";
|
||||||
import type OutlinePipelinePlugin from "phaser3-rex-plugins/plugins/outlinepipeline-plugin.js";
|
import type OutlinePipelinePlugin from "phaser3-rex-plugins/plugins/outlinepipeline-plugin.js";
|
||||||
import { isSilentStore } from "../../Stores/MediaStore";
|
|
||||||
import { lazyLoadPlayerCharacterTextures } from "./PlayerTexturesLoadingManager";
|
import { lazyLoadPlayerCharacterTextures } from "./PlayerTexturesLoadingManager";
|
||||||
import { TexturesHelper } from "../Helpers/TexturesHelper";
|
import { TexturesHelper } from "../Helpers/TexturesHelper";
|
||||||
import type { PictureStore } from "../../Stores/PictureStore";
|
import type { PictureStore } from "../../Stores/PictureStore";
|
||||||
@ -356,14 +355,6 @@ export abstract class Character extends Container implements OutlineableInterfac
|
|||||||
super.destroy();
|
super.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Remove silent store and check for status?
|
|
||||||
isSilent() {
|
|
||||||
isSilentStore.set(true);
|
|
||||||
}
|
|
||||||
noSilent() {
|
|
||||||
isSilentStore.set(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
playEmote(emote: string) {
|
playEmote(emote: string) {
|
||||||
this.cancelPreviousEmote();
|
this.cancelPreviousEmote();
|
||||||
const emoteY = -45;
|
const emoteY = -45;
|
||||||
|
@ -18,6 +18,7 @@ import { iframeListener } from "../../Api/IframeListener";
|
|||||||
import { Room } from "../../Connexion/Room";
|
import { Room } from "../../Connexion/Room";
|
||||||
import LL from "../../i18n/i18n-svelte";
|
import LL from "../../i18n/i18n-svelte";
|
||||||
import { AvailabilityStatus } from "../../Messages/ts-proto-generated/protos/messages";
|
import { AvailabilityStatus } from "../../Messages/ts-proto-generated/protos/messages";
|
||||||
|
import { availabilityStatusStore } from "../../Stores/MediaStore";
|
||||||
|
|
||||||
interface OpenCoWebsite {
|
interface OpenCoWebsite {
|
||||||
actionId: string;
|
actionId: string;
|
||||||
@ -66,6 +67,9 @@ export class GameMapPropertiesListener {
|
|||||||
coWebsiteManager.closeCoWebsite(coWebsite);
|
coWebsiteManager.closeCoWebsite(coWebsite);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
this.scene.connection?.emitPlayerStatusChange(AvailabilityStatus.ONLINE);
|
||||||
|
availabilityStatusStore.set(AvailabilityStatus.ONLINE);
|
||||||
|
this.scene.CurrentPlayer.setStatus(AvailabilityStatus.ONLINE);
|
||||||
} else {
|
} else {
|
||||||
const openJitsiRoomFunction = () => {
|
const openJitsiRoomFunction = () => {
|
||||||
const roomName = jitsiFactory.getRoomName(newValue.toString(), this.scene.instance);
|
const roomName = jitsiFactory.getRoomName(newValue.toString(), this.scene.instance);
|
||||||
@ -109,6 +113,9 @@ export class GameMapPropertiesListener {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
openJitsiRoomFunction();
|
openJitsiRoomFunction();
|
||||||
|
this.scene.connection?.emitPlayerStatusChange(AvailabilityStatus.JITSI);
|
||||||
|
availabilityStatusStore.set(AvailabilityStatus.JITSI);
|
||||||
|
this.scene.CurrentPlayer.setStatus(AvailabilityStatus.JITSI);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -146,12 +153,12 @@ export class GameMapPropertiesListener {
|
|||||||
this.gameMap.onPropertyChange(GameMapProperties.SILENT, (newValue) => {
|
this.gameMap.onPropertyChange(GameMapProperties.SILENT, (newValue) => {
|
||||||
if (newValue === undefined || newValue === false || newValue === "") {
|
if (newValue === undefined || newValue === false || newValue === "") {
|
||||||
this.scene.connection?.emitPlayerStatusChange(AvailabilityStatus.ONLINE);
|
this.scene.connection?.emitPlayerStatusChange(AvailabilityStatus.ONLINE);
|
||||||
|
availabilityStatusStore.set(AvailabilityStatus.ONLINE);
|
||||||
this.scene.CurrentPlayer.setStatus(AvailabilityStatus.ONLINE);
|
this.scene.CurrentPlayer.setStatus(AvailabilityStatus.ONLINE);
|
||||||
this.scene.CurrentPlayer.noSilent();
|
|
||||||
} else {
|
} else {
|
||||||
this.scene.connection?.emitPlayerStatusChange(AvailabilityStatus.SILENT);
|
this.scene.connection?.emitPlayerStatusChange(AvailabilityStatus.SILENT);
|
||||||
|
availabilityStatusStore.set(AvailabilityStatus.SILENT);
|
||||||
this.scene.CurrentPlayer.setStatus(AvailabilityStatus.SILENT);
|
this.scene.CurrentPlayer.setStatus(AvailabilityStatus.SILENT);
|
||||||
this.scene.CurrentPlayer.isSilent();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ import { MapStore } from "../../Stores/Utils/MapStore";
|
|||||||
import { followUsersColorStore } from "../../Stores/FollowStore";
|
import { followUsersColorStore } from "../../Stores/FollowStore";
|
||||||
import { GameSceneUserInputHandler } from "../UserInput/GameSceneUserInputHandler";
|
import { GameSceneUserInputHandler } from "../UserInput/GameSceneUserInputHandler";
|
||||||
import { locale } from "../../i18n/i18n-svelte";
|
import { locale } from "../../i18n/i18n-svelte";
|
||||||
import { localVolumeStore } from "../../Stores/MediaStore";
|
import { availabilityStatusStore, localVolumeStore } from "../../Stores/MediaStore";
|
||||||
import { StringUtils } from "../../Utils/StringUtils";
|
import { StringUtils } from "../../Utils/StringUtils";
|
||||||
import { startLayerNamesStore } from "../../Stores/StartLayerNamesStore";
|
import { startLayerNamesStore } from "../../Stores/StartLayerNamesStore";
|
||||||
import { JitsiCoWebsite } from "../../WebRtc/CoWebsite/JitsiCoWebsite";
|
import { JitsiCoWebsite } from "../../WebRtc/CoWebsite/JitsiCoWebsite";
|
||||||
@ -709,8 +709,9 @@ export class GameScene extends DirtyScene {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.privacyShutdownStoreUnsubscribe = privacyShutdownStore.subscribe((away) => {
|
this.privacyShutdownStoreUnsubscribe = privacyShutdownStore.subscribe((away) => {
|
||||||
// TODO: Might be a problem with SILENT here
|
const status = away ? AvailabilityStatus.AWAY : AvailabilityStatus.ONLINE;
|
||||||
this.connection?.emitPlayerStatusChange(away ? AvailabilityStatus.AWAY : AvailabilityStatus.ONLINE);
|
this.connection?.emitPlayerStatusChange(status);
|
||||||
|
availabilityStatusStore.set(status);
|
||||||
});
|
});
|
||||||
|
|
||||||
Promise.all([
|
Promise.all([
|
||||||
@ -2153,16 +2154,16 @@ ${escapedMessage}
|
|||||||
}
|
}
|
||||||
|
|
||||||
public enableMediaBehaviors() {
|
public enableMediaBehaviors() {
|
||||||
const silent = this.gameMap.getCurrentProperties().get(GameMapProperties.SILENT);
|
// const silent = this.gameMap.getCurrentProperties().get(GameMapProperties.SILENT);
|
||||||
const status = silent ? AvailabilityStatus.SILENT : AvailabilityStatus.ONLINE;
|
// const status = silent ? AvailabilityStatus.SILENT : AvailabilityStatus.ONLINE;
|
||||||
this.connection?.emitPlayerStatusChange(status);
|
// this.connection?.emitPlayerStatusChange(status);
|
||||||
this.CurrentPlayer.setStatus(status);
|
// this.CurrentPlayer.setStatus(status);
|
||||||
mediaManager.showMyCamera();
|
mediaManager.showMyCamera();
|
||||||
}
|
}
|
||||||
|
|
||||||
public disableMediaBehaviors() {
|
public disableMediaBehaviors() {
|
||||||
this.connection?.emitPlayerStatusChange(AvailabilityStatus.SILENT);
|
// this.connection?.emitPlayerStatusChange(AvailabilityStatus.SILENT);
|
||||||
this.CurrentPlayer.setStatus(AvailabilityStatus.SILENT);
|
// this.CurrentPlayer.setStatus(AvailabilityStatus.SILENT);
|
||||||
mediaManager.hideMyCamera();
|
mediaManager.hideMyCamera();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ import { peerStore } from "./PeerStore";
|
|||||||
import { privacyShutdownStore } from "./PrivacyShutdownStore";
|
import { privacyShutdownStore } from "./PrivacyShutdownStore";
|
||||||
import { MediaStreamConstraintsError } from "./Errors/MediaStreamConstraintsError";
|
import { MediaStreamConstraintsError } from "./Errors/MediaStreamConstraintsError";
|
||||||
import { SoundMeter } from "../Phaser/Components/SoundMeter";
|
import { SoundMeter } from "../Phaser/Components/SoundMeter";
|
||||||
|
import { AvailabilityStatus } from "../Messages/ts-proto-generated/protos/messages";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A store that contains the camera state requested by the user (on or off).
|
* A store that contains the camera state requested by the user (on or off).
|
||||||
@ -178,10 +179,7 @@ function createVideoConstraintStore() {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
export const availabilityStatusStore = writable(AvailabilityStatus.ONLINE);
|
||||||
* 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();
|
||||||
|
|
||||||
@ -240,7 +238,7 @@ export const mediaStreamConstraintsStore = derived(
|
|||||||
audioConstraintStore,
|
audioConstraintStore,
|
||||||
privacyShutdownStore,
|
privacyShutdownStore,
|
||||||
cameraEnergySavingStore,
|
cameraEnergySavingStore,
|
||||||
isSilentStore,
|
availabilityStatusStore,
|
||||||
],
|
],
|
||||||
(
|
(
|
||||||
[
|
[
|
||||||
@ -252,7 +250,7 @@ export const mediaStreamConstraintsStore = derived(
|
|||||||
$audioConstraintStore,
|
$audioConstraintStore,
|
||||||
$privacyShutdownStore,
|
$privacyShutdownStore,
|
||||||
$cameraEnergySavingStore,
|
$cameraEnergySavingStore,
|
||||||
$isSilentStore,
|
$availabilityStatusStore,
|
||||||
],
|
],
|
||||||
set
|
set
|
||||||
) => {
|
) => {
|
||||||
@ -309,7 +307,7 @@ export const mediaStreamConstraintsStore = derived(
|
|||||||
//currentAudioConstraint = false;
|
//currentAudioConstraint = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($isSilentStore === true) {
|
if ($availabilityStatusStore === AvailabilityStatus.SILENT) {
|
||||||
currentVideoConstraint = false;
|
currentVideoConstraint = false;
|
||||||
currentAudioConstraint = false;
|
currentAudioConstraint = false;
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@ enum AvailabilityStatus {
|
|||||||
ONLINE = 0;
|
ONLINE = 0;
|
||||||
SILENT = 1;
|
SILENT = 1;
|
||||||
AWAY = 2;
|
AWAY = 2;
|
||||||
|
JITSI = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
message PositionMessage {
|
message PositionMessage {
|
||||||
|
Loading…
Reference in New Issue
Block a user