@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.
@@ -3,8 +3,47 @@
3
3
  * @authors Luo-jinghui (luojinghui424@gmail.com)
4
4
  * @date 2019-10-23 12:02:33
5
5
  */
6
+ export * from './stream';
7
+ export * from './device';
6
8
  import VideoManager from '../main/videoManager';
7
9
  export declare type IClientLayout = 'AUTO' | 'CUSTOM' | 'auto' | 'custom';
10
+ export declare type IDirection = 'recvonly' | 'sendrecv' | 'sendonly' | 'inactive';
11
+ export declare type ISahreContentStatus = 'ENDED' | 'STARTING' | 'PENDING';
12
+ export declare type IStreamTrackStatus = 'ENABLED' | 'MUTE' | 'ENDED';
13
+ export declare type IVideoLoadStatus = 'LOAD_START' | 'CANPLAY' | 'ERROR';
14
+ export declare type IVideoManagerState = '' | 'CANPLAY' | 'ENDED' | 'REQUEST';
15
+ export declare type Direction = 'recvonly' | 'inactive' | 'sendonly' | 'sendrecv';
16
+ export declare type TPermissionType = 'granted' | 'denied' | 'prompt' | '';
17
+ export declare type IMode = ITemplateMode | IContentTemplateMode;
18
+ export declare type ITemplateMode = 'SPEAKER' | 'GALLERY';
19
+ export declare type IContentTemplateMode = 'MULTI_PIC_CONTENT_HIGH_PRIORITY' | 'MULTI_PIC_ACTIVE_HIGH_PRIORITY' | 'TWO_PIC_PIP' | 'CONTENT_ONLY' | 'TWO_PIC_SYMMETRIC';
20
+ export declare type TCustomStream = {
21
+ kind: 'video' | 'audio';
22
+ };
23
+ export declare type IClientErrorState = 'NONE' | 'PUBLISH_ERROR' | 'WS_CLOSE' | 'WS_ERROR';
24
+ export declare type IPushType = 'ALL' | 'CONTENT';
25
+ export declare type IStreamStatus = 'NORMAL' | 'DOMSTRING' | 'INVALID';
26
+ /**
27
+ * 自定义采集流时产生的状态
28
+ *
29
+ * @value NORMAL 采集正常
30
+ * @value SEND_ONLY 仅发送(无权限、无设备等无流入会情况)
31
+ * @value AUDIO_ONLY 仅采集麦克风流,视频流转仅接收模式
32
+ * @value VIDEO_ONLY 仅采集摄像头流,麦克风转仅接收模式
33
+ * @value FAILED 其他异常,无法入会
34
+ */
35
+ export declare type IStreamCurrentType = 'NORMAL' | 'SEND_ONLY' | 'AUDIO_ONLY' | 'VIDEO_ONLY' | 'FAILED';
36
+ export declare type IStreamObjType = 'contentStream' | 'previewStream' | 'pipelineStream' | 'remoteStream';
37
+ export declare type IVideoAudioType = 'muteAudio' | 'muteVideo' | 'unmuteAudio' | 'unmuteVideo';
38
+ export declare type IResolutionType = 0 | 1 | 2 | 3 | 4 | 5;
39
+ export declare type IQualityType = 0 | 1 | 2;
40
+ export declare type IMediaQualityType = 0 | 100 | 200;
41
+ export declare type IVideoAudioMessageType = 'AUDIO_MUTE' | 'VIDEO_MUTE' | 'AUDIO_UN_MUTE' | 'VIDEO_UN_MUTE';
42
+ export declare type ILayoutState = 'MUTE' | 'REQUEST' | 'NORMAL' | 'INVALID' | 'AUDIO_TEL' | 'AUDIO_ONLY' | 'AUDIO_CONTENT';
43
+ declare type IDeviceType = 'webrtc' | 'soft' | 'hard' | 'nemono' | 'virtualnemo' | 'nemo' | 'tvbox' | 'h323' | 'record' | 'bruce' | 'tel' | 'pstngw' | 'desk';
44
+ export declare type TStateAction = 'click' | 'msgCallback' | 'server' | 'trigger';
45
+ export declare type TEventType = 'callIn' | 'layout' | 'content' | 'audioMute' | 'audioUnmute' | 'videoMute' | 'videoUnmute' | 'udioUnmute' | 'audioMute' | 'subtitle' | string;
46
+ export declare type TCommand = 0 | 1 | 2 | 3;
8
47
  export interface IClientConfig {
9
48
  wssServer?: string;
10
49
  httpServer?: string;
@@ -20,7 +59,10 @@ export interface IClientConfig {
20
59
  localHide?: boolean;
21
60
  localMirror?: boolean;
22
61
  clientId?: string;
23
- templateMode?: ITemplateModel;
62
+ templateMode?: ITemplateMode;
63
+ __hideId?: string;
64
+ __monitorMode?: string;
65
+ isThird?: boolean;
24
66
  }
25
67
  export interface IGetMediaStreams {
26
68
  previewStreams: IStreamObj[];
@@ -31,9 +73,6 @@ export interface IGetMediaStreams {
31
73
  export interface ILoginExtAccount {
32
74
  displayName: string;
33
75
  extId: string;
34
- clientId: string;
35
- clientSecret?: string;
36
- externalUserId?: string;
37
76
  }
38
77
  export interface ISdkUserInfo {
39
78
  userName: string;
@@ -71,20 +110,11 @@ export interface IInvite {
71
110
  automute: string;
72
111
  meetingId: string;
73
112
  }
74
- export interface IUserInfo {
75
- access_token: string;
76
- domain: string;
77
- expires_in: number;
78
- openid: string;
79
- refresh_token: string;
80
- scope: string;
81
- token_type: string;
82
- data: any;
83
- }
84
113
  export interface IMeetingControl {
85
114
  callIndex: number;
86
115
  callUri: string;
87
116
  chairmanUri: string;
117
+ contentIsDisabled: boolean;
88
118
  disableMute: boolean;
89
119
  muteOperation: string;
90
120
  role: string;
@@ -105,7 +135,6 @@ export interface IStreamChangeListType {
105
135
  content: IStreamChange[];
106
136
  people: IStreamChange[];
107
137
  }
108
- declare type IDeviceType = 'webrtc' | 'soft' | 'hard' | 'nemono' | 'virtualnemo' | 'nemo' | 'tvbox' | 'h323' | 'record' | 'bruce' | 'tel' | 'pstngw' | 'desk';
109
138
  export interface IRoster {
110
139
  deviceType: IDeviceType;
111
140
  endpointId: string;
@@ -145,6 +174,7 @@ export interface ILayoutRoster {
145
174
  isChairman: boolean;
146
175
  LayoutVideoState: number;
147
176
  MuteReason: number;
177
+ calluri?: string;
148
178
  }
149
179
  export interface IStream {
150
180
  bubbles: boolean;
@@ -187,7 +217,6 @@ export interface IMediaStreamTrack {
187
217
  onunmute: any;
188
218
  readyState: string;
189
219
  }
190
- declare type Direction = 'recvonly' | 'inactive' | 'sendonly' | 'sendrecv';
191
220
  export interface IRTCTransceiver {
192
221
  currentDirection: Direction;
193
222
  direction: Direction;
@@ -200,11 +229,9 @@ export interface ISpeakerInfo {
200
229
  endpointId: string;
201
230
  pid: number;
202
231
  }
203
- export declare type ITemplateModel = 'SPEAKER' | 'GALLERY';
204
- export declare type ILayoutState = 'MUTE' | 'REQUEST' | 'NORMAL' | 'INVALID' | 'AUDIO_TEL' | 'AUDIO_ONLY' | 'AUDIO_CONTENT';
205
232
  export interface ILayout {
206
233
  position: number[];
207
- resolution: number;
234
+ resolution: IResolutionType;
208
235
  roster: IRoster;
209
236
  rotate: any;
210
237
  seat: number;
@@ -220,23 +247,45 @@ export interface ILayout {
220
247
  height: number;
221
248
  };
222
249
  deal?: boolean;
250
+ zIndex?: number;
251
+ }
252
+ export interface ICustomLayoutObj {
253
+ resolution: IResolutionType;
254
+ roster: IRoster;
255
+ rotate: any;
256
+ state: ILayoutState;
257
+ quality: 0 | 100 | 200;
258
+ deal?: boolean;
259
+ position?: number[];
260
+ positionStyle?: {
261
+ left?: string;
262
+ top?: string;
263
+ width?: string;
264
+ height?: string;
265
+ };
266
+ positionInfo?: {
267
+ width?: number;
268
+ height?: number;
269
+ };
270
+ zIndex?: number;
271
+ }
272
+ export interface IReqObject {
273
+ resolution: IResolutionType;
274
+ quality: IQualityType;
275
+ callUri: string;
276
+ isContent: boolean;
223
277
  }
224
278
  export interface IScreenInfo {
225
279
  width: number;
226
280
  height: number;
227
281
  rateWidth: number;
228
282
  rateHeight: number;
229
- isWidth: boolean;
230
283
  }
231
- export declare type TCustomStream = {
232
- kind: 'video' | 'audio';
233
- };
234
- export declare type IStreamStatus = 'NORMAL' | 'DOMSTRING' | 'INVALID';
235
284
  export interface IStreamObj {
236
285
  stream: MediaStream | null;
237
286
  domStream: TCustomStream[];
238
287
  status: IStreamStatus;
239
- type: 'contentStream' | 'previewStream' | 'pipelineStream' | 'remoteStream';
288
+ type: IStreamObjType;
240
289
  resolution: string;
241
290
  }
242
291
  export interface IStreamError {
@@ -245,10 +294,9 @@ export interface IStreamError {
245
294
  detail: any;
246
295
  }
247
296
  export interface IStreamCurrent {
248
- type: 'NORMAL' | 'SEND_ONLY' | 'FAILED';
297
+ type: IStreamCurrentType;
249
298
  detail: string | IStreamError;
250
299
  }
251
- export declare type IDirection = 'recvonly' | 'sendrecv' | 'sendonly' | 'inactive';
252
300
  export interface IPublishParams {
253
301
  isShareContent: boolean;
254
302
  isShareFile: boolean;
@@ -277,6 +325,7 @@ export interface IRotationInfoItem {
277
325
  }
278
326
  export interface IRotationInfoTotalItem extends IRotationInfoItem {
279
327
  mediagroupid: number;
328
+ id: string;
280
329
  }
281
330
  export interface IRotationInfo {
282
331
  content: IRotationInfoItem[];
@@ -401,47 +450,6 @@ export interface ISetting {
401
450
  outputValue: string;
402
451
  videoInValue: string;
403
452
  }
404
- export interface IDeviceItem {
405
- deviceId: string;
406
- label: string;
407
- }
408
- export interface IDevices {
409
- audioInputList: IDeviceItem[];
410
- audioOutputList: IDeviceItem[];
411
- videoInList: IDeviceItem[];
412
- }
413
- declare type TDevice = {
414
- deviceId: string;
415
- kind: string;
416
- type: string;
417
- direction: 'audioinput' | 'output' | 'input';
418
- label: string;
419
- groupId: string;
420
- };
421
- export declare type IDeviceList = {
422
- audioInputList: TDevice[];
423
- audioOutputList: TDevice[];
424
- videoInList: TDevice[];
425
- };
426
- export declare type TCurrentSelectedDevice = {
427
- deviceId: string;
428
- groupId: string;
429
- label: string;
430
- };
431
- export declare type ICurrentSelectedDevice = {
432
- audioInput: TCurrentSelectedDevice;
433
- videoInput: TCurrentSelectedDevice;
434
- audioOutput: TCurrentSelectedDevice;
435
- };
436
- export declare type IDeviceManagerChangeValue = {
437
- nextDevice: ICurrentSelectedDevice;
438
- detail: IDeviceList;
439
- };
440
- export declare type TPermissionType = 'granted' | 'denied' | 'prompt' | '';
441
- export interface ICurrentPermission {
442
- microphone: TPermissionType;
443
- camera: TPermissionType;
444
- }
445
453
  export interface IPermissionChangeEvent extends Event {
446
454
  target: PermissionStatus;
447
455
  }
@@ -466,19 +474,19 @@ export interface IOutputCustomLayout {
466
474
  quality: number;
467
475
  };
468
476
  }
469
- export declare type IClientErrorState = 'NONE' | 'PUBLISH_ERROR' | 'WS_CLOSE' | 'WS_ERROR';
470
477
  export interface ILayoutParams {
471
478
  rosters: IRoster[];
472
479
  speakerInfo: ISpeakerInfo;
473
480
  layout: ILayout[];
474
- templateMode: ITemplateModel;
481
+ templateMode: ITemplateMode;
475
482
  invite: IInvite;
476
483
  contentSenderPid: number;
477
484
  localHide: boolean;
478
485
  }
479
486
  export declare type ITemplateObj = {
480
487
  position: number[];
481
- resolution: number;
488
+ resolution: IResolutionType;
489
+ zIndex?: number;
482
490
  };
483
491
  export interface ITypeTemplate {
484
492
  [id: string]: ITemplateObj[];
@@ -521,14 +529,22 @@ export interface IDefault {
521
529
  [index: number]: number;
522
530
  };
523
531
  VIDE_BANDWIDTH_BIT: 1000;
532
+ LOGIN_INFO: {
533
+ callUri: string;
534
+ securityKey: string;
535
+ access_token: string;
536
+ refresh_token: string;
537
+ id: 0;
538
+ displayName: string;
539
+ };
524
540
  }
525
541
  export interface ILoginInfo {
526
- callUri: string;
542
+ callUri?: string;
527
543
  securityKey: string;
528
544
  access_token: string;
529
- refresh_token: string;
545
+ refresh_token?: string;
530
546
  id: number;
531
- displayName: string;
547
+ displayName?: string;
532
548
  }
533
549
  export interface IErrorCodeList {
534
550
  version: string;
@@ -542,8 +558,6 @@ export interface IErrorCodeList {
542
558
  [key: string]: string;
543
559
  };
544
560
  }
545
- export declare type IVideoAudioType = 'muteAudio' | 'muteVideo' | 'unmuteAudio' | 'unmuteVideo';
546
- export declare type IVideoAudioMessageType = 'AUDIO_MUTE' | 'VIDEO_MUTE' | 'AUDIO_UN_MUTE' | 'VIDEO_UN_MUTE';
547
561
  export interface IMUTE_MAP {
548
562
  [type: string]: {
549
563
  type: IVideoAudioMessageType;
@@ -554,8 +568,34 @@ export interface IMeetingStatus {
554
568
  video: IVideoAudioType;
555
569
  audio: IVideoAudioType;
556
570
  }
557
- export declare type ISahreContentStatus = 'ended' | 'starting' | 'pending';
558
- export declare type IStreamTrackStatus = 'ENABLED' | 'MUTE' | 'ENDED';
559
- export declare type IVideoLoadStatus = 'LOAD_START' | 'CANPLAY' | 'ERROR';
560
- export declare type IVideoManagerState = '' | 'CANPLAY' | 'ENDED' | 'REQUEST';
561
- export {};
571
+ export interface IResultCustomLayoutItem {
572
+ pid: number;
573
+ resolution: number;
574
+ mediagroupid: number;
575
+ quality: number;
576
+ }
577
+ export declare type IResultCustomLayout = {
578
+ customLayout: IResultCustomLayoutItem[];
579
+ };
580
+ export declare type IReqList = {
581
+ isContent: boolean;
582
+ callUri: string;
583
+ resolution: IResolutionType;
584
+ quality: IQualityType;
585
+ };
586
+ export interface IMeetingInfo {
587
+ meetingId: string;
588
+ callUri: string;
589
+ }
590
+ /**
591
+ * SDK对外回调错误消息
592
+ *
593
+ * @property { string } code 错误码
594
+ * @property { string } msg 错误信息
595
+ * @property { unknwn } detail 数据详情
596
+ */
597
+ export interface IStatus {
598
+ code: string;
599
+ msg: string;
600
+ detail?: any;
601
+ }
@@ -0,0 +1,36 @@
1
+ /**
2
+ * 媒体通知Web对视频流的分辨率、带宽信息、帧率进行限制
3
+ *
4
+ * @property { string } streamId 指定streamId进行限制
5
+ * @property { number } resolution 暂时未使用
6
+ * @property { number } bandwidth 限制streamId最大发送带宽
7
+ * @property { number } frameRate 限制streamId最大发送帧率(暂时未启用,存在帧率动态设置后,帧率起不来问题)
8
+ */
9
+ export interface IStreamChange {
10
+ streamId: string;
11
+ resolution: number;
12
+ bandwidth: number;
13
+ frameRate: number;
14
+ }
15
+ /**
16
+ * StreamChange消息内容
17
+ *
18
+ * @property { string } type 消息类型
19
+ * @property { IStreamChange[] } streamChangeInfo 流限制配置信息
20
+ * @property { number } mediagroupid 是否是content或者people画面
21
+ */
22
+ export interface IStreamChangeType {
23
+ type: string;
24
+ streamChangeInfo: IStreamChange[];
25
+ mediagroupid: number;
26
+ }
27
+ /**
28
+ * 缓存content和people的StreamChange配置数据
29
+ *
30
+ * @property { IStreamChange[] } content content的streamchange数据
31
+ * @property { IStreamChange[] } people content的streamchange数据
32
+ */
33
+ export interface IStreamChangeListType {
34
+ content: IStreamChange[];
35
+ people: IStreamChange[];
36
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xylink/xy-rtc-sdk",
3
- "version": "1.4.1-beta.22",
3
+ "version": "2.0.1-1",
4
4
  "description": "XYRTC SDK(小鱼易连web音视频 sdk)",
5
5
  "keywords": [
6
6
  "webrtc",
@@ -9,15 +9,18 @@
9
9
  "xyrtc sdk"
10
10
  ],
11
11
  "main": "./lib/index.js",
12
- "types": "./lib/index.d.ts",
12
+ "types": "./lib/src/index.d.ts",
13
13
  "scripts": {
14
- "start": "NODE_ENV=development webpack-dev-server --mode development",
14
+ "start": "vite",
15
+ "dev": "vite",
16
+ "build:demo": "tsc && vite build",
17
+ "preview": "vite preview",
15
18
  "build-watch": "rollup -c -w",
16
19
  "build": "NODE_ENV=production rollup -c",
17
- "build:demo": "NODE_ENV=production webpack --mode production",
18
20
  "test": "jest",
19
21
  "version:beta": "npm version prerelease --preid=beta",
20
- "publish:beta": "npm publish --tag beta --access public"
22
+ "publish:beta": "npm publish --tag beta --access public",
23
+ "xytools": "xytools"
21
24
  },
22
25
  "author": "jinghui-Luo",
23
26
  "email": "luojinghui424@gmail.com",
@@ -35,10 +38,11 @@
35
38
  "@babel/preset-typescript": "^7.7.4",
36
39
  "@rollup/plugin-node-resolve": "^7.0.0",
37
40
  "@rollup/plugin-replace": "^2.3.0",
41
+ "@types/react": "^17.0.3",
38
42
  "@typescript-eslint/eslint-plugin": "^2.9.0",
39
43
  "@typescript-eslint/parser": "^2.9.0",
40
- "ali-oss-folder": "^1.0.5",
41
- "antd": "^4.6.2",
44
+ "@vitejs/plugin-react-refresh": "^1.3.2",
45
+ "antd": "4.6.2",
42
46
  "axios": "^0.19.1",
43
47
  "babel-loader": "^8.0.6",
44
48
  "babel-plugin-import": "^1.12.2",
@@ -47,28 +51,22 @@
47
51
  "babel-preset-es2015": "^6.24.1",
48
52
  "babel-preset-react": "^6.24.1",
49
53
  "babel-preset-react-app": "^9.0.2",
50
- "clean-webpack-plugin": "^3.0.0",
51
54
  "clone-deep": "^4.0.1",
52
55
  "core-js": "^3.6.5",
53
- "css-loader": "^3.2.0",
54
- "css-modules-typescript-loader": "^3.0.1",
55
56
  "downloadjs": "^1.4.7",
56
57
  "eslint": "^6.7.1",
57
58
  "eslint-config-alloy": "^3.4.0",
58
- "file-loader": "4.3.0",
59
- "html-loader": "^0.5.5",
60
- "html-webpack-plugin": "^3.2.0",
59
+ "husky": "^6.0.0",
61
60
  "jest": "^25.1.0",
62
61
  "jszip": "^3.5.0",
63
62
  "less": "^3.10.3",
64
- "less-loader": "^5.0.0",
65
- "mini-css-extract-plugin": "^0.8.0",
66
- "node-sass": "npm:sass",
63
+ "lint-staged": "^10.5.4",
67
64
  "prettier": "^1.19.1",
68
65
  "react": "^16.10.2",
69
66
  "react-dom": "^16.10.2",
70
- "rollup": "^1.27.5",
67
+ "rollup": "^2.44.0",
71
68
  "rollup-plugin-babel": "^4.3.3",
69
+ "rollup-plugin-cleanup": "^3.2.1",
72
70
  "rollup-plugin-clear": "^2.0.7",
73
71
  "rollup-plugin-commonjs": "^10.1.0",
74
72
  "rollup-plugin-json": "^4.0.0",
@@ -76,28 +74,32 @@
76
74
  "rollup-plugin-terser": "^5.1.2",
77
75
  "rollup-plugin-typescript": "^1.0.1",
78
76
  "rollup-plugin-typescript2": "^0.25.2",
79
- "sass-loader": "^8.0.0",
80
- "string-replace-loader": "^2.2.0",
81
- "style-loader": "^1.0.0",
82
- "terser-webpack-plugin": "^2.1.3",
83
- "ts-loader": "^6.2.0",
84
- "tslib": "^1.10.0",
77
+ "sass": "^1.32.10",
85
78
  "typescript": "^3.7.2",
86
- "typings-for-css-modules-loader": "^1.7.0",
87
- "url-loader": "^2.2.0",
79
+ "validate-commit-msg": "^2.14.0",
88
80
  "vconsole": "^3.3.4",
89
- "webpack": "^4.41.1",
90
- "webpack-cli": "^3.3.9",
91
- "webpack-dev-server": "^3.8.2"
81
+ "vite": "^2.1.5",
82
+ "vite-plugin-imp": "^2.0.7",
83
+ "vite-plugin-importer": "^0.2.1",
84
+ "xytools": "1.5.2-beta.4"
92
85
  },
93
86
  "dependencies": {
87
+ "crypto-browserify": "^3.12.0",
94
88
  "crypto-js": "^4.0.0",
95
89
  "dexie": "^2.0.4",
96
90
  "dexie-export-import": "^1.0.0-rc.1",
97
91
  "qs": "^6.9.4",
98
92
  "uuid": "^7.0.2"
99
93
  },
100
- "resolution": {
101
- "node-sass": "npm:sass"
94
+ "husky": {
95
+ "hooks": {
96
+ "pre-commit": "lint-staged",
97
+ "commit-msg": "validate-commit-msg"
98
+ }
99
+ },
100
+ "lint-staged": {
101
+ "*.{js,jsx,json,ts,tsx,scss,sass,css,md}": [
102
+ "prettier --write"
103
+ ]
102
104
  }
103
105
  }