forked from abner/for-legacy-web
Format and automatically fix linted code.
This commit is contained in:
@@ -117,10 +117,10 @@ export default class Signaling extends EventEmitter<SignalingEvents> {
|
||||
this.once("close", onClose);
|
||||
const json = {
|
||||
id: this.index,
|
||||
type: type,
|
||||
type,
|
||||
data,
|
||||
};
|
||||
ws.send(JSON.stringify(json) + "\n");
|
||||
ws.send(`${JSON.stringify(json)}\n`);
|
||||
this.index++;
|
||||
});
|
||||
}
|
||||
@@ -161,7 +161,7 @@ export default class Signaling extends EventEmitter<SignalingEvents> {
|
||||
type: ProduceType,
|
||||
rtpParameters: RtpParameters,
|
||||
): Promise<string> {
|
||||
let result = await this.sendRequest(WSCommandType.StartProduce, {
|
||||
const result = await this.sendRequest(WSCommandType.StartProduce, {
|
||||
type,
|
||||
rtpParameters,
|
||||
});
|
||||
|
||||
@@ -172,7 +172,7 @@ export default class VoiceClient extends EventEmitter<VoiceEvents> {
|
||||
if (this.device === undefined || this.roomId === undefined)
|
||||
throw new ReferenceError("Voice Client is in an invalid state");
|
||||
const result = await this.signaling.authenticate(token, this.roomId);
|
||||
let [room] = await Promise.all([
|
||||
const [room] = await Promise.all([
|
||||
this.signaling.roomInfo(),
|
||||
this.device.load({ routerRtpCapabilities: result.rtpCapabilities }),
|
||||
]);
|
||||
@@ -229,7 +229,7 @@ export default class VoiceClient extends EventEmitter<VoiceEvents> {
|
||||
});
|
||||
|
||||
this.emit("ready");
|
||||
for (let user of this.participants) {
|
||||
for (const user of this.participants) {
|
||||
if (user[1].audio && user[0] !== this.userId)
|
||||
this.startConsume(user[0], "audio");
|
||||
}
|
||||
@@ -323,7 +323,7 @@ export default class VoiceClient extends EventEmitter<VoiceEvents> {
|
||||
await this.signaling.stopProduce(type);
|
||||
} catch (error) {
|
||||
if (error.error === WSErrorCode.ProducerNotFound) return;
|
||||
else throw error;
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user