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

This commit is contained in:
_Bastler 2021-10-03 21:18:46 +02:00
commit 735c30b5a5
6 changed files with 30 additions and 13 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 386 KiB

1
README-LOGO.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 16 KiB

BIN
README-MAP.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

View File

@ -1,17 +1,18 @@
> # This is a fork of [Work Adventure](https://github.com/thecodingmachine/workadventure) with small adjustment and changes for production environment for Bastelei e. V. Partey > # This is a fork of [Work Adventure](https://github.com/thecodingmachine/workadventure) with small adjustment and changes for production environment for Bastelei e. V. Partey
![WorkAdventure landscape image](README-INTRO.jpg) ![WorkAdventure logo](README-LOGO.svg)
![WorkAdventure office image](README-MAP.png)
Demo here : [https://workadventu.re/](https://workadventu.re/). Live demo [here](https://play.workadventu.re/@/tcm/workadventure/wa-village).
# Work Adventure # WorkAdventure
Work Adventure is a web-based collaborative workspace for small to medium teams (2-100 people) presented in the form of a WorkAdventure is a web-based collaborative workspace presented in the form of a
16-bit video game. 16-bit video game.
In Work Adventure, you can move around your office and talk to your colleagues (using a video-chat feature that is In WorkAdventure you can move around your office and talk to your colleagues (using a video-chat system, triggered when you approach someone).
triggered when you move next to a colleague).
See more features for your virtual office: https://workadventu.re/virtual-office
## Setting up a development environment ## Setting up a development environment

View File

@ -23,6 +23,8 @@
audioManagerVolumeStore.setMuted(localUserStore.getAudioPlayerMuted()); audioManagerVolumeStore.setMuted(localUserStore.getAudioPlayerMuted());
changeVolume(); changeVolume();
loadAudioSettings();
unsubscriberFileStore = audioManagerFileStore.subscribe(() => { unsubscriberFileStore = audioManagerFileStore.subscribe(() => {
HTMLAudioPlayer.pause(); HTMLAudioPlayer.pause();
HTMLAudioPlayer.loop = get(audioManagerVolumeStore).loop; HTMLAudioPlayer.loop = get(audioManagerVolumeStore).loop;
@ -79,6 +81,11 @@
changeVolume(); changeVolume();
} }
function loadAudioSettings() {
audioManagerVolumeStore.setVolume(localUserStore.getAudioPlayerVolume());
audioManagerVolumeStore.setMuted(localUserStore.getAudioPlayerMuted());
}
function setVolume() { function setVolume() {
volume = parseFloat(audioPlayerVol.value); volume = parseFloat(audioPlayerVol.value);
audioManagerVolumeStore.setVolume(volume); audioManagerVolumeStore.setVolume(volume);
@ -88,6 +95,11 @@
changeVolume(); changeVolume();
} }
function disallowKeys() {
audioPlayerVol.blur();
return false;
}
function setDecrease() { function setDecrease() {
audioManagerVolumeStore.setDecreaseWhileTalking(decreaseWhileTalking); audioManagerVolumeStore.setDecreaseWhileTalking(decreaseWhileTalking);
} }
@ -116,7 +128,7 @@
</g> </g>
</svg> </svg>
</span> </span>
<input type="range" min="0" max="1" step="0.025" bind:this={audioPlayerVol} on:change={setVolume}> <input type="range" min="0" max="1" step="0.025" bind:this={audioPlayerVol} on:change={setVolume} on:keydown={disallowKeys}>
</div> </div>
<div class="audio-manager-reduce-conversation"> <div class="audio-manager-reduce-conversation">
<label> <label>

View File

@ -289,7 +289,9 @@ export const mediaStreamConstraintsStore = derived(
// Disable webcam for energy reasons (the user is not moving and we are talking to no one) // Disable webcam for energy reasons (the user is not moving and we are talking to no one)
if ($cameraEnergySavingStore === true) { if ($cameraEnergySavingStore === true) {
currentVideoConstraint = false; currentVideoConstraint = false;
currentAudioConstraint = false; //this optimization is desactivated because of sound issues on chrome
//todo: fix this conflicts and reactivate this optimization
//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.
@ -376,7 +378,8 @@ function toggleConstraints(track: MediaStreamTrack, constraints: MediaTrackConst
} else if (constraints === false) { } else if (constraints === false) {
track.stop(); track.stop();
} }
if (constraints && constraints !== true) { // @ts-ignore
if (typeof constraints !== "boolean" && constraints !== true) {
track.applyConstraints(constraints); track.applyConstraints(constraints);
} }
} }
@ -391,12 +394,11 @@ export const localStreamStore = derived<Readable<MediaStreamConstraints>, LocalS
async function initStream(constraints: MediaStreamConstraints) { async function initStream(constraints: MediaStreamConstraints) {
try { try {
const newStream = await navigator.mediaDevices.getUserMedia(constraints);
if (currentStream) { if (currentStream) {
//we need stop all tracks to make sure the old stream will be garbage collected //we need stop all tracks to make sure the old stream will be garbage collected
currentStream.getTracks().forEach((t) => t.stop()); //currentStream.getTracks().forEach((t) => t.stop());
} }
currentStream = newStream; currentStream = await navigator.mediaDevices.getUserMedia(constraints);
set({ set({
type: "success", type: "success",
stream: currentStream, stream: currentStream,
@ -480,7 +482,8 @@ export const localStreamStore = derived<Readable<MediaStreamConstraints>, LocalS
type: "success", type: "success",
stream: null, stream: null,
}); });
} else if ((constraints.audio && !oldConstraints.audio) || (!oldConstraints.video && constraints.video)) { } //we reemit the stream if it was muted just to be sure
else if (constraints.audio /* && !oldConstraints.audio*/ || (!oldConstraints.video && constraints.video)) {
initStream(constraints); initStream(constraints);
} }
oldConstraints = { oldConstraints = {