import { EventEmitter } from '@angular/core'; import { EmitterThen } from './EmitterThen'; import { ConsoleService } from '../../services/console.service'; import { MicrophonePermissionWatcher } from "./MicrophonePermissionWatcher"; import { CameraPermissionWatcher } from "./CameraPermissionWatcher"; export interface BackgroundImageOptions { useBackgroundImage: boolean; imageMode: 'default' | 'custom'; customImageUrl?: string; fitMode: 'cover' | 'contain' | 'stretch'; blurAmount: number; } export interface GetUserMediaData { forceRecreate?: boolean; useBlur?: boolean; useGPU?: boolean; blurEngine?: string; blurAmount?: number; softEdge?: boolean; backgroundImage?: string; useEchoCancellation?: boolean; noiseSuppression?: boolean; autoGainControl?: boolean; backgroundOptions?: BackgroundImageOptions; } export interface SelectedDeviceData { audio: string | null; video: string | null; speaker: string | null; } export interface DevicesData { audios: Array; videos: Array; speaker: Array; } export interface DeviceOption { txt: string; id: string; } export interface MultiScaleMediaStream { big: MediaStream; small: MediaStream; audio: MediaStream; bigIsMock?: boolean; smallIsMock?: boolean; audioIsMock?: boolean; } export declare class VideoWebStream { consoleSrv: ConsoleService; static TUMBNAIL_HEIGHT: number; streams: MultiScaleMediaStream | null; analyser: AnalyserNode | null; audioContext: AudioContext | null; dataArray: Uint8Array | null; microphone: MediaStreamAudioSourceNode | null; volumeMeterTimer: NodeJS.Timeout | null; currentDevices: SelectedDeviceData; devices: DevicesData; emitterDevices: EmitterThen; emitterStreams: EventEmitter; volumeEmitter: EventEmitter; lastUpdatedVideoDevice: string | null; lastUpdatedAudioDevice: string | null; static hooks: { [key: string]: Function; }; static lastDevices: DevicesData | null; micWatcher: MicrophonePermissionWatcher; camWatcher: CameraPermissionWatcher; lastPermissionVideoState: string | null; lastPermissionAudioState: string | null; static registerHook(name: string, fun: Function): void; constructor(consoleSrv: ConsoleService); startAudioContext(): Promise; hasMicrophonePermission(): Promise<"granted" | "denied" | "prompt">; getAnalyser(): boolean; updateVolumeMeter(audio?: MediaStream): void; autoReloadDevices(): EmitterThen; askAgainGetDevices(): Promise; getDevices(): Promise; sleep(millis: number): Promise; waitUntilActive(stream: MediaStream): Promise; stopStream(): void; getUserMedia(payload?: GetUserMediaData): Promise; clearStream(): void; logCurrentDevices(): void; useSpeakerDevice(outputDevice: string): void; useAudioDevice(audioDevice: string): void; useVideoDevice(videoDevice: string): void; updateSelectedDevice(streams: MultiScaleMediaStream | null): void; storeCustomSelectedDevices(): void; searchSpeakerDevice(devices: DevicesData, query: string | null, type?: string): DeviceOption | null; searchMicrophoneDevice(devices: DevicesData, query: string | null, type?: string): DeviceOption | null; searchVideoDevice(devices: DevicesData, query: string | null, type?: string): DeviceOption | null; autoFixSelectedSpeaker(): void; static isMobile(): boolean; /** * Select cold cookie selected value, or first if exist at least 1 * @param devices */ autoSelectMicrophoneAndVideoDevice(devices: DevicesData): void; handleError(error: any): void; setVideoEnabled(videoState: boolean): any; }