|
1 | | -import{ChangeDetectorRef,Component,OnInit}from"@angular/core"; |
2 | | -import{Store}from"@ngrx/store"; |
3 | | -import{DepartmentVoiceChannelResultData}from'@resgrid/ngx-resgridlib'; |
4 | | -import{Observable,Subscription}from"rxjs"; |
5 | | -import{VoiceState}from"src/app/features/voice/store/voice.store"; |
6 | | -import{AudioProvider}from"src/app/providers/audio"; |
7 | | -import{OpenViduService}from"src/app/providers/openvidu"; |
8 | | -import{selectAvailableChannelsState,selectVoiceState}from"src/app/store"; |
9 | | -import*asVoiceActionsfrom"../../actions/voice.actions"; |
| 1 | +import{Component,OnInit}from"@angular/core"; |
10 | 2 |
|
11 | 3 | @Component({ |
12 | 4 | selector:"app-voice-footer", |
13 | 5 | templateUrl:"./voice-footer.component.html", |
14 | 6 | styleUrls:["./voice-footer.component.scss"], |
15 | 7 | }) |
16 | 8 | exportclassVoiceFooterComponentimplementsOnInit{ |
17 | | -publicselectedChannel:DepartmentVoiceChannelResultData; |
18 | | -publicisTransmitting:boolean=false; |
19 | | -publicvoiceState$:Observable<VoiceState|null>; |
20 | | -publicavailableChannels$:Observable<DepartmentVoiceChannelResultData[]|null>; |
21 | 9 |
|
22 | | -privateparticipants:number=0; |
23 | | -privatevoiceSubscription:Subscription; |
24 | | -privateavailableChannelsSubscription:Subscription; |
| 10 | +constructor(){ |
25 | 11 |
|
26 | | -constructor(privatestore:Store<VoiceState>,privateaudioProvider:AudioProvider, |
27 | | -publicopenViduService:OpenViduService,privateref:ChangeDetectorRef){ |
28 | | -this.voiceState$=this.store.select(selectVoiceState); |
29 | 12 | } |
30 | 13 |
|
31 | 14 | ngOnInit():void{ |
32 | 15 |
|
33 | 16 | } |
34 | 17 |
|
35 | 18 | ngOnDestroy():void{ |
36 | | -if(this.voiceSubscription){ |
37 | | -this.voiceSubscription.unsubscribe(); |
38 | | -this.voiceSubscription=null; |
39 | | -} |
40 | 19 |
|
41 | | -if(this.availableChannelsSubscription){ |
42 | | -this.availableChannelsSubscription.unsubscribe(); |
43 | | -this.availableChannelsSubscription=null; |
44 | | -} |
45 | 20 | } |
46 | 21 | } |