mirror of https://github.com/OpenVidu/openvidu.git
openvidu-components: Renamed service method
parent
1cdb938ad4
commit
1ee8bd1f6e
|
@ -117,14 +117,14 @@ export class PreJoinComponent implements OnInit, OnDestroy {
|
|||
|
||||
async toggleCam() {
|
||||
const publish = this.isVideoMuted;
|
||||
await this.openviduService.muteVideo(publish);
|
||||
await this.openviduService.publishVideo(publish);
|
||||
this.isVideoMuted = !this.isVideoMuted;
|
||||
this.storageSrv.setVideoMuted(this.isVideoMuted);
|
||||
}
|
||||
|
||||
toggleMic() {
|
||||
const publish = this.isAudioMuted;
|
||||
this.openviduService.muteAudio(publish);
|
||||
this.openviduService.publishAudio(publish);
|
||||
this.isAudioMuted = !this.isAudioMuted;
|
||||
this.storageSrv.setAudioMuted(this.isAudioMuted);
|
||||
}
|
||||
|
|
|
@ -288,7 +288,7 @@ export class ToolbarComponent implements OnInit, OnDestroy {
|
|||
async toggleMicrophone() {
|
||||
this.onMicrophoneButtonClicked.emit();
|
||||
try {
|
||||
await this.openviduService.muteAudio(!this.isAudioActive);
|
||||
await this.openviduService.publishAudio(!this.isAudioActive);
|
||||
} catch (error) {
|
||||
this.log.e('There was an error toggling microphone:', error.code, error.message);
|
||||
this.actionService.openDialog('There was an error toggling camera', error?.error || error?.message);
|
||||
|
@ -303,7 +303,7 @@ export class ToolbarComponent implements OnInit, OnDestroy {
|
|||
|
||||
try {
|
||||
const publishVideo = !this.participantService.hasCameraVideoActive();
|
||||
await this.openviduService.muteVideo(publishVideo);
|
||||
await this.openviduService.publishVideo(publishVideo);
|
||||
} catch (error) {
|
||||
this.log.e('There was an error toggling camera:', error.code, error.message);
|
||||
this.actionService.openDialog('There was an error toggling camera', error?.error || error?.message);
|
||||
|
|
|
@ -220,13 +220,13 @@ export class OpenViduService {
|
|||
}
|
||||
}
|
||||
|
||||
async muteVideo(mute: boolean): Promise<void> {
|
||||
async publishVideo(publish: boolean): Promise<void> {
|
||||
const publishAudio = this.participantService.hasCameraAudioActive();
|
||||
// const publishVideo = !this.participantService.hasCameraVideoActive();
|
||||
|
||||
// Disabling webcam
|
||||
if (this.participantService.haveICameraAndScreenActive()) {
|
||||
this.publishVideoAux(this.participantService.getMyCameraPublisher(), mute);
|
||||
this.publishVideoAux(this.participantService.getMyCameraPublisher(), publish);
|
||||
this.participantService.disableWebcamStream();
|
||||
this.unpublish(this.participantService.getMyCameraPublisher());
|
||||
this.publishAudioAux(this.participantService.getMyScreenPublisher(), publishAudio);
|
||||
|
@ -245,7 +245,7 @@ export class OpenViduService {
|
|||
this.participantService.enableWebcamStream();
|
||||
} else {
|
||||
// Muting/unmuting webcam
|
||||
this.publishVideoAux(this.participantService.getMyCameraPublisher(), mute);
|
||||
this.publishVideoAux(this.participantService.getMyCameraPublisher(), publish);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -259,15 +259,15 @@ export class OpenViduService {
|
|||
}
|
||||
}
|
||||
|
||||
async muteAudio(value: boolean): Promise<void> {
|
||||
async publishAudio(publish: boolean): Promise<void> {
|
||||
if (this.participantService.isMyCameraActive()) {
|
||||
if (this.participantService.isMyScreenActive() && this.participantService.hasScreenAudioActive()) {
|
||||
this.publishAudioAux(this.participantService.getMyScreenPublisher(), false);
|
||||
}
|
||||
|
||||
this.publishAudioAux(this.participantService.getMyCameraPublisher(), value);
|
||||
this.publishAudioAux(this.participantService.getMyCameraPublisher(), publish);
|
||||
} else {
|
||||
this.publishAudioAux(this.participantService.getMyScreenPublisher(), value);
|
||||
this.publishAudioAux(this.participantService.getMyScreenPublisher(), publish);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue