agora-rte-sdk 2.0.0-beta → 2.0.1-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/.DS_Store ADDED
Binary file
@@ -0,0 +1 @@
1
+ export * as RTM from './rtm';
@@ -0,0 +1,15 @@
1
+ import Dexie, { Table } from 'dexie';
2
+ declare type Timestamp = number;
3
+ declare type LogSchema = {
4
+ content: string;
5
+ created_at: Timestamp;
6
+ timestamp: string;
7
+ };
8
+ export declare class EduSDKLogger extends Dexie {
9
+ logs: Table<LogSchema, number>;
10
+ constructor();
11
+ openDatabase(): void;
12
+ readAndDeleteBy(time: number): Promise<string[][]>;
13
+ resetByKeys(time: number): Promise<string[][]>;
14
+ }
15
+ export {};
@@ -0,0 +1,4 @@
1
+ export declare enum EduLogLevel {
2
+ Debug = "Debug",
3
+ None = "None"
4
+ }
@@ -0,0 +1,239 @@
1
+ /// <reference types="node" />
2
+ import { EventEmitter } from 'events';
3
+ import { StartScreenShareParams, ElectronWrapperInitOption, IElectronRTCWrapper, PrepareScreenShareParams } from '../interfaces/index';
4
+ import IAgoraRtcEngine from 'agora-electron-sdk';
5
+ export declare class CEFVideoEncoderConfiguration {
6
+ /**
7
+ * The video frame dimensions (px) used to specify the video quality and measured by the total number of pixels along a
8
+ * frame's width and height: [VideoDimensions]{@link AgoraRtcEngine.VideoDimensions}. The default value is 640 x 360.
9
+ */
10
+ dimensions: CEFVideoDimensions;
11
+ /**
12
+ * The frame rate of the video: [FRAME_RATE]{@link AgoraRtcEngine.FRAME_RATE}. The default value is 15.
13
+ *
14
+ * Note that we do not recommend setting this to a value greater than 30.
15
+ */
16
+ frameRate: number;
17
+ /**
18
+ * The minimum frame rate of the video. The default value is -1.
19
+ */
20
+ minFrameRate: number;
21
+ /**
22
+ The video encoding bitrate (Kbps).
23
+
24
+ Choose one of the following options:
25
+
26
+ - [STANDARD_BITRATE]{@link AgoraRtcEngine.STANDARD_BITRATE}: (Recommended) The standard bitrate.
27
+ - The `COMMUNICATION` profile: the encoding bitrate equals the base bitrate.
28
+ - The `LIVE_BROADCASTING` profile: the encoding bitrate is twice the base bitrate.
29
+ - [COMPATIBLE_BITRATE]{@link AgoraRtcEngine.COMPATIBLE_BITRATE}: The compatible bitrate: the bitrate stays the same regardless of the
30
+ profile.
31
+
32
+ The `COMMUNICATION` profile prioritizes smoothness, while the `LIVE_BROADCASTING` profile prioritizes video quality (requiring
33
+ a higher bitrate). We recommend setting the bitrate mode as `STANDARD_BITRATE` to address this difference.
34
+
35
+ The following table lists the recommended video encoder configurations, where the base bitrate applies to the `COMMUNICATION`
36
+ profile. Set your bitrate based on this table. If you set a bitrate beyond the proper range, the SDK automatically sets it
37
+ to within the range.
38
+
39
+ @note In the following table, **Base Bitrate** applies to the `COMMUNICATION` profile, and **Live Bitrate** applies to the
40
+ `LIVE_BROADCASTING` profile.
41
+
42
+ | Resolution | Frame Rate (fps) | Base Bitrate (Kbps) | Live Bitrate (Kbps) |
43
+ |------------------------|------------------|----------------------------------------|----------------------------------------|
44
+ | 160 * 120 | 15 | 65 | 130 |
45
+ | 120 * 120 | 15 | 50 | 100 |
46
+ | 320 * 180 | 15 | 140 | 280 |
47
+ | 180 * 180 | 15 | 100 | 200 |
48
+ | 240 * 180 | 15 | 120 | 240 |
49
+ | 320 * 240 | 15 | 200 | 400 |
50
+ | 240 * 240 | 15 | 140 | 280 |
51
+ | 424 * 240 | 15 | 220 | 440 |
52
+ | 640 * 360 | 15 | 400 | 800 |
53
+ | 360 * 360 | 15 | 260 | 520 |
54
+ | 640 * 360 | 30 | 600 | 1200 |
55
+ | 360 * 360 | 30 | 400 | 800 |
56
+ | 480 * 360 | 15 | 320 | 640 |
57
+ | 480 * 360 | 30 | 490 | 980 |
58
+ | 640 * 480 | 15 | 500 | 1000 |
59
+ | 480 * 480 | 15 | 400 | 800 |
60
+ | 640 * 480 | 30 | 750 | 1500 |
61
+ | 480 * 480 | 30 | 600 | 1200 |
62
+ | 848 * 480 | 15 | 610 | 1220 |
63
+ | 848 * 480 | 30 | 930 | 1860 |
64
+ | 640 * 480 | 10 | 400 | 800 |
65
+ | 1280 * 720 | 15 | 1130 | 2260 |
66
+ | 1280 * 720 | 30 | 1710 | 3420 |
67
+ | 960 * 720 | 15 | 910 | 1820 |
68
+ | 960 * 720 | 30 | 1380 | 2760 |
69
+ | 1920 * 1080 | 15 | 2080 | 4160 |
70
+ | 1920 * 1080 | 30 | 3150 | 6300 |
71
+ | 1920 * 1080 | 60 | 4780 | 6500 |
72
+ | 2560 * 1440 | 30 | 4850 | 6500 |
73
+ | 2560 * 1440 | 60 | 6500 | 6500 |
74
+ | 3840 * 2160 | 30 | 6500 | 6500 |
75
+ | 3840 * 2160 | 60 | 6500 | 6500 |
76
+ */
77
+ bitrate: number;
78
+ /**
79
+ * The minimum encoding bitrate (Kbps).
80
+ *
81
+ * The SDK automatically adjusts the encoding bitrate to adapt to the network conditions. Using a value greater than the default
82
+ * value forces the video encoder to output high-quality images but may cause more packet loss and hence sacrifice the smoothness
83
+ * of the video transmission. That said, unless you have special requirements for image quality, Agora does not recommend
84
+ * changing this value.
85
+ *
86
+ * @note This parameter applies only to the `LIVE_BROADCASTING` profile.
87
+ */
88
+ minBitrate: number;
89
+ /**
90
+ * The video orientation mode of the video: [ORIENTATION_MODE]{@link AgoraRtcEngine.ORIENTATION_MODE}.
91
+ */
92
+ orientationMode: number;
93
+ /**
94
+ * The video encoding degradation preference under limited bandwidth:
95
+ * [DEGRADATION_PREFERENCE]{@link AgoraRtcEngine.DEGRADATION_PREFERENCE}.
96
+ */
97
+ degradationPreference: number;
98
+ /**
99
+ * Sets the mirror mode of the published local video stream. It only affects the video that the remote user sees. See
100
+ * [VIDEO_MIRROR_MODE_TYPE]{@link AgoraRtcEngine.VIDEO_MIRROR_MODE_TYPE}.
101
+ *
102
+ * @note The SDK disables the mirror mode by default.
103
+ */
104
+ mirrorMode: number;
105
+ constructor(dimensions?: CEFVideoDimensions, frameRate?: any, minFrameRate?: number, bitrate?: number, minBitrate?: number, orientationMode?: number, degradationPreference?: number, mirrorMode?: number);
106
+ }
107
+ export declare class CEFVideoDimensions {
108
+ /**
109
+ * Width (pixels) of the video.
110
+ */
111
+ width: number;
112
+ /**
113
+ * Height (pixels) of the video.
114
+ */
115
+ height: number;
116
+ constructor(width?: number, height?: number);
117
+ }
118
+ export declare function CustomBtoa(input: any): string;
119
+ export declare class AgoraElectronRTCWrapper extends EventEmitter implements IElectronRTCWrapper {
120
+ client: IAgoraRtcEngine;
121
+ logPath: string;
122
+ videoSourceLogPath: string;
123
+ role: number;
124
+ joined: boolean;
125
+ videoMuted: boolean;
126
+ audioMuted: boolean;
127
+ localUid?: number;
128
+ channel?: number;
129
+ appId: string;
130
+ subscribedList: number[];
131
+ superChannel: any;
132
+ userJoinedEvent: any;
133
+ userOfflineEvent: any;
134
+ cameraList: any[];
135
+ microphoneList: any[];
136
+ _subClient: Record<string, any>;
137
+ _localAudioStats: {
138
+ audioLossRate: number;
139
+ };
140
+ _localVideoStats: {
141
+ videoLossRate: number;
142
+ };
143
+ _remoteVideoStats: Record<number, any>;
144
+ _remoteAudioStats: Record<number, any>;
145
+ _cefClient: any;
146
+ get deviceList(): any[];
147
+ cpuUsage: number;
148
+ gatewayRtt: number;
149
+ lastMileDelay: number;
150
+ published: boolean;
151
+ nativeAreaCode?: number;
152
+ enableEncryption?: boolean;
153
+ configEncryption?: any;
154
+ constructor(options: ElectronWrapperInitOption);
155
+ muteRemoteVideoByClient(client: any, uid: string, val: boolean): Promise<any>;
156
+ muteRemoteAudioByClient(client: any, uid: string, val: boolean): Promise<any>;
157
+ setAddonLogPath(payload: {
158
+ logPath: string;
159
+ videoSourceLogPath: string;
160
+ }): void;
161
+ enableLogPersist(): void;
162
+ changePlaybackVolume(volume: number): void;
163
+ muteRemoteVideo(uid: any, val: boolean): Promise<any>;
164
+ muteRemoteAudio(uid: any, val: boolean): Promise<any>;
165
+ releaseAllClient(): void;
166
+ releaseSubChannels(): void;
167
+ resetState(): void;
168
+ reset(): void;
169
+ private fire;
170
+ init(): void;
171
+ joinSubChannel(option: any): Promise<any>;
172
+ prepare(): IAgoraRtcEngine;
173
+ join(option: any): Promise<any>;
174
+ leaveSubChannel(channelName: string): Promise<any>;
175
+ leave(): Promise<any>;
176
+ release(): void;
177
+ getMicrophones(): Promise<any[]>;
178
+ getCameras(): Promise<any[]>;
179
+ changeResolution(config: any): Promise<any>;
180
+ prepareScreenShare(params?: PrepareScreenShareParams): Promise<any>;
181
+ startScreenShare(options: StartScreenShareParams): Promise<any>;
182
+ stopScreenShare(): Promise<any>;
183
+ publish(): Promise<any>;
184
+ unpublish(): Promise<any>;
185
+ muteLocalAudioStream(v: boolean): Promise<void>;
186
+ muteLocalVideoStream(v: boolean): Promise<void>;
187
+ /**
188
+ * 开启音频采集
189
+ * @param v
190
+ */
191
+ enableLocalVideo(v: boolean): Promise<number>;
192
+ /**
193
+ * 设置摄像头设备
194
+ * @param deviceId
195
+ * @returns
196
+ */
197
+ enableLocalAudio(v: boolean): Promise<number>;
198
+ /**
199
+ * 关闭音频发流
200
+ * @param v
201
+ * @returns
202
+ */
203
+ muteLocalAudio(v: boolean, deviceId?: string): Promise<number>;
204
+ /**
205
+ * 关闭视频发流
206
+ * @param v
207
+ * @returns
208
+ */
209
+ muteLocalVideo(v: boolean, deviceId?: string): Promise<number>;
210
+ disableLocalVideo(): void;
211
+ disableLocalAudio(): void;
212
+ /**
213
+ * 设置摄像头设备
214
+ * @param deviceId
215
+ * @returns
216
+ */
217
+ setCameraDevice(deviceId: string): Promise<number>;
218
+ /**
219
+ * 设置麦克风设备
220
+ * @param deviceId
221
+ * @returns
222
+ */
223
+ setMicrophoneDevice(deviceId: string): Promise<number>;
224
+ enableMediaEncryptionConfig(enabled: boolean, config: any): number;
225
+ /**
226
+ * 设置美颜效果
227
+ * lighteningLevel 美白
228
+ * rednessLevel 红润
229
+ * smoothnessLevel 磨皮
230
+ * @param param0
231
+ * @returns
232
+ */
233
+ setBeautyEffectOptions({ lighteningLevel, rednessLevel, smoothnessLevel, isBeauty, }: {
234
+ lighteningLevel: number;
235
+ rednessLevel: number;
236
+ smoothnessLevel: number;
237
+ isBeauty?: boolean;
238
+ }): number;
239
+ }
@@ -0,0 +1,75 @@
1
+ /// <reference types="node" />
2
+ import { LocalUserRenderer, VideoRenderState, RemoteUserRenderer } from './renderer/index';
3
+ import { EventEmitter } from 'events';
4
+ import { IMediaService, RTCWrapperProvider, RTCProviderInitParams, PrepareScreenShareParams, StartScreenShareParams, JoinOption, MediaEncryptionConfig } from './interfaces';
5
+ import { AgoraElectronRTCWrapper } from './electron';
6
+ import { AgoraWebRtcWrapper } from './web';
7
+ import { ILocalTrack } from 'agora-rtc-sdk-ng';
8
+ export declare class MediaService extends EventEmitter implements IMediaService {
9
+ sdkWrapper: RTCWrapperProvider;
10
+ cameraTestRenderer?: LocalUserRenderer;
11
+ cameraRenderer?: LocalUserRenderer;
12
+ microphoneTrack?: ILocalTrack;
13
+ screenRenderer?: LocalUserRenderer;
14
+ remoteUsersRenderer: RemoteUserRenderer[];
15
+ screenShareIds: any[];
16
+ readonly _id: string;
17
+ private eduManager;
18
+ encoderConfig: any;
19
+ rtcProvider: RTCProviderInitParams;
20
+ constructor(rtcProvider: RTCProviderInitParams);
21
+ setRtcRole(roleType: string): Promise<void>;
22
+ muteLocalVideo(val: boolean, deviceId?: string): Promise<any>;
23
+ muteLocalAudio(val: boolean, deviceId?: string): Promise<any>;
24
+ disableLocalAudio(): void;
25
+ disableLocalVideo(): void;
26
+ enableLocalVideo(val: boolean): Promise<any>;
27
+ enableLocalAudio(val: boolean): Promise<any>;
28
+ setCameraDevice(deviceId: string): Promise<any>;
29
+ setMicrophoneDevice(deviceId: string): Promise<any>;
30
+ private fire;
31
+ fireLocalVideoStateUpdated(state: VideoRenderState): void;
32
+ fireRemoteVideoStateUpdated(state: VideoRenderState, uid: string): void;
33
+ get isWeb(): boolean;
34
+ get isElectron(): boolean;
35
+ get sessionId(): string;
36
+ private getNativeCurrentVideoDevice;
37
+ private getNativeVideoDevices;
38
+ private getNativeCurrentAudioDevice;
39
+ private getNativeAudioDevices;
40
+ getTestCameraLabel(): string;
41
+ getTestMicrophoneLabel(): string;
42
+ getCameraLabel(): string;
43
+ private getNativeSpeakerLabel;
44
+ getSpeakerLabel(): string;
45
+ getMicrophoneLabel(): string;
46
+ changePlaybackVolume(volume: number): void;
47
+ muteRemoteVideo(uid: any, val: boolean): Promise<any>;
48
+ muteRemoteAudio(uid: any, val: boolean): Promise<any>;
49
+ get web(): AgoraWebRtcWrapper;
50
+ get electron(): AgoraElectronRTCWrapper;
51
+ init(): void;
52
+ release(): void;
53
+ prepare(): import("agora-electron-sdk/types/Api").default | import("agora-rtc-sdk-ng").IAgoraRTCClient;
54
+ join(option: JoinOption): Promise<any>;
55
+ _join(option: JoinOption): Promise<any>;
56
+ private destroyAllRenderers;
57
+ leave(): Promise<any>;
58
+ joinSubChannel(option: JoinOption): Promise<any>;
59
+ leaveSubChannel(channelName: string): Promise<any>;
60
+ getCameras(): Promise<any>;
61
+ getMicrophones(): Promise<any>;
62
+ prepareScreenShare(params?: PrepareScreenShareParams): Promise<any>;
63
+ startScreenShare(option: StartScreenShareParams): Promise<any>;
64
+ stopScreenShare(): Promise<any>;
65
+ changeResolution(config: any): Promise<void>;
66
+ getPlaybackVolume(): number;
67
+ enableMediaEncryptionConfig(enabled: boolean, config: MediaEncryptionConfig): number;
68
+ reset(): void;
69
+ setBeautyEffectOptions({ lighteningLevel, rednessLevel, smoothnessLevel, isBeauty, }: {
70
+ lighteningLevel: number;
71
+ rednessLevel: number;
72
+ smoothnessLevel: number;
73
+ isBeauty?: boolean;
74
+ }): number | undefined;
75
+ }
@@ -0,0 +1,318 @@
1
+ import { IAgoraRTC, IAgoraRTCClient, ICameraVideoTrack, ILocalAudioTrack, ILocalTrack, ILocalVideoTrack, IMicrophoneAudioTrack } from 'agora-rtc-sdk-ng';
2
+ import { AgoraElectronRTCWrapper } from '../electron';
3
+ import IAgoraRtcEngine from 'agora-electron-sdk';
4
+ import { LocalUserRenderer, RemoteUserRenderer } from '../renderer';
5
+ import { AgoraWebRtcWrapper } from '../web';
6
+ import { EduRoleTypeEnum, EduRoomTypeEnum, EduVideoEncoderConfiguration } from '../../../interfaces';
7
+ export declare function event_device_changed(evt: any): void;
8
+ export declare type Option = any;
9
+ export declare interface WebRtcWrapperInitOption {
10
+ appId: string;
11
+ uploadLog: boolean;
12
+ agoraWebSdk: IAgoraRTC;
13
+ webConfig: {
14
+ mode: string;
15
+ codec: string;
16
+ role: string;
17
+ clientRoleOptions: ClientRoleOptions;
18
+ };
19
+ }
20
+ export declare type RTCWrapperProvider = AgoraWebRtcWrapper | AgoraElectronRTCWrapper;
21
+ /**
22
+ * IElectronRTCWrapper
23
+ * 主要集成agora-electron-sdk,为media-service提供web端内部实现
24
+ */
25
+ export declare interface IElectronRTCWrapper extends IAgoraRTCModule {
26
+ client: IAgoraRtcEngine;
27
+ }
28
+ /**
29
+ * ElectronWrapperInitOption
30
+ * 主要用于初始化构造electron rtc wrapper
31
+ */
32
+ export declare interface ElectronWrapperInitOption {
33
+ logPath: string;
34
+ videoSourceLogPath: string;
35
+ AgoraRtcEngine: any;
36
+ appId: string;
37
+ cefClient: any;
38
+ area: AREA_CODE;
39
+ cameraEncoderConfiguration?: EduVideoEncoderConfiguration;
40
+ }
41
+ export declare const convertNativeAreaCode: (codeName: string) => number;
42
+ /**
43
+ * IWebRTCWrapper
44
+ * 主要集成web ng sdk,为media-service提供web端内部实现
45
+ */
46
+ export declare interface IWebRTCWrapper extends IAgoraRTCModule {
47
+ cameraTrack?: ICameraVideoTrack;
48
+ audioTrack?: IMicrophoneAudioTrack;
49
+ screenVideoTrack?: ILocalVideoTrack;
50
+ screenAudioTrack?: ILocalAudioTrack;
51
+ screenClient?: IAgoraRTCClient;
52
+ client: IAgoraRTCClient;
53
+ }
54
+ export declare type AREA_CODE = 'CHINA' | 'ASIA' | 'NORTH_AMERICA' | 'EUROPE' | 'JAPAN' | 'INDIA' | 'OVERSEA' | 'GLOBAL' | 'SOUTH_AMERICA' | 'AFRICA' | string;
55
+ /**
56
+ * WebRtcWrapperInitOption
57
+ * 主要用于初始化构造agora-web-sdk-ng rtc wrapper
58
+ */
59
+ export declare interface WebRtcWrapperInitOption {
60
+ appId: string;
61
+ uploadLog: boolean;
62
+ agoraWebSdk: IAgoraRTC;
63
+ area: AREA_CODE;
64
+ cameraEncoderConfiguration: EduVideoEncoderConfiguration;
65
+ webConfig: {
66
+ mode: string;
67
+ codec: string;
68
+ role: string;
69
+ clientRoleOptions: ClientRoleOptions;
70
+ };
71
+ }
72
+ export declare type ClientRoleOptions = {
73
+ level: 1 | 2;
74
+ };
75
+ export declare enum ScreenShareType {
76
+ Window = 0,
77
+ Screen = 1
78
+ }
79
+ export declare interface PrepareScreenShareParams {
80
+ dom?: HTMLElement;
81
+ type?: ScreenShareType;
82
+ shareAudio?: 'enable' | 'auto' | 'disable';
83
+ encoderConfig?: any;
84
+ }
85
+ export declare interface CameraOption {
86
+ deviceId: string;
87
+ encoderConfig?: {
88
+ width: number;
89
+ height: number;
90
+ frameRate: number;
91
+ };
92
+ }
93
+ export declare interface MicrophoneOption {
94
+ deviceId: string;
95
+ }
96
+ export declare enum MediaEncryptionMode {
97
+ /** 1: (Default) 128-bit AES encryption, XTS mode.
98
+ */
99
+ AES_128_XTS = 1,
100
+ /** 2: 128-bit AES encryption, ECB mode.
101
+ */
102
+ AES_128_ECB = 2,
103
+ /** 3: 256-bit AES encryption, XTS mode.
104
+ */
105
+ AES_256_XTS = 3,
106
+ /** 4: Reserved property.
107
+ */
108
+ SM4_128_ECB = 4,
109
+ /** 5: 128-bit AES encryption, GCM mode.
110
+ *
111
+ * @since v3.3.1
112
+ */
113
+ AES_128_GCM = 5,
114
+ /** 6: 256-bit AES encryption, GCM mode.
115
+ *
116
+ * @since v3.3.1
117
+ */
118
+ AES_256_GCM = 6
119
+ }
120
+ export declare interface MediaEncryptionConfig {
121
+ mode: MediaEncryptionMode;
122
+ key: string;
123
+ }
124
+ /**
125
+ *
126
+ */
127
+ export declare interface IAgoraRTCModule {
128
+ init(): void;
129
+ release(): void;
130
+ prepare(): any;
131
+ join(option: Option): Promise<any>;
132
+ leave(): Promise<any>;
133
+ enableLocalVideo(v: boolean): Promise<any>;
134
+ enableLocalAudio(v: boolean): Promise<any>;
135
+ disableLocalAudio(): void;
136
+ disableLocalVideo(): void;
137
+ setCameraDevice(deviceId: string): Promise<any>;
138
+ setMicrophoneDevice(deviceId: string): Promise<any>;
139
+ muteLocalVideo(val: boolean, deviceId?: string): Promise<any>;
140
+ muteLocalAudio(val: boolean, deviceId?: string): Promise<any>;
141
+ muteRemoteVideo(uid: any, val: boolean): Promise<any>;
142
+ muteRemoteAudio(uid: any, val: boolean): Promise<any>;
143
+ getCameras(): Promise<any[]>;
144
+ getMicrophones(): Promise<any[]>;
145
+ prepareScreenShare(params?: PrepareScreenShareParams): Promise<any>;
146
+ startScreenShare(params: StartScreenShareParams): Promise<any>;
147
+ stopScreenShare(): Promise<any>;
148
+ changePlaybackVolume(volume: number): void;
149
+ enableMediaEncryptionConfig(enabled: boolean, config: MediaEncryptionConfig): void;
150
+ on(event: 'error', listener: (err: any) => void): void;
151
+ on(event: 'audio-device-changed', listener: typeof event_device_changed): void;
152
+ on(event: 'video-device-changed', listener: typeof event_device_changed): void;
153
+ on(event: 'user-joined', listener: (evt: any) => void): void;
154
+ on(event: 'user-left', listener: (evt: any) => void): void;
155
+ on(event: 'user-info-updated', listener: (evt: any) => void): void;
156
+ on(event: 'token-privilege-will-expire', listener: (evt: any) => void): void;
157
+ on(event: 'token-privilege-did-expire', listener: (evt: any) => void): void;
158
+ on(event: 'connection-state-change', listener: (state: any, reason: any) => void): void;
159
+ on(event: 'stream-fallback', listener: (state: any, reason: any) => void): void;
160
+ on(event: 'network-quality', listener: (stats: any) => void): void;
161
+ on(event: 'volume-indicator', listener: (result: any[]) => void): void;
162
+ }
163
+ export declare interface RTCProviderInitParams {
164
+ eduManager?: any;
165
+ cefClient: any;
166
+ agoraSdk: any;
167
+ platform: string;
168
+ codec: string;
169
+ appId: string;
170
+ rtcArea: AREA_CODE;
171
+ rtmArea: AREA_CODE;
172
+ cameraEncoderConfiguration: EduVideoEncoderConfiguration;
173
+ scenarioType?: EduRoomTypeEnum;
174
+ userRole?: EduRoleTypeEnum;
175
+ electronLogPath?: {
176
+ logPath: string;
177
+ videoSourceLogPath: string;
178
+ };
179
+ latencyLevel?: 1 | 2;
180
+ }
181
+ export declare interface StartScreenShareParams {
182
+ shareId?: any;
183
+ config?: {
184
+ profile: number;
185
+ rect: any;
186
+ param: any;
187
+ };
188
+ type?: ScreenShareType;
189
+ params: {
190
+ uid: any;
191
+ channel: string;
192
+ token: string;
193
+ joinInfo?: string;
194
+ };
195
+ encoderConfig?: any;
196
+ }
197
+ export declare type JoinOption = {
198
+ channel: string;
199
+ token?: string | null;
200
+ uid: number;
201
+ info?: string;
202
+ data: any;
203
+ };
204
+ /**
205
+ * IMediaService
206
+ * 媒体提供层入口
207
+ */
208
+ export declare interface IMediaService extends IAgoraRTCModule {
209
+ /**
210
+ * sdk包装器用于提供agora-rtc-sdk-ng/agora-electron-sdk实例能力
211
+ */
212
+ sdkWrapper: RTCWrapperProvider;
213
+ web: AgoraWebRtcWrapper;
214
+ electron: AgoraElectronRTCWrapper;
215
+ /**
216
+ * 本地预览摄像头渲染器,用于绘制本地摄像头捕捉到的画面
217
+ */
218
+ cameraTestRenderer?: LocalUserRenderer;
219
+ /**
220
+ * 本地摄像头渲染器,当加入频道时会自动推入频道里。
221
+ */
222
+ cameraRenderer?: LocalUserRenderer;
223
+ /**
224
+ * 本地麦克风音频轨道
225
+ */
226
+ microphoneTrack?: ILocalTrack;
227
+ /**
228
+ * 屏幕共享渲染器,当加入频道时会自动推入频道内。
229
+ */
230
+ screenRenderer?: LocalUserRenderer;
231
+ /**
232
+ * 远端用户渲染器,在加入频道以后通过 user-published/user-unpublished 获取
233
+ */
234
+ remoteUsersRenderer: RemoteUserRenderer[];
235
+ /**
236
+ * 获取测试摄像头标签
237
+ */
238
+ getTestCameraLabel(): string;
239
+ /**
240
+ * 获取测试麦克风标签
241
+ */
242
+ getTestMicrophoneLabel(): string;
243
+ /**
244
+ * 获取摄像头标签
245
+ */
246
+ getCameraLabel(): string;
247
+ /**
248
+ * 获取扬声器标签
249
+ */
250
+ getSpeakerLabel(): string;
251
+ /**
252
+ * 获取麦克风标签
253
+ */
254
+ getMicrophoneLabel(): string;
255
+ /**
256
+ * 修改扬声器设备音量
257
+ */
258
+ changePlaybackVolume(volume: number): void;
259
+ /**
260
+ * 初始化
261
+ */
262
+ init(): void;
263
+ /**
264
+ * 释放媒体
265
+ */
266
+ release(): void;
267
+ /**
268
+ * 加入频道
269
+ * option: JoinOption
270
+ */
271
+ join(option: JoinOption): Promise<any>;
272
+ /**
273
+ * 离开频道
274
+ */
275
+ leave(): Promise<any>;
276
+ /**
277
+ * 加入子频道
278
+ * option: JoinOption
279
+ */
280
+ joinSubChannel(option: JoinOption): Promise<any>;
281
+ /**
282
+ * 离开子频道
283
+ * option: SubChannel
284
+ */
285
+ leaveSubChannel(channelName: string): Promise<any>;
286
+ /**
287
+ * 获取摄像头
288
+ */
289
+ getCameras(): Promise<any>;
290
+ /**
291
+ * 获取麦克风
292
+ */
293
+ getMicrophones(): Promise<any>;
294
+ /**
295
+ * 准备屏幕共享
296
+ */
297
+ prepareScreenShare(params: PrepareScreenShareParams): Promise<any>;
298
+ /**
299
+ * 开启屏幕共享
300
+ */
301
+ startScreenShare(option: StartScreenShareParams): Promise<any>;
302
+ /**
303
+ * 停止屏幕共享
304
+ */
305
+ stopScreenShare(): Promise<any>;
306
+ /**
307
+ * 获取扬声器音量,仅适用于electron
308
+ */
309
+ getPlaybackVolume(): number;
310
+ /**
311
+ * 重置
312
+ */
313
+ reset(): void;
314
+ }
315
+ export declare type MediaVolume = {
316
+ uid: number;
317
+ volume: number;
318
+ };