UNPKG

trtc-electron-sdk

Version:

trtc electron sdk

84 lines (83 loc) 3.71 kB
import { TRTCCameraCaptureParams, TRTCDeviceInfo, TRTCDeviceType, Rect } from '../../trtc_define'; declare const NodeTRTCEngine: any; /** * 设备管理器 */ export declare class TRTCDeviceManager { private logPrefix; private isIPCMode; private nodeDeviceManager; private promiseStore; private eventEmitter; constructor(options: { isIPCMode: boolean; nodeTRTCCloud: typeof NodeTRTCEngine.TRTCCloud | typeof NodeTRTCEngine.RemoteTRTCCloud; }); destroy(): void; /** * 获取设备列表 * * @param type {TRTCDeviceType} - 设备类型 * @returns {Array<TRTCDeviceInfo>} */ getDevicesList(type: TRTCDeviceType): Array<TRTCDeviceInfo>; setCurrentDevice(type: TRTCDeviceType, deviceId: string): Promise<void> | void; getCurrentDevice(type: TRTCDeviceType): Promise<TRTCDeviceInfo> | TRTCDeviceInfo; setCurrentDeviceVolume(type: TRTCDeviceType, volume: number): Promise<void> | void; getCurrentDeviceVolume(type: TRTCDeviceType): Promise<number> | number; setCurrentDeviceMute(type: TRTCDeviceType, mute: boolean): Promise<void> | void; getCurrentDeviceMute(type: TRTCDeviceType): Promise<boolean> | boolean; enableFollowingDefaultAudioDevice(type: TRTCDeviceType, enable: boolean): Promise<void> | void; startMicDeviceTest(interval: number, playback?: boolean): Promise<void> | void; stopMicDeviceTest(): Promise<void> | void; startSpeakerDeviceTest(filePath: string): Promise<void> | void; stopSpeakerDeviceTest(): Promise<void> | void; setApplicationPlayVolume(volume: number): Promise<void> | void; getApplicationPlayVolume(): Promise<number> | number; setApplicationMuteState(mute: boolean): Promise<void> | void; getApplicationMuteState(): Promise<boolean> | boolean; setCameraCaptureParam(params: TRTCCameraCaptureParams): Promise<void> | void; /** * 监听事件 * * @param event {String} - 事件名称 * @param func {Function} - 事件回调函数 */ on(event: string, func: (...args: any[]) => void): void; /** * 取消事件监听 * * @param event {String} - 事件名 * @param func {Function} - 事件回调函数 */ off(event: string, func: (...args: any[]) => void): void; private addPromise; private removePromise; private eventHandler; private onDeviceChange; private onSetCurrentDeviceFinished; private onGetCurrentDeviceFinished; private onSetCurrentDeviceVolumeFinished; private onGetCurrentDeviceVolumeFinished; private onSetCurrentDeviceMuteFinished; private onGetCurrentDeviceMuteFinished; private onEnableFollowingDefaultAudioDeviceFinished; private onStartCameraDeviceTestFinished; private onStopCameraDeviceTestFinished; private onStartMicDeviceTestFinished; private onStopMicDeviceTestFinished; private onStartSpeakerDeviceTestFinished; private onStopSpeakerDeviceTestFinished; private onSetApplicationPlayVolumeFinished; private onGetApplicationPlayVolumeFinished; private onSetApplicationMuteStateFinished; private onGetApplicationMuteStateFinished; startCameraDeviceTest(windowID: number | Uint8Array, rect?: Rect): Promise<number>; stopCameraDeviceTest(): Promise<number>; setCameraTestRenderMirror(mirror: boolean): void; setCameraTestDeviceId(cameraId: string): void; setCameraTestResolution(width: number, height: number): void; setCameraTestVideoPluginPath(path: string): void; setCameraTestVideoPluginParameter(params: string): void; } export default TRTCDeviceManager;