@vgroup/dialbox 0.4.63 → 0.4.64

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.
@@ -1780,6 +1780,7 @@ class CallProgressComponent {
1780
1780
  this.searchText = '';
1781
1781
  this.filteredList = [];
1782
1782
  this.showButton = false;
1783
+ this.micOn = false;
1783
1784
  this.isMinimised = false;
1784
1785
  console.log('Call Progress Component');
1785
1786
  this.call = this.twilioService.device;
@@ -2392,6 +2393,7 @@ class CallProgressComponent {
2392
2393
  // conferenceId: this.conferenceId,
2393
2394
  // mute: !this.isMute,
2394
2395
  // })
2396
+ this.toggleMic();
2395
2397
  this.isMute = !this.isMute;
2396
2398
  console.log('isMute', this.call);
2397
2399
  console.log('isMutedevice', this.twilioService.device);
@@ -2402,6 +2404,16 @@ class CallProgressComponent {
2402
2404
  // } else {
2403
2405
  // }
2404
2406
  }
2407
+ async toggleMic() {
2408
+ if (!this.audioStream) {
2409
+ // first time: request mic
2410
+ this.audioStream = await navigator.mediaDevices.getUserMedia({ audio: true });
2411
+ }
2412
+ this.micOn = !this.micOn;
2413
+ this.audioStream.getAudioTracks().forEach(track => {
2414
+ track.enabled = this.micOn; // false = muted, true = sending audio
2415
+ });
2416
+ }
2405
2417
  toggleKeypad() {
2406
2418
  this.showKeypad = !this.showKeypad;
2407
2419
  this.callInput = '';