import { Observable } from 'rxjs'; import { Call } from '../Call'; import { TrackPublishOptions } from '../rtc'; import { DeviceManagerState } from './DeviceManagerState'; import { ScopedLogger } from '../logger'; import { TrackType } from '../gen/video/sfu/models/models'; import { MediaStreamFilter, MediaStreamFilterRegistrationResult } from './filters'; import { DevicePersistenceOptions } from './devicePersistence'; export declare abstract class DeviceManager, C = MediaTrackConstraints> { /** * if true, stops the media stream when call is left */ stopOnLeave: boolean; logger: ScopedLogger; state: S; protected readonly call: Call; protected readonly trackType: TrackType; protected subscriptions: (() => void)[]; protected devicePersistence: Required; protected areSubscriptionsSetUp: boolean; private isTrackStoppedDueToTrackEnd; private filters; private statusChangeConcurrencyTag; private filterRegistrationConcurrencyTag; protected constructor(call: Call, state: S, trackType: TrackType, devicePersistence: Required); setup(): void; /** * Lists the available audio/video devices * * Note: It prompts the user for a permission to use devices (if not already granted) * * @returns an Observable that will be updated if a device is connected or disconnected */ listDevices(): Observable; /** * Returns `true` when this device is in enabled state. */ get enabled(): boolean; /** * Starts stream. */ enable(): Promise; /** * Stops or pauses the stream based on state.disableMode */ disable(options: { forceStop?: boolean; }): Promise; disable(forceStop?: boolean): Promise; /** * Returns a promise that resolves when all pe */ statusChangeSettled(): Promise; /** * If status was previously enabled, it will re-enable the device. */ resume(): Promise; /** * If the current device status is disabled, it will enable the device, * else it will disable it. */ toggle(): Promise; /** * Registers a filter that will be applied to the stream. * * The registered filter will get the existing stream, and it should return * a new stream with the applied filter. * * @param filter the filter to register. * @returns MediaStreamFilterRegistrationResult */ registerFilter(filter: MediaStreamFilter): MediaStreamFilterRegistrationResult; /** * Will set the default constraints for the device. * * @param constraints the constraints to set. */ setDefaultConstraints(constraints: C): void; /** * Selects a device. * * Note: This method is not supported in React Native * @param deviceId the device id to select. */ select(deviceId: string | undefined): Promise; /** * Disposes the manager. * * @internal */ dispose: () => void; protected applySettingsToStream(): Promise; protected abstract getDevices(): Observable; protected abstract getStream(constraints: C): Promise; protected publishStream(stream: MediaStream, options?: TrackPublishOptions): Promise; protected stopPublishStream(): Promise; protected getTracks(): MediaStreamTrack[]; protected muteStream(stopTracks?: boolean): Promise; private disableTracks; private enableTracks; private stopTracks; private muteLocalStream; protected unmuteStream(): Promise; private get mediaDeviceKind(); private handleDisconnectedOrReplacedDevices; protected findDevice(devices: MediaDeviceInfo[], deviceId: string): MediaDeviceInfo | undefined; private dispatchDeviceDisconnectedEvent; private persistPreference; protected applyPersistedPreferences(enabledInCallType: boolean): Promise; private applyMutedState; }