hanc-webrtc-widgets 2.2.11 → 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 {
|
|
@@ -17279,7 +17281,8 @@ class wd extends EventTarget {
|
|
|
17279
17281
|
body: JSON.stringify({
|
|
17280
17282
|
metadata: {
|
|
17281
17283
|
agent_id: e,
|
|
17282
|
-
timestamp: Date.now()
|
|
17284
|
+
timestamp: Date.now(),
|
|
17285
|
+
is_apple_device: this.isAppleDevice
|
|
17283
17286
|
}
|
|
17284
17287
|
})
|
|
17285
17288
|
},
|
|
@@ -17304,24 +17307,25 @@ class wd extends EventTarget {
|
|
|
17304
17307
|
}
|
|
17305
17308
|
if (t)
|
|
17306
17309
|
try {
|
|
17310
|
+
const l = !this.isAppleDevice;
|
|
17307
17311
|
await n.localParticipant.setMicrophoneEnabled(!0, {
|
|
17308
|
-
echoCancellation:
|
|
17309
|
-
noiseSuppression:
|
|
17310
|
-
autoGainControl:
|
|
17311
|
-
}), 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(() => {
|
|
17312
17316
|
if (!(this.isDestroyed || !this.room || this.room.state !== "connected"))
|
|
17313
17317
|
try {
|
|
17314
|
-
const
|
|
17315
|
-
if (
|
|
17316
|
-
const
|
|
17317
|
-
|
|
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(
|
|
17318
17322
|
new CustomEvent("local-audio-track", {
|
|
17319
|
-
detail:
|
|
17323
|
+
detail: u
|
|
17320
17324
|
})
|
|
17321
17325
|
);
|
|
17322
17326
|
}
|
|
17323
|
-
} catch (
|
|
17324
|
-
console.warn("[LiveKit] Error getting local audio track:",
|
|
17327
|
+
} catch (d) {
|
|
17328
|
+
console.warn("[LiveKit] Error getting local audio track:", d);
|
|
17325
17329
|
}
|
|
17326
17330
|
}, 100);
|
|
17327
17331
|
} catch (l) {
|
|
@@ -17460,11 +17464,16 @@ class wd extends EventTarget {
|
|
|
17460
17464
|
async toggleMicrophone() {
|
|
17461
17465
|
if (this.room)
|
|
17462
17466
|
try {
|
|
17463
|
-
|
|
17464
|
-
|
|
17465
|
-
|
|
17466
|
-
|
|
17467
|
-
|
|
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
|
+
}
|
|
17468
17477
|
} catch (e) {
|
|
17469
17478
|
this.error = `Failed to toggle microphone: ${e instanceof Error ? e.message : String(e)}`, this.dispatchEvent(
|
|
17470
17479
|
new CustomEvent("error", {
|