Skip to content

Commit

Permalink
CU-3w8ybcw Voice footer change
Browse files Browse the repository at this point in the history
  • Loading branch information
ucswift committed Mar 6, 2024
1 parent 2a970ac commit 5755a99
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 52 deletions.
3 changes: 3 additions & 0 deletions Caddyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
localhost
encode zstd gzip
root * /usr/share/caddy/html
Original file line number Diff line number Diff line change
Expand Up @@ -26,32 +26,10 @@ export class VoiceFooterComponent implements OnInit {
constructor(private store: Store<VoiceState>, private audioProvider: AudioProvider,
public openViduService: OpenViduService, private ref: ChangeDetectorRef) {
this.voiceState$ = this.store.select(selectVoiceState);
this.availableChannels$ = this.store.select(selectAvailableChannelsState);
}

ngOnInit(): void {
this.availableChannelsSubscription = this.availableChannels$.subscribe((channels) => {
if (channels) {
this.selectedChannel = channels[0];
}
});

this.voiceSubscription = this.voiceState$.subscribe((state) => {
if (state) {
if (state.currentActiveVoipChannel) {
this.selectedChannel = state.currentActiveVoipChannel;
} else if (state.channels) {
this.selectedChannel = state.channels[0];
}

this.isTransmitting = state.isTransmitting;

if (this.participants !== state.participants) {
this.ref.detectChanges();
this.participants = state.participants;
}
}
});
}

ngOnDestroy(): void {
Expand All @@ -65,34 +43,4 @@ export class VoiceFooterComponent implements OnInit {
this.availableChannelsSubscription = null;
}
}

public toggleTransmitting() {
if (this.isTransmitting) {
this.stopTransmitting();
} else {
this.startTransmitting();
}
}

public startTransmitting(): void {
this.audioProvider.playTransmitStart();
this.store.dispatch(new VoiceActions.StartTransmitting());
}

public stopTransmitting(): void {
this.store.dispatch(new VoiceActions.StopTransmitting());
this.audioProvider.playTransmitEnd();
}

public stopTransmittingLeave(): void {
this.store.dispatch(new VoiceActions.StopTransmitting());
}

public onChannelChange(channel) {
if (channel.Id === '') {
this.store.dispatch(new VoiceActions.SetNoChannel());
} else {
this.store.dispatch(new VoiceActions.SetActiveChannel(channel));
}
}
}

0 comments on commit 5755a99

Please sign in to comment.