refactor(audio): remove duplicated loadBridges method definition

Seems to have been introduced by a partial merge commit

There were a bunch of style changes introduced by that partial commit as well; I kept those changes to avoid introducing further conflicts between v2.4-2.5...
This commit is contained in:
prlanzarin 2022-02-22 13:42:20 -03:00
parent dff4bfde2f
commit adc13add67

View File

@ -143,47 +143,6 @@ class AudioManager {
}
}
/**
* Load audio bridges modules to be used the manager.
*
* Bridges can be configured in settings.yml file.
* @param {Object} userData The Object representing user data to be passed to
* the bridge.
*/
async loadBridges(userData) {
let FullAudioBridge = SIPBridge;
let ListenOnlyBridge = KurentoBridge;
if (MEDIA.audio) {
const { bridges, defaultFullAudioBridge, defaultListenOnlyBridge } =
MEDIA.audio;
this.bridges = {};
await Promise.all(
Object.values(bridges).map(async (bridge) => {
// eslint-disable-next-line import/no-dynamic-require, global-require
this.bridges[bridge.name] = (
(await import(DEFAULT_AUDIO_BRIDGES_PATH + bridge.path)) || {}
).default;
})
);
if (defaultFullAudioBridge && this.bridges[defaultFullAudioBridge]) {
FullAudioBridge = this.bridges[defaultFullAudioBridge];
}
if (defaultListenOnlyBridge && this.bridges[defaultListenOnlyBridge]) {
ListenOnlyBridge = this.bridges[defaultListenOnlyBridge];
}
}
this.bridge = new FullAudioBridge(userData);
if (this.useKurento) {
this.listenOnlyBridge = new ListenOnlyBridge(userData);
}
}
setAudioMessages(messages, intl) {
this.messages = messages;
this.intl = intl;