/** @module Webinar */ import { Subject } from 'rxjs'; import type { WebinarServiceRB } from "../../services/webinars/webinars.service"; import { Webinar, WebinarMediaType, WebinarSessionParticipant } from "../../models"; import { WebinarAudioMixer } from './webinarAudioMixer'; export type WebinarConstraintResolution = 'high' | 'medium' | 'low' | 'min'; export interface IWebinarConferenceService { joinWebinar(webinar: Webinar): Promise; leaveWebinar(webinar: Webinar): Promise; addAudioVideoMedia(webinar: Webinar, mediaType: string, stream?: MediaStream, replaceBackground?: boolean): Promise; addSharingMedia(webinar: Webinar, stream: MediaStream): Promise; removeLocalMedia(webinar: Webinar, mediaType: string): Promise; muteParticipant(webinar: Webinar, participant: WebinarSessionParticipant, mute: boolean): Promise; putOnStage(webinar: Webinar, participantId: string, media: WebinarMediaType, onStage: boolean, master?: boolean, fullStream?: boolean): Promise; shareAudioConfig(webinar: Webinar, audioConfig: string): Promise; startWebinar(webinar: Webinar): Promise; allowAttendeeToTalk(webinar: Webinar, userId: string): Promise; disableAttendeeToTalk(webinar: Webinar, userId: string): Promise; askForStaging(webinar: Webinar, participant: WebinarSessionParticipant, media: string): Promise; declineStagingInvitation(webinar: Webinar, participant: WebinarSessionParticipant, media: string): Promise; lowerHand(webinar: Webinar, userId: string): Promise; raiseHand(webinar: Webinar, userId: string): Promise; isActiveWebinar(webinar: Webinar): boolean; hasActiveWebinarSession(): boolean; disableIncomingStreams(webinar: Webinar, media: 'video' | 'sharing', disabled: boolean): Webinar; pauseVideoStream(webinar: Webinar, participant: WebinarSessionParticipant, media: 'video' | 'sharing', paused: boolean, origin: string): Promise; waitForGuestXmppReconnection(): Promise; } /** * This service manages webinar conferences in Rainbow. */ export declare class WebinarConferenceService implements IWebinarConferenceService { private webinarService; startConferencePromiseResolvers: any; activeWebinar: Webinar | null; activeWebinarSubject: Subject; audioMixer: WebinarAudioMixer; private connected; private reconnectingSessionIds; private mainService; private authService; private logger; private xmppService; private contactService; private userService; private errorHelperService; private speechEnhancementService; private eventService; private webrtcConfigAndUtils; private speechRecognitionService; private utilitiesService; private deviceManagementService; private settingsService; private presenceHelperService; private profileService; private bubbleService; private webinarTelemetryService; private virtualBackgroundService?; private groupChatListener; private conferenceListener; private xmppJingleListener; private xmppServiceSubscription; private videoServiceSubscription; private xmppConnectionSubscription; private replaceBackgroundSubscription; private deviceManagementSubscription; private webinarExtendedBackstage; private xmppStagingListener; isInteractEventSent: boolean; private subscribeToPublisherPromiseResolvers; private subscribeToPublisherTimeouts; private audioMixerSession?; private statsIntervals; private promiseQueue; private connectedUser; /** * WebinarConferenceService static factory * @param webinarService - the webinarService parent */ static create(webinarService: WebinarServiceRB): WebinarConferenceService; /** * Private constructor method * @param webinarService - the webinarService parent */ private constructor(); /** * Reconnection method, should be call when webinarService is reconnected */ reconnect(): Promise; private updateWebinarsFromServer; /** * Attach all listener to different service, should be called by the webinarService attachListener method */ attachAllListeners(): void; detachAllListeners(): void; private attachXmppListeners; /** * Allow to join a webinarSession (entering the conference and established the webrtc connection) * @param webinar - the webinar to join */ joinWebinar(webinar: Webinar): Promise; /** * Allow to leave a webinar * - remove the user from the stage (if it was on the stage) * - remove the user from the conference (stop the session if last user) * @param webinar - the webinar to leave * @param forced - when set to true this method stop the session (even if not the last user connect in conf) * @param nowait - when set to true this method call async child methods without waiting the end of execution (used in last chance deconnection event mechanism (onunload event)) * @returns A promise that is resolved when the user has join the conference */ leaveWebinar(webinar: Webinar, forced?: boolean, nowait?: boolean, reason?: string): Promise; /** * Allow to remove the "active" webinar * @param webinar - the webinar to remove as active */ removeActiveWebinar(webinar: Webinar): void; addAudioVideoMedia(webinar: Webinar, media: string, originalStream?: MediaStream, replaceBg?: boolean): Promise; getSharingMedia(webinar: Webinar, shouldGetAudioForSharing?: boolean): Promise; addSharingMedia(webinar: Webinar, stream: MediaStream): Promise; removeLocalMedia(webinar: Webinar, media: string): Promise; muteParticipant(webinar: Webinar, participant: WebinarSessionParticipant, mute?: boolean): Promise; muteParticipantInternal(webinar: Webinar, participant: WebinarSessionParticipant, channel: 'MCU' | 'SFU', mute?: boolean, askIgnore?: boolean): Promise; declineUnmuteInvitation(webinar: Webinar, fromParticpant: WebinarSessionParticipant): void; putOnStage(webinar: Webinar, participantId: string, type: WebinarMediaType, onStage: boolean, master?: boolean, fullStream?: boolean): Promise; shareAudioConfig(webinar: Webinar, audioConfig: string): Promise; startWebinar(webinar: Webinar): Promise; stopWebinar(webinar: Webinar): Promise; raiseHand(webinar: Webinar, userId: string): Promise; lowerHand(webinar: Webinar, userId: string): Promise; allowAttendeeToTalk(webinar: Webinar, userId: string): Promise; disableAttendeeToTalk(webinar: Webinar, userId: string): Promise; activateWebinarSound(webinar: Webinar): Promise; askForStaging(webinar: Webinar, participant: WebinarSessionParticipant, media: string): Promise; declineStagingInvitation(webinar: Webinar, participant: WebinarSessionParticipant, media: string): Promise; hasActiveWebinarSession(): boolean; isActiveWebinar(webinar: Webinar): boolean; removeAudioVideoMedia(webinar: Webinar, audioVideoOnly?: boolean): Promise; removeSharingMedia(webinar: Webinar): void; enableSubtitles(webinar: Webinar, enable: boolean): void; applyVideoConstraints(webinar: Webinar, streamType: 'audioVideo' | 'sharing', resolution: WebinarConstraintResolution, frameRate: number, maxBitrate: number): Promise; private resendStageEvents; private isParticipantAnActor; private computeScaleFactor; disableIncomingStreams(webinar: Webinar, media: 'video' | 'sharing', disabled: boolean): Webinar; pauseVideoStream(webinar: Webinar, participant: WebinarSessionParticipant, media: 'video' | 'sharing', paused: boolean, origin: string): Promise; waitForGuestXmppReconnection(): Promise; private startConference; /** * Joins an existing webinar conference session. * * This method handles the process of joining a webinar conference by: * - Sending a POST request to the conference join endpoint * - Processing stage information for attendees * - Handling switch device scenarios when user is already connected * * @param webinar - The webinar instance to join * @returns A promise that resolves when the user has successfully joined the conference * @throws Error with message 'alreadyConnected' if the user is already connected from another device * @throws Error from errorHelperService if the join request fails */ private joinConference; private manageCodecs; private stopSession; private disconnectParticipant; private onGroupchatMessage; private ackAllMessages; private onXmppJingleMessage; private onAskStagingMessage; private onConferenceMessage; private handleRemoteParticipantAudioConfig; private handleRemoteParticipantAudioConfigMCU; private handleRecording; private handleStage; private updateStage; private getWebinarSnapshot; subscribeToPublisher(webinar: Webinar, participant: WebinarSessionParticipant, media: string, force?: boolean, retry?: boolean): Promise; private subscribeToPublisherInternal; unsubscribeToPublisher(webinar: Webinar, participant: WebinarSessionParticipant, media: string, disableStream?: boolean): Promise; private createSessionParticipantFromElem; private createSessionParticipantFromAttendeeJid; private onVideoServiceEvent; private onSessionMessage; private onSessionStateChange; private scheduleSubscribeToPublisher; private scheduleTransportReplace; private sendTransportReplaceForSession; private terminateSession; private onSessionInitiate; private onSessionTerminated; private onJingleContentAdd; private onJingleContentModify; private onJingleMediaModified; private onJingleContentRemove; private setBusyState; private onJingleStatsChange; private onJingleCheckSubscriptionStatus; private onJingleResubscriptionNeededEvent; private onJingleErrorEvent; private onSessionMessageDefaultHandler; private onXmppConnectionChangeEvent; private onReplaceBackgroundChangeEvent; private onMediaDeviceChangeEvent; private startStatsForSession; private stopStatsForSession; private stopStatsForAllSessions; private addSubscribeToPublisherTimeout; private clearSubscribeToPublisherTimeout; private clearSubscribeToPublisherTimeouts; private resubscribe; private clearWebinar; private clearSession; } //# sourceMappingURL=webinarConference.service.d.ts.map