UNPKG

agora-meeting-sdk

Version:

For publishing npm package agora-metting-sdk (Web). Get more information from https://docs.agora.io

196 lines (189 loc) 11.2 kB
/// <reference types="node" /> import { EventEmitter } from 'events'; import { CameraOption, StartScreenShareParams, MicrophoneOption, ElectronWrapperInitOption, IElectronRTCWrapper } from '../interfaces/index'; import IAgoraRtcEngine from 'agora-electron-sdk'; export declare class CEFVideoEncoderConfiguration { /** * The video frame dimensions (px) used to specify the video quality and measured by the total number of pixels along a * frame's width and height: [VideoDimensions]{@link AgoraRtcEngine.VideoDimensions}. The default value is 640 x 360. */ dimensions: CEFVideoDimensions; /** * The frame rate of the video: [FRAME_RATE]{@link AgoraRtcEngine.FRAME_RATE}. The default value is 15. * * Note that we do not recommend setting this to a value greater than 30. */ frameRate: number; /** * The minimum frame rate of the video. The default value is -1. */ minFrameRate: number; /** The video encoding bitrate (Kbps). Choose one of the following options: - [STANDARD_BITRATE]{@link AgoraRtcEngine.STANDARD_BITRATE}: (Recommended) The standard bitrate. - The `COMMUNICATION` profile: the encoding bitrate equals the base bitrate. - The `LIVE_BROADCASTING` profile: the encoding bitrate is twice the base bitrate. - [COMPATIBLE_BITRATE]{@link AgoraRtcEngine.COMPATIBLE_BITRATE}: The compatible bitrate: the bitrate stays the same regardless of the profile. The `COMMUNICATION` profile prioritizes smoothness, while the `LIVE_BROADCASTING` profile prioritizes video quality (requiring a higher bitrate). We recommend setting the bitrate mode as `STANDARD_BITRATE` to address this difference. The following table lists the recommended video encoder configurations, where the base bitrate applies to the `COMMUNICATION` profile. Set your bitrate based on this table. If you set a bitrate beyond the proper range, the SDK automatically sets it to within the range. @note In the following table, **Base Bitrate** applies to the `COMMUNICATION` profile, and **Live Bitrate** applies to the `LIVE_BROADCASTING` profile. | Resolution | Frame Rate (fps) | Base Bitrate (Kbps) | Live Bitrate (Kbps) | |------------------------|------------------|----------------------------------------|----------------------------------------| | 160 * 120 | 15 | 65 | 130 | | 120 * 120 | 15 | 50 | 100 | | 320 * 180 | 15 | 140 | 280 | | 180 * 180 | 15 | 100 | 200 | | 240 * 180 | 15 | 120 | 240 | | 320 * 240 | 15 | 200 | 400 | | 240 * 240 | 15 | 140 | 280 | | 424 * 240 | 15 | 220 | 440 | | 640 * 360 | 15 | 400 | 800 | | 360 * 360 | 15 | 260 | 520 | | 640 * 360 | 30 | 600 | 1200 | | 360 * 360 | 30 | 400 | 800 | | 480 * 360 | 15 | 320 | 640 | | 480 * 360 | 30 | 490 | 980 | | 640 * 480 | 15 | 500 | 1000 | | 480 * 480 | 15 | 400 | 800 | | 640 * 480 | 30 | 750 | 1500 | | 480 * 480 | 30 | 600 | 1200 | | 848 * 480 | 15 | 610 | 1220 | | 848 * 480 | 30 | 930 | 1860 | | 640 * 480 | 10 | 400 | 800 | | 1280 * 720 | 15 | 1130 | 2260 | | 1280 * 720 | 30 | 1710 | 3420 | | 960 * 720 | 15 | 910 | 1820 | | 960 * 720 | 30 | 1380 | 2760 | | 1920 * 1080 | 15 | 2080 | 4160 | | 1920 * 1080 | 30 | 3150 | 6300 | | 1920 * 1080 | 60 | 4780 | 6500 | | 2560 * 1440 | 30 | 4850 | 6500 | | 2560 * 1440 | 60 | 6500 | 6500 | | 3840 * 2160 | 30 | 6500 | 6500 | | 3840 * 2160 | 60 | 6500 | 6500 | */ bitrate: number; /** * The minimum encoding bitrate (Kbps). * * The SDK automatically adjusts the encoding bitrate to adapt to the network conditions. Using a value greater than the default * value forces the video encoder to output high-quality images but may cause more packet loss and hence sacrifice the smoothness * of the video transmission. That said, unless you have special requirements for image quality, Agora does not recommend * changing this value. * * @note This parameter applies only to the `LIVE_BROADCASTING` profile. */ minBitrate: number; /** * The video orientation mode of the video: [ORIENTATION_MODE]{@link AgoraRtcEngine.ORIENTATION_MODE}. */ orientationMode: number; /** * The video encoding degradation preference under limited bandwidth: * [DEGRADATION_PREFERENCE]{@link AgoraRtcEngine.DEGRADATION_PREFERENCE}. */ degradationPreference: number; /** * Sets the mirror mode of the published local video stream. It only affects the video that the remote user sees. See * [VIDEO_MIRROR_MODE_TYPE]{@link AgoraRtcEngine.VIDEO_MIRROR_MODE_TYPE}. * * @note The SDK disables the mirror mode by default. */ mirrorMode: number; constructor(dimensions?: CEFVideoDimensions, frameRate?: any, minFrameRate?: number, bitrate?: number, minBitrate?: number, orientationMode?: number, degradationPreference?: number, mirrorMode?: number); } export declare class CEFVideoDimensions { /** * Width (pixels) of the video. */ width: number; /** * Height (pixels) of the video. */ height: number; constructor(width?: number, height?: number); } export declare function CustomBtoa(input: any): string; export declare class AgoraElectronRTCWrapper extends EventEmitter implements IElectronRTCWrapper { client: IAgoraRtcEngine; logPath: string; videoSourceLogPath: string; role: number; joined: boolean; videoMuted: boolean; audioMuted: boolean; localUid?: number; channel?: number; appId: string; subscribedList: number[]; superChannel: any; userJoinedEvent: any; userOfflineEvent: any; cameraList: any[]; microphoneList: any[]; _subClient: Record<string, any>; _localAudioStats: { audioLossRate: number; }; _localVideoStats: { videoLossRate: number; }; _remoteVideoStats: Record<number, any>; _remoteAudioStats: Record<number, any>; _cefClient: any; get deviceList(): any[]; cpuUsage: number; gatewayRtt: number; lastMileDelay: number; constructor(options: ElectronWrapperInitOption); muteRemoteVideoByClient(client: any, uid: string, val: boolean): Promise<any>; muteRemoteAudioByClient(client: any, uid: string, val: boolean): Promise<any>; setAddonLogPath(payload: { logPath: string; videoSourceLogPath: string; }): void; enableLogPersist(): void; changePlaybackVolume(volume: number): void; muteLocalVideo(val: boolean): Promise<any>; muteLocalAudio(val: boolean): Promise<any>; muteRemoteVideo(uid: any, val: boolean): Promise<any>; muteRemoteAudio(uid: any, val: boolean): Promise<any>; releaseAllClient(): void; releaseSubChannels(): void; resetState(): void; reset(): void; private fire; init(): void; joinSubChannel(option: any): Promise<any>; join(option: any): Promise<any>; leaveSubChannel(channelName: string): Promise<any>; leave(): Promise<any>; release(): void; openCamera(option?: CameraOption): Promise<any>; closeCamera(): void; changeCamera(deviceId: string): Promise<any>; getMicrophones(): Promise<any[]>; getCameras(): Promise<any[]>; changeResolution(config: any): Promise<any>; openMicrophone(option?: MicrophoneOption): Promise<any>; closeMicrophone(): void; changeMicrophone(deviceId: string): Promise<any>; prepareScreenShare(): Promise<any>; startScreenShare(options: StartScreenShareParams): Promise<any>; stopScreenShare(): Promise<any>; publish(): Promise<any>; unpublish(): Promise<any>; openTestCamera(option?: CameraOption): Promise<any>; closeTestCamera(): void; changeTestCamera(deviceId: string): Promise<any>; openTestMicrophone(option?: MicrophoneOption): Promise<any>; changeTestResolution(config: any): Promise<any>; closeTestMicrophone(): void; changeTestMicrophone(deviceId: string): Promise<any>; }