Merge branch 'develop' of github.com:thecodingmachine/workadventure

This commit is contained in:
_Bastler 2021-09-03 12:52:17 +02:00
commit b539d95fec

View File

@ -1,6 +1,6 @@
<script lang="ts">
import {localUserStore} from "../../Connexion/LocalUserStore";
import type {audioManagerVolume} from "../../Stores/AudioManagerStore";
import { localUserStore } from "../../Connexion/LocalUserStore";
import type { audioManagerVolume } from "../../Stores/AudioManagerStore";
import {
audioManagerFileStore,
audioManagerVolumeStore,
@ -12,8 +12,8 @@
let HTMLAudioPlayer: HTMLAudioElement;
let audioPlayerVolumeIcon: HTMLElement;
let audioPlayerVol: HTMLInputElement;
let unsubscriberFileStore: Unsubscriber|null=null;
let unsubscriberVolumeStore: Unsubscriber|null=null;
let unsubscriberFileStore: Unsubscriber | null = null;
let unsubscriberVolumeStore: Unsubscriber | null = null;
let volume: number=1;
let decreaseWhileTalking: boolean=true;
@ -23,7 +23,7 @@
audioManagerVolumeStore.setMuted(localUserStore.getAudioPlayerMuted());
setVolume();
unsubscriberFileStore=audioManagerFileStore.subscribe(() => {
unsubscriberFileStore = audioManagerFileStore.subscribe(() =>{
HTMLAudioPlayer.pause();
HTMLAudioPlayer.loop=get(audioManagerVolumeStore).loop;
HTMLAudioPlayer.volume=get(audioManagerVolumeStore).volume;
@ -60,15 +60,15 @@
}
function setVolume() {
if(get(audioManagerVolumeStore).muted) {
if (get(audioManagerVolumeStore).muted) {
audioPlayerVolumeIcon.classList.add('muted');
audioPlayerVol.value="0";
audioPlayerVol.value = "0";
} else {
audioPlayerVol.value=""+volume;
audioPlayerVol.value = "" + volume;
audioPlayerVolumeIcon.classList.remove('muted');
if(volume<0.3) {
if (volume < 0.3) {
audioPlayerVolumeIcon.classList.add('low');
} else if(volume<0.7) {
} else if (volume < 0.7) {
audioPlayerVolumeIcon.classList.remove('low');
audioPlayerVolumeIcon.classList.add('mid');
} else {
@ -135,8 +135,8 @@
padding: 3px 3px;
margin-left: auto;
margin-right: auto;
background-color: rgb(0, 0, 0, 0.5);
background-color: rgb(0,0,0,0.5);
display: grid;
grid-template-rows: 50% 50%;
color: whitesmoke;