import { AgoraRteRenderView } from '../../imports'; import { AgoraRtcChannelClient } from './channel'; import { AgoraRtcChannelType, AgoraRtcDeviceInfo, AgoraRtcLatencyLevelType, AgoraRtcClientObserver, AgoraRtcRenderMode, AgoraRtcCapability, AgoraRtcAudioOutputRouting, AgoraRtcScreenCaptureType } from './type'; import { AgoraRtcSourceManager } from './source-manager'; import { AgoraRtcCaptureEnhancement } from './capture-enhancement'; import { AgoraRtcCanvasHelper } from './canvas'; import { AgoraRtcAccessPointConfig } from '../engine/ap-detector'; import type { AgoraRteClientRecordingManager } from '../media/type'; /** * Abstract class that defines the interface for an Agora RTC client. This class provides methods for managing cameras, microphones, speakers, and screen capture, as well as creating and managing Agora RTC channels. */ export declare abstract class AgoraRtcClient { /** * Gets the version of the Agora RTM SDK. */ abstract get version(): string; abstract sourceManager: AgoraRtcSourceManager; abstract captureEnhancement: AgoraRtcCaptureEnhancement; abstract canvasHelper: AgoraRtcCanvasHelper; /** * Creates an Agora RTC channel client. * @param channelId The ID of the channel to join. * @param localUserId The local user ID. * @param latencyLevel The latency level to use for the channel. * @param channelType The channel type. Standard for normal communication, LargeScale for large-scale broadcast. */ abstract createChannelClient(channelId: string, localUserId: string, latencyLevel: AgoraRtcLatencyLevelType, channelType?: AgoraRtcChannelType): AgoraRtcChannelClient; /** * Sets the client parameters. * @param parameters The parameters to set. */ abstract setParameters(parameters: string): void; /** * Sets the local access point * @param config The access point configuration. */ abstract setAccessPointConfig(config: AgoraRtcAccessPointConfig): void; /** * Checks if a specific capability is supported. * @param capability The capability to check. */ abstract isCapabilitySupported(capability: AgoraRtcCapability): boolean; /** * Observe the system selected speaker * @param enable */ abstract observeSystemSelectedSpeakerChanged(enable: boolean): number; /** * queryDeviceScore * @returns device score */ abstract queryDeviceScore(): number; /** * Observe the system selected microphone * @param enable */ /** * Adds an observer for Agora RTC client events. * @param observer The observer to add. */ addObserver(observer: AgoraRtcClientObserver): void; /** * Removes an observer for Agora RTC client events. * @param observer The observer to remove. */ removeObserver(observer: AgoraRtcClientObserver): void; /** * Starts rendering the camera preview. * @param deviceId The ID of the video source. * @param view The view to render camera video on. * @param renderMode The render mode. * @param isMirror Whether to mirror the video. */ abstract startRenderCameraPreview(deviceId: string, view: AgoraRteRenderView, renderMode: AgoraRtcRenderMode, isMirror: boolean): number; /** * Stops rendering the camera preview. * @param view The view the camera video plays on. * @param deviceId The ID of the camera device. */ abstract stopRenderCameraPreview(deviceId: string, view: AgoraRteRenderView): number; /** * Starts rendering the camera preview on all canvases. * @param deviceId The ID of the video source. */ abstract stopRenderCameraPreviewOnAllCanvas(deviceId: string): number; /** * Starts rendering the screen preview. * @param sourceId The ID of the video source. * @param view The view to render camera video on. * @param type The type of the screen capture. * @param renderMode The render mode. * @param isMirror Whether to mirror the video. */ abstract startRenderScreenPreview(sourceId: string, view: AgoraRteRenderView, type: AgoraRtcScreenCaptureType, renderMode: AgoraRtcRenderMode, isMirror: boolean): number; /** * Stops rendering the screen preview. * @param view The view the camer video plays on. * @param sourceId The ID of the video source. */ abstract stopRenderScreenPreview(sourceId: string, view: AgoraRteRenderView, type: AgoraRtcScreenCaptureType): number; /** * Starts rendering the screen preview on all canvases. * @param sourceId The ID of the video source. * @param type The type of the screen capture. */ abstract stopRenderScreenPreviewOnAllCanvas(sourceId: string, type: AgoraRtcScreenCaptureType): number; /** * Retrieves a list of available speakers. */ abstract getSpeakerList(): Promise; /** * Retrieves the system selected speaker. */ abstract getSystemSelectedSpeaker(): Promise; /** * Retrieves the selected speaker. */ abstract getSelectedSpeaker(): AgoraRtcDeviceInfo; /** * Sets the selected speaker. * @param deviceId The ID of the speaker device to use. */ abstract setSelectedSpeaker(deviceId: string): number; /** * mobile only * Enables the speaker. * @param enable */ abstract setEnableSpeaker(enable: boolean): number; /** * Retrieves the audio output routing. * mobile only * @returns The audio output routing. */ abstract getAudioOutputRouting(): AgoraRtcAudioOutputRouting; /** * Retrieves the output volume. * @returns The output volume. * Return value 0-400, which can be adjusted by adjustOutputVolume */ abstract getOutputVolume(): number; /** * Updates the playback audio volume. * @param volume The new volume level. */ abstract adjustOutputVolume(volume: number): number; /** * Starts playing test audio from a specific URL. * @param url The URL of the audio to play. */ abstract startPlayTestAudio(url: string): number; /** * Stops playing the test audio. */ abstract stopPlayTestAudio(): number; /** * Sets the SDK selected speaker volume. * @param volume The volume level to set.The value ranges between 0 and 255. * @deprecated */ abstract setSelectedSpeakerVolume(volume: number): number; /** * Gets the SDK selected speaker volume. * @deprecated */ abstract getSelectedSpeakerVolume(): number; /** * The system selected speaker changed callback * @param speaker The speaker device info. */ protected onSystemSelectedSpeakerChanged(speaker: AgoraRtcDeviceInfo): void; /** * The speaker list added callback * @param deviceInfoList The speaker device info list. */ protected onSpeakerListAdded(deviceInfoList: AgoraRtcDeviceInfo[]): void; /** * The speaker list removed callback * @param deviceInfoList The speaker device info list. */ protected onSpeakerListRemoved(deviceInfoList: AgoraRtcDeviceInfo[]): void; /** * The output volume indication updated callback * @param volume The output volume. */ protected onOutputVolumeIndicationUpdated(volume: number): void; /** * The auto play failed callback */ protected onAutoPlayFailed(): void; /** * Only for mobile * The audio output routing updated callback * @param routing The audio output routing. */ protected onAudioOutputRoutingUpdated(routing: AgoraRtcAudioOutputRouting): void; /** * The connection aborted callback */ protected onConnectionAborted(): void; /** * Switches between audio output to speaker or earpiece. * @param enable Whether to enable audio output to speaker. */ /** * Sets the speaker device. * @param deviceId The ID of the speaker device to use. */ /** * Enables or disables dual stream mode. * @param enable Whether to enable dual stream mode. */ /** * Releases the client resources. */ abstract release(): 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; }