mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-10 01:03:36 -05:00
Use server configuration for voso websocket.
This commit is contained in:
parent
0494f0647a
commit
d5430a7920
1 changed files with 14 additions and 13 deletions
|
@ -95,7 +95,10 @@ class VoiceStateReference {
|
|||
try {
|
||||
const call = await channel.joinCall();
|
||||
|
||||
await this.client.connect("wss://voso.revolt.chat/ws", channel._id);
|
||||
await this.client.connect(
|
||||
channel.client.configuration!.features.voso.ws,
|
||||
channel._id,
|
||||
);
|
||||
|
||||
runInAction(() => {
|
||||
this.status = VoiceStatus.AUTHENTICATING;
|
||||
|
@ -144,30 +147,27 @@ class VoiceStateReference {
|
|||
}
|
||||
|
||||
isDeaf() {
|
||||
if(!this.client)
|
||||
return false;
|
||||
if (!this.client) return false;
|
||||
|
||||
return this.client.isDeaf;
|
||||
}
|
||||
|
||||
async startDeafen() {
|
||||
if(!this.client)
|
||||
return console.log("No client object"); // ! TODO: let the user know
|
||||
if (!this.client) return console.log("No client object"); // ! TODO: let the user know
|
||||
|
||||
this.client.isDeaf = true;
|
||||
|
||||
this.client?.consumers.forEach(consumer => {
|
||||
this.client?.consumers.forEach((consumer) => {
|
||||
consumer.audio?.pause();
|
||||
})
|
||||
});
|
||||
}
|
||||
async stopDeafen() {
|
||||
if(!this.client)
|
||||
return console.log("No client object"); // ! TODO: let the user know
|
||||
if (!this.client) return console.log("No client object"); // ! TODO: let the user know
|
||||
|
||||
this.client.isDeaf = false;
|
||||
this.client?.consumers.forEach(consumer => {
|
||||
this.client?.consumers.forEach((consumer) => {
|
||||
consumer.audio?.resume();
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
async startProducing(type: ProduceType) {
|
||||
|
@ -179,10 +179,11 @@ class VoiceStateReference {
|
|||
if (navigator.mediaDevices === undefined)
|
||||
return console.log("No media devices."); // ! TODO: let the user know
|
||||
|
||||
const mediaDevice = window.localStorage.getItem("audioInputDevice");
|
||||
const mediaDevice =
|
||||
window.localStorage.getItem("audioInputDevice");
|
||||
|
||||
const mediaStream = await navigator.mediaDevices.getUserMedia({
|
||||
audio: mediaDevice?{deviceId: mediaDevice}:true
|
||||
audio: mediaDevice ? { deviceId: mediaDevice } : true,
|
||||
});
|
||||
|
||||
await this.client?.startProduce(
|
||||
|
|
Loading…
Reference in a new issue