@xylink/xy-rtc-sdk 1.4.1-beta.22 → 2.0.1-1

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.
@@ -4,17 +4,19 @@
4
4
  * @authors Luo-jinghui (luojinghui424@gmail.com)
5
5
  * @date 2019-10-30 14:14:04
6
6
  */
7
- import { ILoginExtAccount, ISdkUserInfo } from '../type';
7
+ import { ILoginExtAccount, ISdkUserInfo, TStateAction, TEventType, IMeetingInfo } from '../type';
8
8
  import Logger from '../tools/logger';
9
9
  declare class Action {
10
10
  private http;
11
11
  private logHttp;
12
12
  private clientId;
13
+ private meetingInfo;
13
14
  constructor();
14
15
  setBaseUrl(baseUrl: string, logUrl: string): void;
15
16
  setLogBaseUrl(logUrl: string): void;
16
17
  setClientId(clientId: string): void;
17
18
  setLogger(logger: Logger): void;
19
+ setMeetingInfo(info: IMeetingInfo): void;
18
20
  upload(data: any): Promise<any>;
19
21
  /**
20
22
  * 获取小鱼世界账号密码
@@ -36,6 +38,9 @@ declare class Action {
36
38
  hand(type: string, meetingId: string, di: string, conferenceNo: string): Promise<any>;
37
39
  fetchErrorCode(securityKey: string): Promise<any>;
38
40
  getErrorCodeByJson(url: string): Promise<any>;
41
+ getConference(userProfileId: number, securityKey: string): Promise<any>;
42
+ setStates(action: TStateAction, eventType: TEventType, params?: {}): Promise<void>;
43
+ igonreMeetingMonito(confNumber: string, securityKey: string): Promise<any>;
39
44
  }
40
45
  declare const _default: Action;
41
46
  export default _default;
@@ -4,7 +4,9 @@
4
4
  * @authors Luo-jinghui (luojinghui424@gmail.com)
5
5
  * @date 2019-10-30 14:12:52
6
6
  */
7
- import { ICONTENT_CONTRAINTS, IBASE_CONTRAINTS, IDefault, IMUTE_MAP } from '../type';
7
+ import { ICONTENT_CONTRAINTS, IBASE_CONTRAINTS, IDefault, IMUTE_MAP, ITemplateMode, IContentTemplateMode } from '../type';
8
+ export declare const STREAM_CHANNEL_COUNT = 9;
9
+ export declare const STREAM_ERROR_CODE_MAP: number[];
8
10
  export declare const MUTE_MAP: IMUTE_MAP;
9
11
  export declare const CONTRAINTS_MAP: {
10
12
  0: number[];
@@ -19,7 +21,7 @@ export declare const CONTRAINTS_MAP: {
19
21
  export declare const BASE_CONTRAINTS: IBASE_CONTRAINTS;
20
22
  export declare const CONTENT_BASE_CONTRAINTS: ICONTENT_CONTRAINTS;
21
23
  export declare const CONTENT_CONTRAINTS: {
22
- 720: {
24
+ '720': {
23
25
  min: {
24
26
  frameRate: number;
25
27
  width: {
@@ -54,7 +56,7 @@ export declare const CONTENT_CONTRAINTS: {
54
56
  logicalSurface: true;
55
57
  };
56
58
  };
57
- 1080: {
59
+ '1080': {
58
60
  min: {
59
61
  frameRate: number;
60
62
  width: {
@@ -91,7 +93,7 @@ export declare const CONTENT_CONTRAINTS: {
91
93
  };
92
94
  };
93
95
  export declare const PEOPLE_CONTRAINTS: {
94
- 90: {
96
+ '90': {
95
97
  min: {
96
98
  frameRate: number;
97
99
  width: {
@@ -127,7 +129,7 @@ export declare const PEOPLE_CONTRAINTS: {
127
129
  resizeMode: "crop-and-scale";
128
130
  };
129
131
  };
130
- 180: {
132
+ '180': {
131
133
  min: {
132
134
  frameRate: number;
133
135
  width: {
@@ -163,7 +165,7 @@ export declare const PEOPLE_CONTRAINTS: {
163
165
  resizeMode: "crop-and-scale";
164
166
  };
165
167
  };
166
- 360: {
168
+ '360': {
167
169
  min: {
168
170
  frameRate: number;
169
171
  width: {
@@ -199,7 +201,7 @@ export declare const PEOPLE_CONTRAINTS: {
199
201
  resizeMode: "crop-and-scale";
200
202
  };
201
203
  };
202
- 720: {
204
+ '720': {
203
205
  min: {
204
206
  frameRate: number;
205
207
  width: {
@@ -244,3 +246,21 @@ export declare const NEW_CODE_MAP: {
244
246
  LOCAL_NET_DISCONNECT: string;
245
247
  };
246
248
  export declare const DEFAULT: IDefault;
249
+ export declare const TEMPLATE_MODE: ITemplateMode[];
250
+ export declare const CONTENT_TEMPLATE_MODE: IContentTemplateMode[];
251
+ export declare const TEMPLATE_DEFAULT_MODE = "SPEAKER";
252
+ export declare const CONTENT_DEFAULT_TEMPLATE_MODE = "MULTI_PIC_CONTENT_HIGH_PRIORITY";
253
+ export declare const APP_NAME: {
254
+ STANDARD_WEBRTC: string;
255
+ THIRD_WEBRTC: string;
256
+ };
257
+ export declare const EVENT_TYPE_MAP: {
258
+ muteAudio: string;
259
+ unmuteAudio: string;
260
+ muteVideo: string;
261
+ unmuteVideo: string;
262
+ };
263
+ export declare const RESOLUTION_360_CONTRAINTS: {
264
+ width: number;
265
+ height: number;
266
+ };
@@ -1,5 +1,8 @@
1
1
  /**
2
- * webrtc sdk
2
+ * XYLink WebRTC SDK Lib
3
+ *
4
+ * 主入口文件,提供 createClient、createStream、版本等基本信息和方法;
5
+ *
3
6
  * @authors Luo-jinghui (luojinghui424@gmail.com)
4
7
  * @date 2019-10-14 18:20:28
5
8
  */
@@ -8,8 +11,10 @@ import Client from './main/client';
8
11
  import Stream from './main/stream';
9
12
  import { IClientConfig, IConfig } from './type';
10
13
  import DeviceManager from './main/deviceManager';
14
+ import { getLayoutItemState, getVideoInfoByRotaion, getLayoutRotateInfo } from './main/helper';
11
15
  declare const xyRTC: {
12
16
  version: string;
17
+ client: any;
13
18
  checkSupportWebRTC: () => boolean;
14
19
  checkSupportShareContent: () => boolean;
15
20
  logger: Logger;
@@ -21,4 +26,5 @@ declare const xyRTC: {
21
26
  render: void;
22
27
  };
23
28
  export default xyRTC;
24
- export { DeviceManager };
29
+ export { Client, Stream, DeviceManager, getLayoutItemState, getVideoInfoByRotaion, getLayoutRotateInfo };
30
+ export * from './type';
@@ -1,15 +1,16 @@
1
1
  /**
2
- * Webrtc Client lib
2
+ * XYLink WebRTC Client Lib
3
3
  *
4
4
  * @authors Luo-jinghui (luojinghui424@gmail.com)
5
5
  * @date 2019-10-23 12:04:44
6
6
  */
7
- import { IClientConfig, ICall, IInvite, IMeetingControl, IRoster, ILayoutRoster, ISpeakerInfo, ILayout, IServers, ILoginExtAccount, ISdkUserInfo, IPublishParams, IThidrCustomLayout, ISubTitle, IInternels, IVideoAudioType, ISahreContentStatus, IVideoRenders } from '../type';
7
+ import { IClientConfig, ICall, IInvite, IMeetingControl, IRoster, ILayoutRoster, ISpeakerInfo, IScreenInfo, IServers, ILoginExtAccount, ISdkUserInfo, IPublishParams, ICustomLayout, ICustomStreamTrack, ISubTitle, IInternels, IVideoAudioType, ISahreContentStatus, IPushType, IMode, IReqList, TCommand, ICustomLayoutObj } from '../type';
8
8
  import Emmitter from '../tools/emmitter';
9
9
  import Socket from '../tools/socket';
10
10
  import Stream from './stream';
11
11
  import Logger from '../tools/logger';
12
12
  import DeviceManager from './deviceManager';
13
+ import LayoutManager from './layoutManager';
13
14
  export default class Client extends Emmitter {
14
15
  logger: Logger;
15
16
  socketTask: Socket;
@@ -22,15 +23,16 @@ export default class Client extends Emmitter {
22
23
  };
23
24
  disconnected: boolean;
24
25
  speakerInfo: ISpeakerInfo;
25
- layout: ILayout[];
26
- pushType: string;
26
+ layoutManager: LayoutManager;
27
+ pushType: IPushType;
27
28
  isAutoBandwidth: boolean;
28
29
  debug: boolean;
29
30
  shareContentStatus: ISahreContentStatus;
30
31
  deviceManager: DeviceManager;
31
32
  localHide: boolean;
33
+ hideId: string;
34
+ config: IClientConfig;
32
35
  private autoMode;
33
- private config;
34
36
  private token;
35
37
  private peer;
36
38
  private servers;
@@ -38,32 +40,25 @@ export default class Client extends Emmitter {
38
40
  private loginInfo;
39
41
  private stream;
40
42
  private meetingControl;
41
- private layoutManager;
42
- private templateMode;
43
43
  private videoTrackList;
44
44
  private audioTrackList;
45
- private screenInfo;
46
- private templateRate;
47
45
  private cacheMeetingControlMessage;
48
46
  private rotationInfo;
49
47
  private clientStatus;
50
48
  private peerConnectionStatus;
51
49
  private customLayoutSeq;
52
- private content;
53
50
  private contentSenderPid;
54
51
  private shareContentTimmer;
55
52
  private streamChange;
56
53
  private streamChangeList;
57
- private outputCustomLayout;
58
54
  private seq;
59
55
  private onhold;
60
56
  private autoSwitchDevice;
61
57
  private audioManagers;
62
- private videoManagers;
63
58
  private errorcode;
64
59
  private clientErrorState;
65
- private localMirror;
66
- private permission;
60
+ private limitResolution;
61
+ private isPermissionDenied;
67
62
  private onDocumentChange;
68
63
  constructor(config: IClientConfig, servers: IServers, logger: Logger);
69
64
  static instance: Client;
@@ -74,12 +69,50 @@ export default class Client extends Emmitter {
74
69
  quality: any;
75
70
  mediagroupid: number;
76
71
  };
72
+ static getMeetingStatus(success: boolean, code?: number, msg?: string): {
73
+ success: boolean;
74
+ data: {
75
+ code: number;
76
+ msg: string;
77
+ };
78
+ } | {
79
+ success: boolean;
80
+ data: {
81
+ code?: undefined;
82
+ msg?: undefined;
83
+ };
84
+ };
85
+ getClientConfig(): IClientConfig;
86
+ getVideoManagers(): import("../type").IVideoRenders;
87
+ getPreviewStreams(): import("../type").IGetMediaStreams | {
88
+ previewStreams: any[];
89
+ };
90
+ getVideoTrackList(): ICustomStreamTrack[];
91
+ getLayoutRosters(): {
92
+ content: ILayoutRoster[];
93
+ people: ILayoutRoster[];
94
+ total: ILayoutRoster[];
95
+ };
96
+ getOriginRosters(): IRoster[];
97
+ getInviteInfo(): IInvite;
98
+ getContentSenderPid(): number;
99
+ getSpeakerInfo(): ISpeakerInfo;
100
+ getLocalHide(): boolean;
101
+ getRotationInfo(): import("../type").IRotationInfoTotalItem[];
102
+ getPeerConnectionStatus(): boolean;
103
+ getOnHold(): boolean;
104
+ getLayoutList(): Map<string, ICustomLayoutObj>;
105
+ getChairmanUri(): string;
77
106
  /**
78
107
  * 切换显示/隐藏 Local 画面
79
108
  */
80
109
  toggleLocal(): Promise<{
81
110
  status: boolean;
82
111
  }>;
112
+ /**
113
+ * 隐身入会互动
114
+ */
115
+ toggleHideId(): Promise<boolean>;
83
116
  /**
84
117
  * 绑定streamId和video ele元素,内部维护状态
85
118
  *
@@ -99,14 +132,15 @@ export default class Client extends Emmitter {
99
132
  *
100
133
  * @param status boolean true:代表自动切换设备
101
134
  */
102
- switchAutoDevice(status?: boolean): void;
103
- switchLayout(): Promise<'SPEAKER' | 'GALLERY'>;
135
+ switchAutoDevice(status?: boolean): Promise<boolean>;
136
+ switchLayout(templateMode: IMode): Promise<IMode>;
104
137
  handleSocketMessage(data: any, resolve: any): void;
105
138
  /**
106
- * 创建呼叫接口
139
+ * 发起会议呼叫,如果返回 true ,代表是否可以继续呼叫;
140
+ *
107
141
  * @param params ICall
108
142
  */
109
- makeCall(params: ICall): Promise<unknown>;
143
+ makeCall(params: ICall): Promise<any>;
110
144
  /**
111
145
  * 开始会议
112
146
  *
@@ -133,35 +167,19 @@ export default class Client extends Emmitter {
133
167
  applyShareContent(): Promise<void>;
134
168
  stopShareContent(): Promise<Boolean>;
135
169
  initTrackEvent(): void;
136
- mergeAudioList(e: RTCTrackEvent): void;
170
+ mergeTrackList(e: RTCTrackEvent): void;
137
171
  /**
138
- * 退会操作,关闭所有服务
172
+ * 挂断会议,销毁资源
139
173
  */
140
- destory(): Promise<Boolean>;
141
- close(reason?: string, code?: string): void;
142
- destroy(): void;
174
+ destroy(): Promise<boolean>;
175
+ close(reason?: string): void;
143
176
  /**
144
177
  * 用户初始登录,获取token方法
145
178
  *
146
179
  * @param { string } userName
147
180
  * @param { string } password
148
- * @param { string } clientId
149
181
  */
150
- loginXYlinkAccount(userName: any, password: any, clientId: any): Promise<{
151
- code: number;
152
- msg: string;
153
- data: {
154
- access_token: any;
155
- };
156
- err: any;
157
- } | {
158
- code: number;
159
- msg: string;
160
- data: {
161
- access_token?: undefined;
162
- };
163
- err: any;
164
- }>;
182
+ loginXYlinkAccount(userName: string, password: string): Promise<Object>;
165
183
  /**
166
184
  * 获取第三方user info & 获取token方法
167
185
  *
@@ -171,23 +189,7 @@ export default class Client extends Emmitter {
171
189
  getExternalLoginInfo(sdkUserInfo: ISdkUserInfo, params: ILoginExtAccount): Promise<{
172
190
  code: number;
173
191
  msg: string;
174
- data: {
175
- userName: string;
176
- password: string;
177
- token: {
178
- access_token: any;
179
- };
180
- };
181
- err: any;
182
- } | {
183
- code: number;
184
- data: {
185
- userName?: undefined;
186
- password?: undefined;
187
- token?: undefined;
188
- };
189
- err: any;
190
- msg: string;
192
+ detail: {};
191
193
  }>;
192
194
  /**
193
195
  * 第三方登录方法
@@ -195,27 +197,8 @@ export default class Client extends Emmitter {
195
197
  * @param { string } userName
196
198
  * @param { string } password
197
199
  */
198
- loginExternalAccount(params: ILoginExtAccount): Promise<{
199
- code: number;
200
- msg: string;
201
- data: {
202
- userName: string;
203
- password: string;
204
- token: {
205
- access_token: any;
206
- };
207
- };
208
- err: any;
209
- } | {
210
- code: number;
211
- data: {
212
- userName?: undefined;
213
- password?: undefined;
214
- token?: undefined;
215
- };
216
- err: any;
217
- msg: string;
218
- }>;
200
+ loginExternalAccount(params: ILoginExtAccount): Promise<Object>;
201
+ getConference(id?: number, sk?: string, token?: string): Promise<any>;
219
202
  fetchErrorCode(securityKey: string): Promise<void>;
220
203
  getErrorCodeByJson(link: string): Promise<any>;
221
204
  videoAudioOperate(type: IVideoAudioType): Promise<IVideoAudioType>;
@@ -223,76 +206,88 @@ export default class Client extends Emmitter {
223
206
  muteVideo(): Promise<IVideoAudioType>;
224
207
  unmuteAudio(): Promise<IVideoAudioType>;
225
208
  unmuteVideo(): Promise<IVideoAudioType>;
226
- onHandUp(): Promise<Object>;
227
- onHandDown(): Promise<Object>;
228
- onMute(): Promise<Object>;
229
- onHand(type: 'handup' | 'handdown' | 'mute', handStatus: boolean): Promise<Object>;
209
+ onHandUp(): Promise<boolean>;
210
+ onHandDown(): Promise<boolean>;
211
+ onMute(): Promise<boolean>;
212
+ onHand(type: 'handup' | 'handdown' | 'mute', handStatus: boolean): Promise<boolean>;
230
213
  getSendSupportedCodec(): Promise<Object>;
231
214
  setPeerConnectionStatus(status: boolean): void;
232
215
  onSetAudioStream: (audioMute: string) => void;
233
216
  onMeetingControlMessage(data: IMeetingControl): void;
234
217
  onSubTitle(data: ISubTitle): void;
235
- createLayout(): void;
236
- getVideoManagers(): IVideoRenders;
237
- private onVideoStatusChange;
238
- setStreams(layoutData: any): any;
239
- private clearInvalidVideoManagers;
240
- private getLayoutItemState;
241
- private getVideoStreamByTrackId;
242
218
  private onPassThroughMessage;
243
219
  switchAutoBandwidth(): boolean;
244
- private sendMeetingStatus;
245
220
  private disconnectInWssError;
246
221
  getSelfRoster: () => import("../type").ISelfRoster;
247
- switchDebug(status: boolean): Promise<Object>;
222
+ switchDebug(status: boolean): Promise<boolean>;
248
223
  /**
249
- * custom模式,第三方调用,sdk内部发送customLayout请求流的消息
224
+ *  0: 90, 1: 180, 2: 360, 3: 720, 4: 1080
225
+ *  0: low, 1: normal, 2: high
226
+
227
+ *  * 视频质量级别
228
+ *  people 720p 时:Low 表示15 fps,Normal和High 表示 30 fps
229
+ *  people 1080p时:Low 表示15 fps,Normal和High 表示 60 fps,(如果解码能力不够60,会被压低为30的)
250
230
  *
251
- * @param customLayout ICustomLayout[] 计算得到的customLayout List数据
231
+ *  content 720p 时:Low 表示5 fps, Normal和High 表示 30 fps
232
+ *  content 1080p时:Low 表示15 fps,Normal和High 表示 30 fps
233
+ *
234
+ * @param reqList
252
235
  */
253
- customLayoutSender(thirdCustomLayout?: IThidrCustomLayout[]): Promise<Object>;
236
+ requestLayout(reqList: IReqList[]): Promise<string>;
237
+ /**
238
+ * 发送customNewLayout请求流的消息
239
+ *
240
+ * @param reqList ICustomLayout[] 计算得到的custom layout list数据
241
+ */
242
+ requestNewLayout(reqList?: any[]): void;
243
+ /**
244
+ * 开始轮询请求 Layout 画面数据
245
+ *
246
+ * @param command 轮询状态,0-开始 1-停止 2-暂停 3-恢复
247
+ * @param interval 轮询间隔时长,单位秒
248
+ * @param reqList 请求 Layout 画面流内容
249
+ * @returns
250
+ */
251
+ requestAutoPollingLayout(command: TCommand, interval: number, reqList: IReqList[]): Promise<boolean>;
254
252
  /**
255
253
  * 应用替换已经更新的的people video track轨道流
254
+ * 如果之前无流,则需重新setStream, replaceTrack
256
255
  */
257
- applyVideoOrAudio(kind: 'video' | 'audio'): void;
258
- private rosterReport;
256
+ applyVideoOrAudio(kind: 'video' | 'audio', isFirst?: boolean): void;
257
+ sendLayoutMessage(): void;
258
+ private sendOrderedRosterListMessage;
259
+ private sendOrderRosterListMessage;
260
+ sendCustomLayoutMessage(): void;
261
+ sendScreenInfoMessage(screenInfo: IScreenInfo): void;
262
+ sendContentRosterMessage(next: IRoster): void;
263
+ sendChairmanRosterMessage(roster: IRoster): void;
264
+ sendSelfRosterMessage(roster: IRoster): void;
265
+ sendTemplateMode(templateMode: IMode): void;
266
+ private sendOperationMessage;
267
+ private sendMeetingStatus;
259
268
  private updateRotationInfo;
260
269
  /**
261
270
  * 发送customLayout请求流的消息
262
271
  *
263
272
  * @param customLayout ICustomLayout[] 计算得到的customLayout List数据
264
273
  */
265
- private sendCustomLayout;
266
- /**
267
- * 计算customLayoutList数据,用来发送给媒体请流使用
268
- *
269
- * @param layout 计算到的成员布局最终数据
270
- */
271
- private customLayoutCalculator;
274
+ sendCustomLayout(customLayout?: ICustomLayout[]): void;
272
275
  sendInternels(internels: IInternels): void;
273
276
  /**
274
- * 通过旋转信息获取在layout中的位置
277
+ * 取消监听事件
275
278
  *
276
- * @param pid peopleId
277
- * @param mediagroupid type
279
+ * @param key string 监听器key值
278
280
  */
279
- private getLayoutIndexByRotateInfo;
280
- /**
281
- * 根据rotationInfo的list数据, 进行rotate数据计算
282
- */
283
- private setLayoutRotate;
284
- private localMirrorRotate;
285
- private calcScreenInfo;
286
- private calcPosition;
281
+ off(key: any): void;
287
282
  private onScreenChangeEvent;
288
283
  private initEvent;
289
284
  private removeEvent;
290
- private sendOperationMessage;
291
285
  /**
292
286
  * 发送wss peopleCapability,通知本地采集能力,用于vom进行分配
293
287
  * @param isSetBandwidth
294
288
  */
295
289
  sendPeopleCapability(): void;
290
+ forceFullScreen(id: string): Promise<unknown>;
296
291
  /**
297
292
  * 发送websocket消息方法
298
293
  *
@@ -300,12 +295,25 @@ export default class Client extends Emmitter {
300
295
  * @param {Boolean} isAutoAdd
301
296
  */
302
297
  sendSocketMessage(data: any, isAutoAdd?: boolean): void;
303
- private verifyMeeting;
298
+ verifyMeeting(params: ICall): Promise<{
299
+ success: boolean;
300
+ data: {};
301
+ }>;
304
302
  /**
305
303
  * 设置扬声器
306
304
  * @param deviceId
307
305
  */
308
306
  setAudioOutputDevice(deviceId: string): void;
307
+ /**
308
+ * 开始巡课
309
+ * @param uriList
310
+ */
311
+ startMonitor(uriList?: string[]): void;
312
+ /**
313
+ * 取消巡课
314
+ * @param uriList
315
+ */
316
+ stopMonitor(uriList?: string[]): void;
309
317
  /**
310
318
  * 初始化DeviceManager事件
311
319
  */
@@ -1,16 +1,22 @@
1
1
  /**
2
- * webrtc device and permission manager
2
+ * XYLink WebRTC Device & Permission Manager Lib
3
3
  *
4
4
  * @summary device and permission manager
5
5
  * @email luojinghui424@gmail.com
6
6
  * @author jinghui-luo、chengfei
7
7
  *
8
8
  * Created at : 2020-11-26 14:41:51
9
- * Last modified : 2021-01-05 11:18:21
9
+ * Last modified : 2022-01-05 22:26:22
10
10
  */
11
11
  import Logger from '../tools/logger';
12
12
  import Emmitter from '../tools/emmitter';
13
- import { ICurrentSelectedDevice, ICurrentPermission } from '../type';
13
+ import { IDeviceList, ISelectedDevice, ICurrentPermission } from '../type/device';
14
+ /**
15
+ * DeviceManager模块,用于管理枚举设备列表、监听设备变动、处理设备权限等功能
16
+ *
17
+ * @class DeviceManager
18
+ * @extends Emmitter 事件发送器
19
+ */
14
20
  declare class DeviceManager extends Emmitter {
15
21
  private navigator;
16
22
  private mediaDevices;
@@ -20,19 +26,24 @@ declare class DeviceManager extends Emmitter {
20
26
  private currentPermission;
21
27
  private permissionCameraStatus;
22
28
  private permissionPhoneStatus;
23
- private logger;
24
- constructor(logger: Logger);
29
+ logger: Logger;
30
+ constructor(logger?: Logger);
25
31
  /**
26
32
  * 获取设备权限数据
27
33
  */
28
34
  getDevicePermission(): ICurrentPermission;
35
+ /**
36
+ * 获取当前设备列表
37
+ * @returns
38
+ */
39
+ getNextDeviceList(): IDeviceList;
29
40
  /**
30
41
  * 设置当前正在使用的设备信息
31
42
  * 1. 此信息可能从stream中获取
32
43
  *
33
44
  * @param devices 设备数据
34
45
  */
35
- setCurrentUsedDevice(devices: ICurrentSelectedDevice): void;
46
+ setCurrentUsedDevice(devices: ISelectedDevice): void;
36
47
  /**
37
48
  * 设置当前正在使用的设备信息
38
49
  * 切换设备时,需重新设置此值,为下次diffDevice 使用
@@ -58,15 +69,12 @@ declare class DeviceManager extends Emmitter {
58
69
  /**
59
70
  * 销毁设备管理器实例
60
71
  */
61
- destory(): void;
72
+ destroy(): void;
62
73
  /**
63
74
  * 获取设备列表数据
64
75
  */
65
- getDevices(): Promise<{
66
- audioInputList: any[];
67
- audioOutputList: any[];
68
- videoInList: any[];
69
- }>;
76
+ getDevices(): Promise<IDeviceList>;
77
+ setPermission(permission: ICurrentPermission): void;
70
78
  /**
71
79
  * 【私有方法】
72
80
  * 向外提供权限信息
@@ -85,17 +93,21 @@ declare class DeviceManager extends Emmitter {
85
93
  *
86
94
  * @param e 回调权限数据
87
95
  */
88
- private handlePermissionStateChanged;
96
+ private handlePermissionCameraStateChanged;
97
+ /**
98
+ * 【私有方法】
99
+ * 监听权限变更
100
+ *
101
+ * @param e 回调权限数据
102
+ */
103
+ private handlePermissionPhoneStateChanged;
89
104
  /**
90
105
  * 获取摄像头和麦克风权限方法,初始化时直接调用
91
106
  *
92
107
  * TODO:兼容方式通过获取devices设备去检测是否授予了权限
93
108
  * TODO:可以通过loopling的形式检测,后续在处理
94
109
  */
95
- getPermission(): Promise<{
96
- camera: PermissionState;
97
- microphone: PermissionState;
98
- }>;
110
+ getPermission(): Promise<ICurrentPermission>;
99
111
  /**
100
112
  * 【私有方法】
101
113
  * 如果有音频设备插入,则选取最新设备
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Common Helper Function Lib
3
+ *
4
+ * @author jinghui-Luo
5
+ * @email luojinghui424@gmail.com
6
+ *
7
+ * Created at : 2021-01-09 14:45:46
8
+ * Last modified : 2021-01-09 17:39:25
9
+ */
10
+ import { ILayout, ICustomLayoutObj, IVideoManagerState, IRotationInfoTotalItem } from '../type';
11
+ export declare const getLayoutItemState: (item: ILayout | ICustomLayoutObj, stream: MediaStream | null, vmState: IVideoManagerState) => "REQUEST" | "MUTE" | "NORMAL" | "AUDIO_TEL" | "AUDIO_ONLY" | "AUDIO_CONTENT";
12
+ /**
13
+ * Get video real display size and roatate of transform infos
14
+ * @param width video real width of reslution
15
+ * @param height video real height of reslution
16
+ * @param containerHeight display video container size
17
+ * @param containerWidth display video container size
18
+ * @param rotate video real ratio
19
+ */
20
+ export declare const getVideoInfoByRotaion: (width: number, height: number, containerHeight: number, containerWidth: number, rotate: number) => {
21
+ realWidth: any;
22
+ realHeight: any;
23
+ realRotate: number;
24
+ };
25
+ /**
26
+ * 通过旋转信息配合画面容器计算应该旋转的角度和宽高
27
+ *
28
+ * @param item rotateInfo 设备旋转item,通过rotate-info接口回调获取
29
+ * @param containerWidth 当前参会者画面容器的宽度
30
+ * @param containerHeight 当前参会者画面容器的高度
31
+ */
32
+ export declare const getLayoutRotateInfo: (item: IRotationInfoTotalItem, containerWidth: number, containerHeight: number) => {};