import { AgoraObservable, AgoraRteRenderView } from '../../imports'; import { AgoraRtcVideoSnapshot, AgoraRtcEncryptionConfig, AgoraRtcChannelClientObserver, AgoraRtcVideoEncoderConfiguration, AgoraRtcRenderMode, AgoraRtcStreamLayer } from './type'; import { AgoraRtcCanvasHelper } from './canvas'; import { AgoraRtcChannelPublisher } from './publisher'; import { AgoraRtcChannelSubscriber } from './subscriber'; import { AgoraRtcScreenScenarioType } from './type'; /** * Abstract class that defines the interface for a client that can join and leave an Agora RTC channel, publish and unpublish local audio and video streams, and subscribe and unsubscribe to remote audio and video streams. This class also provides methods for rendering remote video streams on a canvas and taking snapshots of remote video streams. */ export declare abstract class AgoraRtcChannelClient { protected observable: AgoraObservable; abstract publisher: AgoraRtcChannelPublisher; abstract subscriber: AgoraRtcChannelSubscriber; abstract canvasHelper: AgoraRtcCanvasHelper; /** * Adds an observer for Agora RTC channel client events. * @param observer The observer to add. */ addObserver(observer: AgoraRtcChannelClientObserver): void; /** * Removes an observer for Agora RTC channel client events. * @param observer The observer to remove. */ removeObserver(observer: AgoraRtcChannelClientObserver): void; /** * Joins an Agora RTC channel. * @param streamId The ID of the stream. * @param token The token for authentication. * @returns A promise that resolves when the join is successful. */ abstract join(streamId: string, token: string): Promise; /** * ReJoin an Agora RTC channel. * @param streamId The ID of the stream. * @param token The token for authentication. * @returns A promise that resolves when the join is successful. */ abstract rejoin(streamId: string, token: string): Promise; /** * Leaves an Agora RTC channel. * @returns A promise that resolves when the leave is successful. */ abstract leave(): Promise; /** * Sets the encryption configuration for the client. * @param config The encryption configuration. * @returns The result of the operation. */ abstract setEncryptionConfig(config: AgoraRtcEncryptionConfig): number; /** * Sets the video encoder configuration for the client. * @param config The video encoder configuration. * @param streamType The type of the stream. * @param streamId The ID of the stream. * @returns The result of the operation. */ abstract setVideoEncoderConfig(config: AgoraRtcVideoEncoderConfiguration, streamLayer: AgoraRtcStreamLayer, streamId: string): number; /** * Sets the dual stream mode for a local stream. * @param streamId The ID of the stream. * @param enable Whether to enable dual stream mode. * @returns The result of the operation. */ abstract setDualStreamMode(streamId: string, enable: boolean): number; /** * Starts rendering a remote video stream on a canvas. * @param streamId The ID of the stream. * @param view The view to render the video on. * @param streamType The type of the stream. * @param renderMode The render mode. * @param isMirror Whether to mirror the video. * @returns The result of the operation. */ abstract startRenderRemoteVideoStream(streamId: string, view: AgoraRteRenderView, renderMode: AgoraRtcRenderMode, isMirror: boolean): number; /** * Starts rendering a remote video stream on all canvases. * @param streamId The ID of the stream. */ abstract stopRenderRemoteVideoStreamOnAllCanvas(streamId: string): number; /** * Stops rendering a remote video stream on a canvas. * @param streamId The ID of the stream. * @param view The view to stop rendering the video on. * @returns The result of the operation. */ abstract stopRenderRemoteVideoStream(streamId: string, view: AgoraRteRenderView): number; /** * Takes a snapshot of a remote video stream. * @param streamId The ID of the stream. * @param filePath The path to save the snapshot to. * @returns A promise that resolves to the snapshot. */ abstract takeSnapshot(streamId: string, filePath?: string): Promise; /** * set screen scenario. * @param type The type of the scenario. * @returns The result of the operation. */ abstract setScreenScenario(type: AgoraRtcScreenScenarioType): number; abstract adjustRemoteAudioStreamVolume(streamId: string, volume: number): number; abstract pause(): void; abstract resume(): void; }