@vgroup/dialbox 0.4.91 → 0.4.93

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.
@@ -1782,6 +1782,8 @@ class CallProgressComponent {
1782
1782
  this.searchText = '';
1783
1783
  this.filteredList = [];
1784
1784
  this.showButton = false;
1785
+ this.isRinging = false;
1786
+ this.incomingAudio = new Audio('assets/silent-sound.mp3');
1785
1787
  this.micOn = false;
1786
1788
  this.isMinimised = false;
1787
1789
  console.log('Call Progress Component');
@@ -1791,6 +1793,7 @@ class CallProgressComponent {
1791
1793
  console.log('Call Progress Component ngOnInit');
1792
1794
  // Subscribe to incoming calls from TwilioService
1793
1795
  try {
1796
+ this.incomingAudio['loop'] = false;
1794
1797
  this.twilioService.currentCall.subscribe((incoming) => {
1795
1798
  if (!incoming) {
1796
1799
  return;
@@ -1944,10 +1947,14 @@ class CallProgressComponent {
1944
1947
  }
1945
1948
  }
1946
1949
  this.cdr.detectChanges();
1947
- if (this.currentCallList && this.currentCallList[0].isIncomingCall && this.currentCallList[0].isAcceptCall) {
1948
- let incomingAudio = new Audio('assets/sample-file-4.mp3');
1949
- incomingAudio.loop = false;
1950
- incomingAudio.play();
1950
+ let incomingData = this.currentCallList.find((res) => res.isIncomingCall && !res.isAcceptCall);
1951
+ if (incomingData === null || incomingData === void 0 ? void 0 : incomingData.id) {
1952
+ this.isRinging = true;
1953
+ this.incomingAudio.play();
1954
+ }
1955
+ else if (!(incomingData === null || incomingData === void 0 ? void 0 : incomingData.id)) {
1956
+ this.isRinging = false;
1957
+ this.incomingAudio.pause();
1951
1958
  }
1952
1959
  console.log('currentCallList', this.currentCallList);
1953
1960
  }