import { Subscription } from "rxjs"; import { CallRB } from "../../models/call.model"; import { Service } from "../../services/service"; export declare const WEBRTC_CONFIG_UTILS_SVC = "WebrtcConfigAndUtils"; export interface IWebrtcConfigAndUtils { RTC: any; } /** * This module contains all the webrtc configuration tools and utils that can be used to manages webrtc audio/video calls * This module can be used to set the video quality and frame rate for all P2P calls * The lifecycle of this module is managed by the WebRTC P2P Service */ export declare class WebrtcConfigAndUtils extends Service implements IWebrtcConfigAndUtils { /** * The current webrtc configuration used (TURN servers and DC) */ webrtcConfig: any; /** * The current webrtc company configuration (if set for the company) */ companyConfig: any; /** * The current webrtc video and sharing quality configuration when in call with mobile phone */ mobileVideoQualityConfiguration: { video: { fixedFrameRate: number; fixedVideoWidth: number; fixedVideoHeight: number; }; sharing: { fixedFrameRate: number; fixedVideoWidth: number; fixedVideoHeight: number; }; }; /** * The current webrtc video and sharing quality configuration */ videoQualityConfiguration: { video: { fixedFrameRate: number; fixedVideoWidth: number; fixedVideoHeight: number; }; sharing: { fixedFrameRate: number; fixedVideoWidth: number; fixedVideoHeight: number; }; }; /** * The RTC object that contains the attach and detach functions to add stream to DOM element based on the platform * The attachSessionMediaToElement is used for session that have only 1 media (for conferences case); We need to send the HTML element ID + the session that we want to "attach" to that element */ RTC: any; /** * Subscribe to updates on the current calls sessions (all events are of RBEvent type `{ name: string, data:any }`); * All public events that are fired by this service are described in the documentation. * NB There might be some events that are not documented here, they should be ignored * @param handler - The call-back function that will be subscribed to the RxJS subject */ subscribe(handler: any): Subscription; /** * Send an event to the RX Subject (sends always a RBEvent type) * @param string - name The name of the event * @param data - The data of the event */ private sendEvent; /** * The Calls Stats object that contains all the statistics for the current call (that will be uploaded to the server at the end of the call) */ callsStats: {}; askToAddSharing(__conversationId: string, __shouldAskForAudio?: boolean): boolean; private logger; private settingsService; private authService; private xmppService; private mainService; private contactService; private eventService; private deviceManagementService; private profileService; private rxSubject; private webrtcSessionStatsHandler; private jingleSubscription; private localPeerConnection; private ttl; private ttlTimeout; private started; private statsWaitingQueue; static getInstance(): WebrtcConfigAndUtils; static build(): WebrtcConfigAndUtils; private constructor(); start(): Promise; stop(): void; private onConnectionStateChangeEvent; private onJingleMessage; private makeLocalEchoTest; /** * This method builds the local peer connection */ private buildLocalPeerConnection; private destroyLocalPeerConnection; getBrowserMethodHandler(): any; private jingleTurnCredentialExpire; setBrowserMethodHandler(): any; getDesktopSharingSource(): any; private getConstraintsForMedia; getBrowserMedia(userMedia: any[], fixedVideoWidth?: number, fixedVideoHeight?: number, fixedFrameRate?: number, referer?: any, getAudioForSharing?: boolean, isMediaPillarCall?: boolean): Promise; /** * Disables and removes all local streams for this session * @param session - The session (or any object that contains localStreams that will be removed) */ disableAllStreamsForSession(session: any): void; /** * Disables MediaStream * @param streams - An array of MediaStream to be stopped and removed */ disableMediaStreams(streams: MediaStream[]): void; /** * Disables MediaStream * @param stream - The MediaStream to be stopped and removed */ disableMediaStream(stream: MediaStream): void; getMobileMediaConstraints(type: string): any; createOrUpdateStatisticsForCall(call: CallRB): Promise; updateStatisticsForCall(id: string, callId: string, callState: string, metrics: any): Promise; createStatisticsForSession(callId: string, peerId: string, callState: string): Promise; setWebrtcConfiguration(): Promise; /** * Get the Media stream from the browser w/o any constraints (except for the selected current device); * @param userMedia - An array of medias to get (accepted values inside the array are : "audio" and "video"); */ getBrowserMediaWithNoConstraints(userMedia: string[]): Promise; private getDefaultConstraintsForMedia; private setIceConfig; private manageIceServers; private getIceConfig; private setCompanyWebrtcConfig; private setVideoQualityConfigurationForCompany; private getCompanyWebrtcConfig; getStatsForSession(session: any, interval?: number, webinarId?: string): any; /** * For QA Tests Auto * Set/reset an interval for generating WebRTC statistics that will be used instead of the default 5s interval. * Set by default to 1000ms. * Usage: rainbow.services.WebrtcConfigAndUtils.setWebrtcStatsInterval(intervalMs); */ setWebrtcStatsInterval(interval?: number): void; resetWebrtcStatsInterval(): void; } //# sourceMappingURL=webrtcConfigAndUtils.d.ts.map