mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Moved audio sink toggle to unit control panel
This commit is contained in:
@@ -54,7 +54,10 @@ export class AudioManager {
|
||||
/* Connect the audio websocket */
|
||||
let res = this.#address.match(/(?:http|https):\/\/(.+):/);
|
||||
let wsAddress = res ? res[1] : this.#address;
|
||||
this.#socket = new WebSocket(`wss://refugees.dcsolympus.com/audio`);
|
||||
if (this.#address.includes("https"))
|
||||
this.#socket = new WebSocket(`wss://${wsAddress}/${getApp().getConfig()['WSAddress']}`);
|
||||
else
|
||||
this.#socket = new WebSocket(`ws://${wsAddress}:${getApp().getConfig()['WSPort']}`);
|
||||
|
||||
/* Log the opening of the connection */
|
||||
this.#socket.addEventListener("open", (event) => {
|
||||
@@ -63,7 +66,7 @@ export class AudioManager {
|
||||
|
||||
/* Log any websocket errors */
|
||||
this.#socket.addEventListener("error", (event) => {
|
||||
console.log(event);
|
||||
console.log("An error occurred while connecting the WebSocket: " + event);
|
||||
});
|
||||
|
||||
/* Handle the reception of a new message */
|
||||
|
||||
@@ -37,7 +37,7 @@ export class UnitSink extends AudioSink {
|
||||
});
|
||||
|
||||
Object.keys(this.#unitPipelines).forEach((unitID) => {
|
||||
if (!(unitID in getApp().getAudioManager().getSRSClientsUnitIDs())) {
|
||||
if (!(getApp().getAudioManager().getSRSClientsUnitIDs().includes(parseInt(unitID)))) {
|
||||
delete this.#unitPipelines[unitID];
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user