@@ -26,32 +26,10 @@ export class VoiceFooterComponent implements OnInit {
2626 constructor ( private store : Store < VoiceState > , private audioProvider : AudioProvider ,
2727 public openViduService : OpenViduService , private ref : ChangeDetectorRef ) {
2828 this . voiceState$ = this . store . select ( selectVoiceState ) ;
29- this . availableChannels$ = this . store . select ( selectAvailableChannelsState ) ;
3029 }
3130
3231 ngOnInit ( ) : void {
33- this . availableChannelsSubscription = this . availableChannels$ . subscribe ( ( channels ) => {
34- if ( channels ) {
35- this . selectedChannel = channels [ 0 ] ;
36- }
37- } ) ;
3832
39- this . voiceSubscription = this . voiceState$ . subscribe ( ( state ) => {
40- if ( state ) {
41- if ( state . currentActiveVoipChannel ) {
42- this . selectedChannel = state . currentActiveVoipChannel ;
43- } else if ( state . channels ) {
44- this . selectedChannel = state . channels [ 0 ] ;
45- }
46-
47- this . isTransmitting = state . isTransmitting ;
48-
49- if ( this . participants !== state . participants ) {
50- this . ref . detectChanges ( ) ;
51- this . participants = state . participants ;
52- }
53- }
54- } ) ;
5533 }
5634
5735 ngOnDestroy ( ) : void {
@@ -65,34 +43,4 @@ export class VoiceFooterComponent implements OnInit {
6543 this . availableChannelsSubscription = null ;
6644 }
6745 }
68-
69- public toggleTransmitting ( ) {
70- if ( this . isTransmitting ) {
71- this . stopTransmitting ( ) ;
72- } else {
73- this . startTransmitting ( ) ;
74- }
75- }
76-
77- public startTransmitting ( ) : void {
78- this . audioProvider . playTransmitStart ( ) ;
79- this . store . dispatch ( new VoiceActions . StartTransmitting ( ) ) ;
80- }
81-
82- public stopTransmitting ( ) : void {
83- this . store . dispatch ( new VoiceActions . StopTransmitting ( ) ) ;
84- this . audioProvider . playTransmitEnd ( ) ;
85- }
86-
87- public stopTransmittingLeave ( ) : void {
88- this . store . dispatch ( new VoiceActions . StopTransmitting ( ) ) ;
89- }
90-
91- public onChannelChange ( channel ) {
92- if ( channel . Id === '' ) {
93- this . store . dispatch ( new VoiceActions . SetNoChannel ( ) ) ;
94- } else {
95- this . store . dispatch ( new VoiceActions . SetActiveChannel ( channel ) ) ;
96- }
97- }
9846}
0 commit comments