diff --git a/client/public/en.lang b/client/public/en.lang
index b2cfb83a4..7a0b72d5b 100644
--- a/client/public/en.lang
+++ b/client/public/en.lang
@@ -17,7 +17,8 @@ navbar.upgradeRequired=Upgrade required
home.confirmLoginHeader=Welcome back!
home.confirmLoginBody=Are you trying to login as %player? If you are not, please close this window.
-home.confirmLoginButton=Yes! That's me!
+home.confirmLoginButton=Start session
+home.confirmLoginWithVoicechat=Start session with VoiceChat
home.activate=Activate session
home.activateText=This is personal webpage will be used to play your audio and voice throughout your visit. Please click anywhere on this page to get started.
diff --git a/client/src/client/OpenAudioAppContainer.js b/client/src/client/OpenAudioAppContainer.js
index a9296c64c..8fd486a1f 100644
--- a/client/src/client/OpenAudioAppContainer.js
+++ b/client/src/client/OpenAudioAppContainer.js
@@ -172,6 +172,14 @@ class OpenAudioAppContainer extends React.Component {
return;
}
+ if (serverData.isVoicechatEnabled) {
+ setGlobalState({
+ voiceState: {
+ serverHasVoiceChat: true,
+ },
+ })
+ }
+
if (serverData.useTranslations) {
let localLanguage = navigator.language || navigator.userLanguage;
let language = localLanguage.split("-")[0];
diff --git a/client/src/client/services/socket/handlers/voice/HandleVoicechatUnlock.js b/client/src/client/services/socket/handlers/voice/HandleVoicechatUnlock.js
index a90d643fa..9ed4e9cec 100644
--- a/client/src/client/services/socket/handlers/voice/HandleVoicechatUnlock.js
+++ b/client/src/client/services/socket/handlers/voice/HandleVoicechatUnlock.js
@@ -1,5 +1,6 @@
-import {setGlobalState} from "../../../../../state/store";
+import {getGlobalState, setGlobalState} from "../../../../../state/store";
import {toast} from "react-toastify";
+import {VoiceModule} from "../../../voice/VoiceModule";
export function HandleVoiceUnlock(data) {
@@ -27,4 +28,9 @@ export function HandleVoiceUnlock(data) {
serverHasModeration: data.hasModeration
}
})
+
+ // is it set to auto join?
+ if (getGlobalState().voiceState.autoJoinVoiceChat) {
+ VoiceModule.startVoiceChat();
+ }
}
diff --git a/client/src/client/services/voice/VoiceModule.js b/client/src/client/services/voice/VoiceModule.js
index 1d9595800..257b5a747 100644
--- a/client/src/client/services/voice/VoiceModule.js
+++ b/client/src/client/services/voice/VoiceModule.js
@@ -10,6 +10,7 @@ import * as PluginChannel from "../../util/PluginChannel";
import {VoicePeer} from "./peers/VoicePeer";
import {feedDebugValue} from "../debugging/DebugService";
import {DebugStatistic} from "../debugging/DebugStatistic";
+import {setTab} from "../../../components/tabwindow/TabWindow";
var gainTrackers = {}
@@ -69,6 +70,7 @@ export const VoiceModule = new class IVoiceModule {
}
startVoiceChat() {
+ setTab(1);
this.showLoadingPopup();
// try to get the device
diff --git a/client/src/components/clicktoconnect/ClickPrompt.js b/client/src/components/clicktoconnect/ClickPrompt.js
index bdde8dbd9..436613410 100644
--- a/client/src/components/clicktoconnect/ClickPrompt.js
+++ b/client/src/components/clicktoconnect/ClickPrompt.js
@@ -3,9 +3,10 @@ import "./clickprompt.css";
import {getTranslation, OAC} from "../../client/OpenAudioAppContainer";
import {OaStyleCard} from "../card/OaStyleCard";
import {BlackoutPage} from "../layout/BlackoutPage";
-import {getGlobalState} from "../../state/store";
+import {getGlobalState, setGlobalState} from "../../state/store";
+import {connect} from "react-redux";
-export class ClickPrompt extends React.Component {
+class ClickPrompt extends React.Component {
static contextType = OAC;
render() {
@@ -14,52 +15,63 @@ export class ClickPrompt extends React.Component {
let welcomeWithName = getTranslation(c, "home.confirmLoginBody");
welcomeWithName = welcomeWithName.replace("%name", currentUser.userName);
+
+ // instant join voice button as well
+ let voiceButton = ;
+
return (