hanc-webrtc-widgets 2.2.12 → 2.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -17267,7 +17267,9 @@ class wd extends EventTarget {
|
|
|
17267
17267
|
}
|
|
17268
17268
|
this.updateStatus("connecting"), this.error = null, this.isReady = !1, this.room && (await this.room.disconnect(), this.room = null);
|
|
17269
17269
|
try {
|
|
17270
|
-
const n = new rr(
|
|
17270
|
+
const n = new rr({
|
|
17271
|
+
webAudioMix: !0
|
|
17272
|
+
});
|
|
17271
17273
|
this.room = n, this.setupRoomEventListeners(n);
|
|
17272
17274
|
let s;
|
|
17273
17275
|
try {
|
|
@@ -17305,24 +17307,25 @@ class wd extends EventTarget {
|
|
|
17305
17307
|
}
|
|
17306
17308
|
if (t)
|
|
17307
17309
|
try {
|
|
17310
|
+
const l = !this.isAppleDevice;
|
|
17308
17311
|
await n.localParticipant.setMicrophoneEnabled(!0, {
|
|
17309
|
-
echoCancellation:
|
|
17310
|
-
noiseSuppression:
|
|
17311
|
-
autoGainControl:
|
|
17312
|
-
}), this.microphoneEnabled = !0, this.dispatchEvent(new CustomEvent("microphone-enabled")), t.getTracks().forEach((
|
|
17312
|
+
echoCancellation: l,
|
|
17313
|
+
noiseSuppression: l,
|
|
17314
|
+
autoGainControl: l
|
|
17315
|
+
}), this.microphoneEnabled = !0, this.dispatchEvent(new CustomEvent("microphone-enabled")), t.getTracks().forEach((d) => d.stop()), this.scheduleTimer(() => {
|
|
17313
17316
|
if (!(this.isDestroyed || !this.room || this.room.state !== "connected"))
|
|
17314
17317
|
try {
|
|
17315
|
-
const
|
|
17316
|
-
if (
|
|
17317
|
-
const
|
|
17318
|
-
|
|
17318
|
+
const d = Array.from(n.localParticipant.audioTrackPublications.values()).find((u) => u.kind === "audio");
|
|
17319
|
+
if (d != null && d.track) {
|
|
17320
|
+
const u = d.track.mediaStreamTrack;
|
|
17321
|
+
u && this.dispatchEvent(
|
|
17319
17322
|
new CustomEvent("local-audio-track", {
|
|
17320
|
-
detail:
|
|
17323
|
+
detail: u
|
|
17321
17324
|
})
|
|
17322
17325
|
);
|
|
17323
17326
|
}
|
|
17324
|
-
} catch (
|
|
17325
|
-
console.warn("[LiveKit] Error getting local audio track:",
|
|
17327
|
+
} catch (d) {
|
|
17328
|
+
console.warn("[LiveKit] Error getting local audio track:", d);
|
|
17326
17329
|
}
|
|
17327
17330
|
}, 100);
|
|
17328
17331
|
} catch (l) {
|
|
@@ -17461,11 +17464,16 @@ class wd extends EventTarget {
|
|
|
17461
17464
|
async toggleMicrophone() {
|
|
17462
17465
|
if (this.room)
|
|
17463
17466
|
try {
|
|
17464
|
-
|
|
17465
|
-
|
|
17466
|
-
|
|
17467
|
-
|
|
17468
|
-
|
|
17467
|
+
if (this.microphoneEnabled)
|
|
17468
|
+
await this.room.localParticipant.setMicrophoneEnabled(!1), this.microphoneEnabled = !1, this.dispatchEvent(new CustomEvent("microphone-disabled"));
|
|
17469
|
+
else {
|
|
17470
|
+
const e = !this.isAppleDevice;
|
|
17471
|
+
await this.room.localParticipant.setMicrophoneEnabled(!0, {
|
|
17472
|
+
echoCancellation: e,
|
|
17473
|
+
noiseSuppression: e,
|
|
17474
|
+
autoGainControl: e
|
|
17475
|
+
}), this.microphoneEnabled = !0, this.dispatchEvent(new CustomEvent("microphone-enabled"));
|
|
17476
|
+
}
|
|
17469
17477
|
} catch (e) {
|
|
17470
17478
|
this.error = `Failed to toggle microphone: ${e instanceof Error ? e.message : String(e)}`, this.dispatchEvent(
|
|
17471
17479
|
new CustomEvent("error", {
|