diff --git a/src/components/avatar-volume-controls.js b/src/components/avatar-volume-controls.js index 952f565bbe..9654252aad 100644 --- a/src/components/avatar-volume-controls.js +++ b/src/components/avatar-volume-controls.js @@ -29,7 +29,7 @@ AFRAME.registerComponent("avatar-volume-controls", { this.onRemoteMuteUpdated = this.onRemoteMuteUpdated.bind(this); this.playerInfo.el.addEventListener("remote_mute_updated", this.onRemoteMuteUpdated); this.muteButton.object3D.visible = this.playerInfo.data.muted; - const volumePref = getAvatarVolumePref(this.playerInfo.playerSessionId); + const volumePref = getAvatarVolumePref(this.playerInfo.displayName); this.updateGainMultiplier(volumePref === undefined ? DEFAULT_VOLUME_BAR_MULTIPLIER : volumePref.gainMultiplier); this.updateLocalMuted(volumePref === undefined ? false : volumePref.muted); }, @@ -48,7 +48,7 @@ AFRAME.registerComponent("avatar-volume-controls", { this.updateVolumeLabel(); this.el.emit("gain_multiplier_updated", { gainMultiplier }); const isLocalMuted = APP.mutedState.has(this.audioEl); - updatePref && updateAvatarVolumesPref(this.playerInfo.playerSessionId, gainMultiplier, isLocalMuted); + updatePref && updateAvatarVolumesPref(this.playerInfo.displayName, gainMultiplier, isLocalMuted); // If the gainMultiplier is lowered to 0, updated muted status in local storage if (!gainMultiplier) { this.updateLocalMuted(true, true); @@ -69,7 +69,7 @@ AFRAME.registerComponent("avatar-volume-controls", { this.el.emit("local_muted_updated", { muted }); const gainMultiplier = APP.gainMultipliers.get(this.audioEl); const isLocalMuted = APP.mutedState.has(this.audioEl); - updatePref && updateAvatarVolumesPref(this.playerInfo.playerSessionId, gainMultiplier, isLocalMuted); + updatePref && updateAvatarVolumesPref(this.playerInfo.displayName, gainMultiplier, isLocalMuted); }, volumeUp() { diff --git a/src/components/player-info.js b/src/components/player-info.js index 24c95d078a..fac43f8220 100644 --- a/src/components/player-info.js +++ b/src/components/player-info.js @@ -49,6 +49,7 @@ AFRAME.registerComponent("player-info", { this.isLocalPlayerInfo = this.el.id === "avatar-rig"; this.playerSessionId = null; + this.displayName = null; if (!this.isLocalPlayerInfo) { NAF.utils.getNetworkedEntity(this.el).then(networkedEntity => { @@ -56,6 +57,7 @@ AFRAME.registerComponent("player-info", { const playerPresence = window.APP.hubChannel.presence.state[this.playerSessionId]; if (playerPresence) { this.permissions = playerPresence.metas[0].permissions; + this.displayName = playerPresence.metas[0].profile.displayName; } }); } diff --git a/src/react-components/icons/UserSoundOff.svg b/src/react-components/icons/UserSoundOff.svg index 6ccf1455fd..ae4dc24831 100644 --- a/src/react-components/icons/UserSoundOff.svg +++ b/src/react-components/icons/UserSoundOff.svg @@ -1,4 +1,4 @@ - + diff --git a/src/react-components/icons/UserSoundOn.svg b/src/react-components/icons/UserSoundOn.svg index d696583e54..f4650f8adc 100644 --- a/src/react-components/icons/UserSoundOn.svg +++ b/src/react-components/icons/UserSoundOn.svg @@ -1,4 +1,4 @@ - + diff --git a/src/react-components/room/PeopleSidebar.js b/src/react-components/room/PeopleSidebar.js index 33078c6c07..e69efb47ff 100644 --- a/src/react-components/room/PeopleSidebar.js +++ b/src/react-components/room/PeopleSidebar.js @@ -160,13 +160,20 @@ export function PeopleSidebar({ {person.hand_raised && } {} {!person.context.discord && VoiceIcon && } - - {store._preferences?.avatarVoiceLevels?.[person.id]?.muted ? ( - - ) : ( - - )} - + {!person.isMe && ( + + {store._preferences?.avatarVoiceLevels?.[person.profile.displayName]?.muted ? ( + + ) : ( + + )} + + )}

{getPersonName(person, intl)}

{person.roles.owner && ( * { margin-right: 8px; @@ -22,3 +22,9 @@ flex: 1; justify-content: flex-end; } + +:local(.tooltip) { + z-index: 100; + position: fixed; + position: absolute; +}