FEAT: now play a sound when a user quit the webrtc group

This commit is contained in:
kharhamel 2020-12-11 15:35:13 +01:00
parent e2c81c4eb1
commit a1aedaa594
4 changed files with 11 additions and 3 deletions

View file

@ -38,6 +38,7 @@ export class MediaManager {
microphoneClose: HTMLImageElement;
microphone: HTMLImageElement;
webrtcInAudio: HTMLAudioElement;
private webrtcOutAudio: HTMLAudioElement;
constraintsMedia : MediaStreamConstraints = {
audio: true,
video: videoConstraint
@ -57,8 +58,6 @@ export class MediaManager {
private discussionManager: DiscussionManager;
private userInputManager?: UserInputManager;
private hasCamera = true;
private triggerCloseJistiFrame : Map<String, Function> = new Map<String, Function>();
@ -67,7 +66,9 @@ export class MediaManager {
this.myCamVideo = HtmlUtils.getElementByIdOrFail<HTMLVideoElement>('myCamVideo');
this.webrtcInAudio = HtmlUtils.getElementByIdOrFail<HTMLAudioElement>('audio-webrtc-in');
this.webrtcOutAudio = HtmlUtils.getElementByIdOrFail<HTMLAudioElement>('audio-webrtc-out');
this.webrtcInAudio.volume = 0.2;
this.webrtcOutAudio.volume = 0.2;
this.microphoneBtn = HtmlUtils.getElementByIdOrFail<HTMLDivElement>('btn-micro');
this.microphoneClose = HtmlUtils.getElementByIdOrFail<HTMLImageElement>('microphone-close');
@ -566,6 +567,10 @@ export class MediaManager {
removeActiveScreenSharingVideo(userId: string) {
this.removeActiveVideo(`screen-sharing-${userId}`)
}
playWebrtcOutSound(): void {
this.webrtcOutAudio.play();
}
isConnecting(userId: string): void {
const connectingSpinnerDiv = this.getSpinner(userId);