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