@unith-ai/core-client 2.0.3-beta.2 → 2.0.4

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.
package/dist/lib.web.js CHANGED
@@ -51209,6 +51209,7 @@ var Conversation = class _Conversation {
51209
51209
  allowWakeLock,
51210
51210
  language,
51211
51211
  fadeTransitionsType,
51212
+ microphoneProvider,
51212
51213
  onStatusChange
51213
51214
  } = fullOptions;
51214
51215
  onStatusChange({ status: "connecting" });
@@ -51250,17 +51251,21 @@ var Conversation = class _Conversation {
51250
51251
  });
51251
51252
  const videoelement = options.element;
51252
51253
  let microphoneAccess = false;
51253
- try {
51254
- audioInputStream = await navigator.mediaDevices.getUserMedia({
51255
- audio: true
51256
- });
51257
- audioInputStream.getTracks().forEach((track) => {
51258
- track.stop();
51259
- });
51260
- audioInputStream = null;
51254
+ if (microphoneProvider !== "custom") {
51255
+ try {
51256
+ audioInputStream = await navigator.mediaDevices.getUserMedia({
51257
+ audio: true
51258
+ });
51259
+ audioInputStream.getTracks().forEach((track) => {
51260
+ track.stop();
51261
+ });
51262
+ audioInputStream = null;
51263
+ microphoneAccess = true;
51264
+ } catch (error) {
51265
+ microphoneAccess = false;
51266
+ }
51267
+ } else {
51261
51268
  microphoneAccess = true;
51262
- } catch (error) {
51263
- microphoneAccess = false;
51264
51269
  }
51265
51270
  [audioOutput, videoOutput] = await Promise.all([
51266
51271
  AudioOutput.createAudioOutput(defaultAudioOutputFormat),