diff --git a/frontend/react/src/audio/audiomanager.ts b/frontend/react/src/audio/audiomanager.ts index 94c1a0cb..c0437796 100644 --- a/frontend/react/src/audio/audiomanager.ts +++ b/frontend/react/src/audio/audiomanager.ts @@ -29,6 +29,7 @@ export class AudioManager { #running: boolean = false; #address: string = "localhost"; #port: number = 4000; + #endpoint: string = "audio"; #socket: WebSocket | null = null; #guid: string = makeID(22); #SRSClientUnitIDs: number[] = []; @@ -38,6 +39,9 @@ export class AudioManager { let config = getApp().getConfig(); if (config["WSPort"]) { this.setPort(config["WSPort"]); + } + if (config["WSAddress"]) { + this.setEndpoint(config["WSEndpoint"]); } }); @@ -55,9 +59,9 @@ export class AudioManager { let res = this.#address.match(/(?:http|https):\/\/(.+):/); let wsAddress = res ? res[1] : this.#address; if (this.#address.includes("https")) - this.#socket = new WebSocket(`wss://${wsAddress}/${getApp().getConfig()['WSAddress']}`); + this.#socket = new WebSocket(`wss://${wsAddress}/${this.#endpoint}`); else - this.#socket = new WebSocket(`ws://${wsAddress}:${getApp().getConfig()['WSPort']}`); + this.#socket = new WebSocket(`ws://${wsAddress}:${this.#port}`); /* Log the opening of the connection */ this.#socket.addEventListener("open", (event) => { @@ -136,6 +140,10 @@ export class AudioManager { this.#port = port; } + setEndpoint(endpoint) { + this.#endpoint = endpoint; + } + addFileSource(file) { console.log(`Adding file source from ${file.name}`); if (!this.#running) { diff --git a/olympus.json b/olympus.json index c02ba47d..f321dff6 100644 --- a/olympus.json +++ b/olympus.json @@ -37,6 +37,6 @@ "audio": { "SRSPort": 5002, "WSPort": 4000, - "WSAddress": "audio" + "WSEndpoint": "audio" } }