@vgroup/dialbox 0.4.92 → 0.4.94
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/esm2020/lib/components/call-progress/call-progress.component.mjs +11 -7
- package/fesm2015/vgroup-dialbox.mjs +10 -6
- package/fesm2015/vgroup-dialbox.mjs.map +1 -1
- package/fesm2020/vgroup-dialbox.mjs +10 -6
- package/fesm2020/vgroup-dialbox.mjs.map +1 -1
- package/lib/components/call-progress/call-progress.component.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1780,6 +1780,8 @@ class CallProgressComponent {
|
|
|
1780
1780
|
this.searchText = '';
|
|
1781
1781
|
this.filteredList = [];
|
|
1782
1782
|
this.showButton = false;
|
|
1783
|
+
this.isRinging = false;
|
|
1784
|
+
this.incomingAudio = new Audio('assets/phone-ringing.mp3');
|
|
1783
1785
|
this.micOn = false;
|
|
1784
1786
|
this.isMinimised = false;
|
|
1785
1787
|
console.log('Call Progress Component');
|
|
@@ -1789,6 +1791,7 @@ class CallProgressComponent {
|
|
|
1789
1791
|
console.log('Call Progress Component ngOnInit');
|
|
1790
1792
|
// Subscribe to incoming calls from TwilioService
|
|
1791
1793
|
try {
|
|
1794
|
+
this.incomingAudio['loop'] = true;
|
|
1792
1795
|
this.twilioService.currentCall.subscribe((incoming) => {
|
|
1793
1796
|
if (!incoming) {
|
|
1794
1797
|
return;
|
|
@@ -1993,13 +1996,14 @@ class CallProgressComponent {
|
|
|
1993
1996
|
}
|
|
1994
1997
|
}
|
|
1995
1998
|
this.cdr.detectChanges();
|
|
1996
|
-
let
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
incomingAudio.play();
|
|
1999
|
+
let incomingData = this.currentCallList.find((res) => res.isIncomingCall && !res.isAcceptCall);
|
|
2000
|
+
if (incomingData?.id && !this.isRinging) {
|
|
2001
|
+
this.isRinging = true;
|
|
2002
|
+
this.incomingAudio.play();
|
|
2000
2003
|
}
|
|
2001
|
-
else {
|
|
2002
|
-
|
|
2004
|
+
else if (!incomingData?.id && this.isRinging) {
|
|
2005
|
+
this.isRinging = false;
|
|
2006
|
+
this.incomingAudio.pause();
|
|
2003
2007
|
}
|
|
2004
2008
|
console.log('currentCallList', this.currentCallList);
|
|
2005
2009
|
}
|