@xylink/xy-rtc-sdk 2.0.0 → 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.
- package/README.MD +56 -22
- package/lib/index.es.js +1 -0
- package/lib/index.js +1 -53
- package/lib/src/action/index.d.ts +6 -1
- package/lib/src/enum/index.d.ts +26 -7
- package/lib/src/index.d.ts +8 -2
- package/lib/src/main/client.d.ts +107 -62
- package/lib/src/main/deviceManager.d.ts +25 -6
- package/lib/src/main/helper.d.ts +32 -0
- package/lib/src/main/layoutManager.d.ts +138 -0
- package/lib/src/main/peer.d.ts +10 -3
- package/lib/src/main/stream.d.ts +51 -14
- package/lib/src/main/videoManager.d.ts +3 -3
- package/lib/src/tools/config.d.ts +1 -1
- package/lib/src/tools/enum.d.ts +3 -0
- package/lib/src/tools/template.d.ts +2 -0
- package/lib/src/tools/utils.d.ts +2 -13
- package/lib/src/type/device.d.ts +77 -0
- package/lib/src/type/index.d.ts +112 -78
- package/lib/src/type/stream.d.ts +36 -0
- package/package.json +32 -30
- package/lib/index.cjs.js +0 -53
- package/lib/src/main/layout.d.ts +0 -45
|
@@ -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;
|
package/lib/src/enum/index.d.ts
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
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;
|
|
8
9
|
export declare const STREAM_ERROR_CODE_MAP: number[];
|
|
9
10
|
export declare const MUTE_MAP: IMUTE_MAP;
|
|
10
11
|
export declare const CONTRAINTS_MAP: {
|
|
@@ -20,7 +21,7 @@ export declare const CONTRAINTS_MAP: {
|
|
|
20
21
|
export declare const BASE_CONTRAINTS: IBASE_CONTRAINTS;
|
|
21
22
|
export declare const CONTENT_BASE_CONTRAINTS: ICONTENT_CONTRAINTS;
|
|
22
23
|
export declare const CONTENT_CONTRAINTS: {
|
|
23
|
-
720: {
|
|
24
|
+
'720': {
|
|
24
25
|
min: {
|
|
25
26
|
frameRate: number;
|
|
26
27
|
width: {
|
|
@@ -55,7 +56,7 @@ export declare const CONTENT_CONTRAINTS: {
|
|
|
55
56
|
logicalSurface: true;
|
|
56
57
|
};
|
|
57
58
|
};
|
|
58
|
-
1080: {
|
|
59
|
+
'1080': {
|
|
59
60
|
min: {
|
|
60
61
|
frameRate: number;
|
|
61
62
|
width: {
|
|
@@ -92,7 +93,7 @@ export declare const CONTENT_CONTRAINTS: {
|
|
|
92
93
|
};
|
|
93
94
|
};
|
|
94
95
|
export declare const PEOPLE_CONTRAINTS: {
|
|
95
|
-
90: {
|
|
96
|
+
'90': {
|
|
96
97
|
min: {
|
|
97
98
|
frameRate: number;
|
|
98
99
|
width: {
|
|
@@ -128,7 +129,7 @@ export declare const PEOPLE_CONTRAINTS: {
|
|
|
128
129
|
resizeMode: "crop-and-scale";
|
|
129
130
|
};
|
|
130
131
|
};
|
|
131
|
-
180: {
|
|
132
|
+
'180': {
|
|
132
133
|
min: {
|
|
133
134
|
frameRate: number;
|
|
134
135
|
width: {
|
|
@@ -164,7 +165,7 @@ export declare const PEOPLE_CONTRAINTS: {
|
|
|
164
165
|
resizeMode: "crop-and-scale";
|
|
165
166
|
};
|
|
166
167
|
};
|
|
167
|
-
360: {
|
|
168
|
+
'360': {
|
|
168
169
|
min: {
|
|
169
170
|
frameRate: number;
|
|
170
171
|
width: {
|
|
@@ -200,7 +201,7 @@ export declare const PEOPLE_CONTRAINTS: {
|
|
|
200
201
|
resizeMode: "crop-and-scale";
|
|
201
202
|
};
|
|
202
203
|
};
|
|
203
|
-
720: {
|
|
204
|
+
'720': {
|
|
204
205
|
min: {
|
|
205
206
|
frameRate: number;
|
|
206
207
|
width: {
|
|
@@ -245,3 +246,21 @@ export declare const NEW_CODE_MAP: {
|
|
|
245
246
|
LOCAL_NET_DISCONNECT: string;
|
|
246
247
|
};
|
|
247
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
|
+
};
|
package/lib/src/index.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
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';
|
package/lib/src/main/client.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
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,
|
|
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
|
-
|
|
26
|
-
pushType:
|
|
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
|
|
66
|
-
private
|
|
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,23 +69,57 @@ 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
|
*
|
|
86
119
|
* @param key endpoinId + mediagroupId 唯一的用户id值
|
|
87
120
|
* @param wrapEle 包裹video组件的元素id,此元素一定要提供宽高信息,内部会基于此宽高信息计算video的旋转信息
|
|
88
121
|
*/
|
|
89
|
-
setVideoRenderer(key: any, wrapEleId: any):
|
|
90
|
-
code: number;
|
|
91
|
-
msg: string;
|
|
92
|
-
detail: {};
|
|
93
|
-
};
|
|
122
|
+
setVideoRenderer(key: any, wrapEleId: any): void;
|
|
94
123
|
/**
|
|
95
124
|
* 绑定streamId和audio ele元素,内部维护状态
|
|
96
125
|
*
|
|
@@ -104,11 +133,7 @@ export default class Client extends Emmitter {
|
|
|
104
133
|
* @param status boolean true:代表自动切换设备
|
|
105
134
|
*/
|
|
106
135
|
switchAutoDevice(status?: boolean): Promise<boolean>;
|
|
107
|
-
|
|
108
|
-
* 切换显示布局模式,默认演讲者模式(SPEAKER)。可切换演讲者模式和画廊模式;
|
|
109
|
-
* 如果想在入会前设置布局方式,那么可以在 createClient 中配置 templateMode 属性即可;
|
|
110
|
-
*/
|
|
111
|
-
switchLayout(): Promise<'SPEAKER' | 'GALLERY'>;
|
|
136
|
+
switchLayout(templateMode: IMode): Promise<IMode>;
|
|
112
137
|
handleSocketMessage(data: any, resolve: any): void;
|
|
113
138
|
/**
|
|
114
139
|
* 发起会议呼叫,如果返回 true ,代表是否可以继续呼叫;
|
|
@@ -140,9 +165,9 @@ export default class Client extends Emmitter {
|
|
|
140
165
|
*/
|
|
141
166
|
sendContentCapablityMessage(stream?: Stream): void;
|
|
142
167
|
applyShareContent(): Promise<void>;
|
|
143
|
-
stopShareContent(): Promise<
|
|
168
|
+
stopShareContent(): Promise<Boolean>;
|
|
144
169
|
initTrackEvent(): void;
|
|
145
|
-
|
|
170
|
+
mergeTrackList(e: RTCTrackEvent): void;
|
|
146
171
|
/**
|
|
147
172
|
* 挂断会议,销毁资源
|
|
148
173
|
*/
|
|
@@ -173,6 +198,7 @@ export default class Client extends Emmitter {
|
|
|
173
198
|
* @param { string } password
|
|
174
199
|
*/
|
|
175
200
|
loginExternalAccount(params: ILoginExtAccount): Promise<Object>;
|
|
201
|
+
getConference(id?: number, sk?: string, token?: string): Promise<any>;
|
|
176
202
|
fetchErrorCode(securityKey: string): Promise<void>;
|
|
177
203
|
getErrorCodeByJson(link: string): Promise<any>;
|
|
178
204
|
videoAudioOperate(type: IVideoAudioType): Promise<IVideoAudioType>;
|
|
@@ -189,43 +215,63 @@ export default class Client extends Emmitter {
|
|
|
189
215
|
onSetAudioStream: (audioMute: string) => void;
|
|
190
216
|
onMeetingControlMessage(data: IMeetingControl): void;
|
|
191
217
|
onSubTitle(data: ISubTitle): void;
|
|
192
|
-
createLayout(): void;
|
|
193
|
-
getVideoManagers(): IVideoRenders;
|
|
194
|
-
private onVideoStatusChange;
|
|
195
|
-
setStreams(layoutData: any): any;
|
|
196
|
-
private clearInvalidVideoManagers;
|
|
197
|
-
private getLayoutItemState;
|
|
198
|
-
private getVideoStreamByTrackId;
|
|
199
218
|
private onPassThroughMessage;
|
|
200
219
|
switchAutoBandwidth(): boolean;
|
|
201
|
-
private sendMeetingStatus;
|
|
202
220
|
private disconnectInWssError;
|
|
203
221
|
getSelfRoster: () => import("../type").ISelfRoster;
|
|
204
222
|
switchDebug(status: boolean): Promise<boolean>;
|
|
205
223
|
/**
|
|
206
|
-
*
|
|
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的)
|
|
207
230
|
*
|
|
208
|
-
*
|
|
231
|
+
* content 720p 时:Low 表示5 fps, Normal和High 表示 30 fps
|
|
232
|
+
* content 1080p时:Low 表示15 fps,Normal和High 表示 30 fps
|
|
233
|
+
*
|
|
234
|
+
* @param reqList
|
|
235
|
+
*/
|
|
236
|
+
requestLayout(reqList: IReqList[]): Promise<string>;
|
|
237
|
+
/**
|
|
238
|
+
* 发送customNewLayout请求流的消息
|
|
239
|
+
*
|
|
240
|
+
* @param reqList ICustomLayout[] 计算得到的custom layout list数据
|
|
209
241
|
*/
|
|
210
|
-
|
|
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>;
|
|
211
252
|
/**
|
|
212
253
|
* 应用替换已经更新的的people video track轨道流
|
|
254
|
+
* 如果之前无流,则需重新setStream, replaceTrack
|
|
213
255
|
*/
|
|
214
|
-
applyVideoOrAudio(kind: 'video' | 'audio'): void;
|
|
215
|
-
|
|
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;
|
|
216
268
|
private updateRotationInfo;
|
|
217
269
|
/**
|
|
218
270
|
* 发送customLayout请求流的消息
|
|
219
271
|
*
|
|
220
272
|
* @param customLayout ICustomLayout[] 计算得到的customLayout List数据
|
|
221
273
|
*/
|
|
222
|
-
|
|
223
|
-
/**
|
|
224
|
-
* 计算customLayoutList数据,用来发送给媒体请流使用
|
|
225
|
-
*
|
|
226
|
-
* @param layout 计算到的成员布局最终数据
|
|
227
|
-
*/
|
|
228
|
-
private customLayoutCalculator;
|
|
274
|
+
sendCustomLayout(customLayout?: ICustomLayout[]): void;
|
|
229
275
|
sendInternels(internels: IInternels): void;
|
|
230
276
|
/**
|
|
231
277
|
* 取消监听事件
|
|
@@ -233,29 +279,15 @@ export default class Client extends Emmitter {
|
|
|
233
279
|
* @param key string 监听器key值
|
|
234
280
|
*/
|
|
235
281
|
off(key: any): void;
|
|
236
|
-
/**
|
|
237
|
-
* 通过旋转信息获取在layout中的位置
|
|
238
|
-
*
|
|
239
|
-
* @param pid peopleId
|
|
240
|
-
* @param mediagroupid type
|
|
241
|
-
*/
|
|
242
|
-
private getLayoutIndexByRotateInfo;
|
|
243
|
-
/**
|
|
244
|
-
* 根据rotationInfo的list数据, 进行rotate数据计算
|
|
245
|
-
*/
|
|
246
|
-
private setLayoutRotate;
|
|
247
|
-
private localMirrorRotate;
|
|
248
|
-
private calcScreenInfo;
|
|
249
|
-
private calcPosition;
|
|
250
282
|
private onScreenChangeEvent;
|
|
251
283
|
private initEvent;
|
|
252
284
|
private removeEvent;
|
|
253
|
-
private sendOperationMessage;
|
|
254
285
|
/**
|
|
255
286
|
* 发送wss peopleCapability,通知本地采集能力,用于vom进行分配
|
|
256
287
|
* @param isSetBandwidth
|
|
257
288
|
*/
|
|
258
289
|
sendPeopleCapability(): void;
|
|
290
|
+
forceFullScreen(id: string): Promise<unknown>;
|
|
259
291
|
/**
|
|
260
292
|
* 发送websocket消息方法
|
|
261
293
|
*
|
|
@@ -263,12 +295,25 @@ export default class Client extends Emmitter {
|
|
|
263
295
|
* @param {Boolean} isAutoAdd
|
|
264
296
|
*/
|
|
265
297
|
sendSocketMessage(data: any, isAutoAdd?: boolean): void;
|
|
266
|
-
|
|
298
|
+
verifyMeeting(params: ICall): Promise<{
|
|
299
|
+
success: boolean;
|
|
300
|
+
data: {};
|
|
301
|
+
}>;
|
|
267
302
|
/**
|
|
268
303
|
* 设置扬声器
|
|
269
304
|
* @param deviceId
|
|
270
305
|
*/
|
|
271
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;
|
|
272
317
|
/**
|
|
273
318
|
* 初始化DeviceManager事件
|
|
274
319
|
*/
|
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
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 :
|
|
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 { IDeviceList,
|
|
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;
|
|
@@ -21,18 +27,23 @@ declare class DeviceManager extends Emmitter {
|
|
|
21
27
|
private permissionCameraStatus;
|
|
22
28
|
private permissionPhoneStatus;
|
|
23
29
|
logger: Logger;
|
|
24
|
-
constructor(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:
|
|
46
|
+
setCurrentUsedDevice(devices: ISelectedDevice): void;
|
|
36
47
|
/**
|
|
37
48
|
* 设置当前正在使用的设备信息
|
|
38
49
|
* 切换设备时,需重新设置此值,为下次diffDevice 使用
|
|
@@ -63,6 +74,7 @@ declare class DeviceManager extends Emmitter {
|
|
|
63
74
|
* 获取设备列表数据
|
|
64
75
|
*/
|
|
65
76
|
getDevices(): Promise<IDeviceList>;
|
|
77
|
+
setPermission(permission: ICurrentPermission): void;
|
|
66
78
|
/**
|
|
67
79
|
* 【私有方法】
|
|
68
80
|
* 向外提供权限信息
|
|
@@ -81,7 +93,14 @@ declare class DeviceManager extends Emmitter {
|
|
|
81
93
|
*
|
|
82
94
|
* @param e 回调权限数据
|
|
83
95
|
*/
|
|
84
|
-
private
|
|
96
|
+
private handlePermissionCameraStateChanged;
|
|
97
|
+
/**
|
|
98
|
+
* 【私有方法】
|
|
99
|
+
* 监听权限变更
|
|
100
|
+
*
|
|
101
|
+
* @param e 回调权限数据
|
|
102
|
+
*/
|
|
103
|
+
private handlePermissionPhoneStateChanged;
|
|
85
104
|
/**
|
|
86
105
|
* 获取摄像头和麦克风权限方法,初始化时直接调用
|
|
87
106
|
*
|
|
@@ -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) => {};
|