import { AgoraRtcCameraPosition, AgoraRtcDeviceInfo, AgoraRtcDisplayInfo, AgoraRtcWindowInfo, AgoraRtcScreenCaptureParams, AgoraRtcVideoOrientation, AgoraRtcCameraCaptureParams, AgoraRtcMediaSourceState, AgoraRtcSourceManagerObserver, AgoraRtcScreenCaptureType, AgoraRtcMediaSourceIndex } from './type'; import { AgoraRteClientRecordingManager } from '../media/type'; export interface AgoraRtcSourceManager { readonly keepRecording: boolean; addObserver(observer: AgoraRtcSourceManagerObserver): void; removeObserver(observer: AgoraRtcSourceManagerObserver): void; startRecordingDeviceCapture(): number; stopRecordingDeviceCapture(): number; getCameraSourceIndex(deviceId: string): AgoraRtcMediaSourceIndex; getLoopbackList(): AgoraRtcDeviceInfo[]; /** * Retrieves a list of available cameras. */ getCameraList(): Promise; /** * Retrieves a list of available microphones. */ getMicrophoneList(): Promise; /** * Retrieves a list of shareable windows. */ getWindowList(): Promise; /** * Retrieves a list of shareable displays. */ getDisplayList(): Promise; /** * Retrieves the system selected microphone. */ getSystemSelectedMicrophone(): Promise; /** * For mobile only. * Retrieves the position of the camera. */ getCameraPosition(): AgoraRtcCameraPosition; /** * For mobile only. * Retrieves the camera state. * @param deviceId The ID of the camera to get the state for. */ getCameraState(deviceId: string): AgoraRtcMediaSourceState; /** * For mobile only. * Retrieves the microphone state. * @param deviceId The ID of the microphone to get the state for. */ getMicrophoneState(deviceId: string): AgoraRtcMediaSourceState; /** * For mobile only. * Retrieves the screen capture state. * @param sourceId The ID of the screen capture to get the state for. */ getScreenCaptureState(sourceId: string, type?: AgoraRtcScreenCaptureType): AgoraRtcMediaSourceState; /** * Set the video orientation for the specified camera. * @param orientation The video orientation to set. */ setCameraVideoOrientation(deviceId: string, orientation: AgoraRtcVideoOrientation): number; /** * Sets the camera capture parameters for the specified device. * @param deviceId The ID of the device to set the camera capture parameters for. * @param params The camera capture parameters to set. */ setCameraCaptureParams(deviceId: string, params: AgoraRtcCameraCaptureParams): number; /** * Opens a specified camera. * @param deviceId The ID of the camera to open. */ openCamera(deviceId: string): number; /** * Closes a specified camera. * @param deviceId The ID of the camera to close. */ closeCamera(deviceId: string): number; /** * Switches between front and rear cameras. */ switchCamera(): number; /** * Starts testing a specified camera. * @param deviceId The ID of the camera to test. */ startCameraTest(deviceId: string): number; /** * Stops testing a specified camera. * @param deviceId The ID of the camera to stop testing. */ stopCameraTest(deviceId: string): number; /** * Opens a specified microphone. * @param deviceId The ID of the microphone to open. */ openMicrophone(deviceId: string): number; /** * Closes a specified microphone. * @param deviceId The ID of the microphone to close. */ closeMicrophone(deviceId: string): number; /** * Starts testing a specified microphone. * @param deviceId The ID of the microphone to test. * @param interval The interval at which to report volume changes. */ startMicrophoneTest(deviceId: string, interval?: number): number; /** * Stops testing a specified microphone. */ stopMicrophoneTest(deviceId: string): number; /** * Starts screen capture by display ID with parameters. * @param displayId The ID of the display to start screen capture for. * @param params The screen capture parameters. * @param excludeWindowList The list of window IDs to exclude from the screen capture. */ startScreenCaptureByDisplayIdWithParams(displayId: string, params: AgoraRtcScreenCaptureParams, excludeWindowList: string[]): number; /** * Starts screen capture by display ID. * @param displayId The ID of the display to start screen capture for. * @param excludeWindowList The list of window IDs to exclude from the screen capture. */ startScreenCaptureByDisplayId(displayId: string, excludeWindowList: string[]): number; /** * Starts screen capture by window ID with parameters. * @param windowId The ID of the window to start screen capture for. * @param params The screen capture parameters. */ startScreenCaptureByWindowIdWithParams(windowId: string, params: AgoraRtcScreenCaptureParams): number; /** * Starts screen capture by window ID. * @param windowId The ID of the window to start screen capture for. * @param enableHighLight Whether to enable highlight border (default: true). Set to false for client recording. */ startScreenCaptureByWindowId(windowId: string, enableHighLight: boolean): number; /** * For mobile only. * Starts screen capture by screen ID. * @param sourceId The ID of the screen to start screen capture for. * @param params The screen capture parameters. */ startScreenCapture(sourceId: string, params: AgoraRtcScreenCaptureParams): number; /** * For mobile only. * Updates the screen capture. * @param sourceId The ID of the screen capture to update. * @param params The screen capture parameters. */ /** * For mobile only. * Stops screen capture. * @param sourceId The ID of the screen capture to stop. */ /** * For PC only. * Stops screen capture. * @param sourceId The ID of the screen capture to stop. * @param type The type of the screen capture. * @param forceCleanState If true, forcefully reset the internal source state after stopping, * without notifying upper layers. Used by client recording to ensure * stale enabled state doesn't block subsequent capture starts. */ stopScreenCapture(sourceId: string, type: AgoraRtcScreenCaptureType, forceCleanState?: boolean): number; /** * Returns a promise that resolves when the SDK's onLocalVideoStateChanged callback * fires with state=Stopped for VideoSourceScreenPrimary. * Used to wait for the SDK to fully process a screen capture stop before starting a new one. */ waitForScreenCaptureStopped(): Promise; /** * Protect a source ID from being closed by onLocalVideoStateChanged callbacks. * Used when recording starts its own window capture while screen share is stopping. */ protectSourceId(sourceId: string): void; /** * Remove protection from a source ID. */ unprotectSourceId(sourceId: string): void; /** * For PC only. * Updates the screen capture exclude window list by display id. * @param displayId the display id to update exclude window list for. * @param excludeWindowList The list of window IDs to exclude from the screen capture. * @returns number * 0: success * < 0: failure */ updateExcludeWindowsByDisplayId(displayId: string, excludeWindowList: string[]): number; /** * Starts loopback recording for a specific device. * @param deviceId The ID of the device to start loopback recording for. */ startLoopbackRecording(deviceId: string): number; /** * Gets the loopback recording state for a specific device. * @param deviceId The ID of the device to get the loopback recording state for. */ getLoopbackRecordingState(deviceId: string): AgoraRtcMediaSourceState; /** * Stops loopback recording for a specific device. * @param deviceId The ID of the device to stop loopback recording for. */ stopLoopbackRecording(deviceId: string): number; /** * Updates the loopback audio volume. * @param deviceId The ID of the loopback device to use. * @param volume The new volume level. */ adjustLoopbackVolume(deviceId: string, volume: number): number; /** * Updates the microphone audio volume. * @param deviceId The ID of the microphone device to use. * @param volume The new volume level. */ adjustMicrophoneVolume(deviceId: string, volume: number): number; /** * Releases the resources used by the source manager. */ release(): void; /** * Keep recording device * @param keepRecording Whether to keep the device recording */ setKeepAudioRecording(keepRecording: boolean): void; /** * observe the system selected microphone change * @param enable */ observeSystemSelectedMicrophoneChanged(enable: boolean): number; setLoopbackInstalled(installed: boolean): void; /** * Gets the media recorder manager for client-side recording. * Only available on Electron platform. * @returns The media recorder manager, or undefined if not supported. */ getMediaRecorderManager(): AgoraRteClientRecordingManager | undefined; }