@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.
@@ -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[];
@@ -68,20 +110,11 @@ export interface IInvite {
68
110
  automute: string;
69
111
  meetingId: string;
70
112
  }
71
- export interface IUserInfo {
72
- access_token: string;
73
- domain: string;
74
- expires_in: number;
75
- openid: string;
76
- refresh_token: string;
77
- scope: string;
78
- token_type: string;
79
- data: any;
80
- }
81
113
  export interface IMeetingControl {
82
114
  callIndex: number;
83
115
  callUri: string;
84
116
  chairmanUri: string;
117
+ contentIsDisabled: boolean;
85
118
  disableMute: boolean;
86
119
  muteOperation: string;
87
120
  role: string;
@@ -102,7 +135,6 @@ export interface IStreamChangeListType {
102
135
  content: IStreamChange[];
103
136
  people: IStreamChange[];
104
137
  }
105
- declare type IDeviceType = 'webrtc' | 'soft' | 'hard' | 'nemono' | 'virtualnemo' | 'nemo' | 'tvbox' | 'h323' | 'record' | 'bruce' | 'tel' | 'pstngw' | 'desk';
106
138
  export interface IRoster {
107
139
  deviceType: IDeviceType;
108
140
  endpointId: string;
@@ -142,6 +174,7 @@ export interface ILayoutRoster {
142
174
  isChairman: boolean;
143
175
  LayoutVideoState: number;
144
176
  MuteReason: number;
177
+ calluri?: string;
145
178
  }
146
179
  export interface IStream {
147
180
  bubbles: boolean;
@@ -184,7 +217,6 @@ export interface IMediaStreamTrack {
184
217
  onunmute: any;
185
218
  readyState: string;
186
219
  }
187
- declare type Direction = 'recvonly' | 'inactive' | 'sendonly' | 'sendrecv';
188
220
  export interface IRTCTransceiver {
189
221
  currentDirection: Direction;
190
222
  direction: Direction;
@@ -197,11 +229,9 @@ export interface ISpeakerInfo {
197
229
  endpointId: string;
198
230
  pid: number;
199
231
  }
200
- export declare type ITemplateModel = 'SPEAKER' | 'GALLERY';
201
- export declare type ILayoutState = 'MUTE' | 'REQUEST' | 'NORMAL' | 'INVALID' | 'AUDIO_TEL' | 'AUDIO_ONLY' | 'AUDIO_CONTENT';
202
232
  export interface ILayout {
203
233
  position: number[];
204
- resolution: number;
234
+ resolution: IResolutionType;
205
235
  roster: IRoster;
206
236
  rotate: any;
207
237
  seat: number;
@@ -217,23 +247,45 @@ export interface ILayout {
217
247
  height: number;
218
248
  };
219
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;
220
277
  }
221
278
  export interface IScreenInfo {
222
279
  width: number;
223
280
  height: number;
224
281
  rateWidth: number;
225
282
  rateHeight: number;
226
- isWidth: boolean;
227
283
  }
228
- export declare type TCustomStream = {
229
- kind: 'video' | 'audio';
230
- };
231
- export declare type IStreamStatus = 'NORMAL' | 'DOMSTRING' | 'INVALID';
232
284
  export interface IStreamObj {
233
285
  stream: MediaStream | null;
234
286
  domStream: TCustomStream[];
235
287
  status: IStreamStatus;
236
- type: 'contentStream' | 'previewStream' | 'pipelineStream' | 'remoteStream';
288
+ type: IStreamObjType;
237
289
  resolution: string;
238
290
  }
239
291
  export interface IStreamError {
@@ -242,10 +294,9 @@ export interface IStreamError {
242
294
  detail: any;
243
295
  }
244
296
  export interface IStreamCurrent {
245
- type: 'NORMAL' | 'SEND_ONLY' | 'FAILED';
297
+ type: IStreamCurrentType;
246
298
  detail: string | IStreamError;
247
299
  }
248
- export declare type IDirection = 'recvonly' | 'sendrecv' | 'sendonly' | 'inactive';
249
300
  export interface IPublishParams {
250
301
  isShareContent: boolean;
251
302
  isShareFile: boolean;
@@ -274,6 +325,7 @@ export interface IRotationInfoItem {
274
325
  }
275
326
  export interface IRotationInfoTotalItem extends IRotationInfoItem {
276
327
  mediagroupid: number;
328
+ id: string;
277
329
  }
278
330
  export interface IRotationInfo {
279
331
  content: IRotationInfoItem[];
@@ -398,47 +450,6 @@ export interface ISetting {
398
450
  outputValue: string;
399
451
  videoInValue: string;
400
452
  }
401
- export interface IDeviceItem {
402
- deviceId: string;
403
- label: string;
404
- }
405
- export interface IDevices {
406
- audioInputList: IDeviceItem[];
407
- audioOutputList: IDeviceItem[];
408
- videoInList: IDeviceItem[];
409
- }
410
- declare type TDevice = {
411
- deviceId: string;
412
- kind: string;
413
- type: string;
414
- direction: 'audioinput' | 'output' | 'input';
415
- label: string;
416
- groupId: string;
417
- };
418
- export declare type IDeviceList = {
419
- audioInputList: TDevice[];
420
- audioOutputList: TDevice[];
421
- videoInList: TDevice[];
422
- };
423
- export declare type TCurrentSelectedDevice = {
424
- deviceId: string;
425
- groupId: string;
426
- label: string;
427
- };
428
- export declare type ICurrentSelectedDevice = {
429
- audioInput: TCurrentSelectedDevice;
430
- videoInput: TCurrentSelectedDevice;
431
- audioOutput: TCurrentSelectedDevice;
432
- };
433
- export declare type IDeviceManagerChangeValue = {
434
- nextDevice: ICurrentSelectedDevice;
435
- detail: IDeviceList;
436
- };
437
- export declare type TPermissionType = 'granted' | 'denied' | 'prompt' | '';
438
- export interface ICurrentPermission {
439
- microphone: TPermissionType;
440
- camera: TPermissionType;
441
- }
442
453
  export interface IPermissionChangeEvent extends Event {
443
454
  target: PermissionStatus;
444
455
  }
@@ -463,19 +474,19 @@ export interface IOutputCustomLayout {
463
474
  quality: number;
464
475
  };
465
476
  }
466
- export declare type IClientErrorState = 'NONE' | 'PUBLISH_ERROR' | 'WS_CLOSE' | 'WS_ERROR';
467
477
  export interface ILayoutParams {
468
478
  rosters: IRoster[];
469
479
  speakerInfo: ISpeakerInfo;
470
480
  layout: ILayout[];
471
- templateMode: ITemplateModel;
481
+ templateMode: ITemplateMode;
472
482
  invite: IInvite;
473
483
  contentSenderPid: number;
474
484
  localHide: boolean;
475
485
  }
476
486
  export declare type ITemplateObj = {
477
487
  position: number[];
478
- resolution: number;
488
+ resolution: IResolutionType;
489
+ zIndex?: number;
479
490
  };
480
491
  export interface ITypeTemplate {
481
492
  [id: string]: ITemplateObj[];
@@ -518,14 +529,22 @@ export interface IDefault {
518
529
  [index: number]: number;
519
530
  };
520
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
+ };
521
540
  }
522
541
  export interface ILoginInfo {
523
- callUri: string;
542
+ callUri?: string;
524
543
  securityKey: string;
525
544
  access_token: string;
526
- refresh_token: string;
545
+ refresh_token?: string;
527
546
  id: number;
528
- displayName: string;
547
+ displayName?: string;
529
548
  }
530
549
  export interface IErrorCodeList {
531
550
  version: string;
@@ -539,8 +558,6 @@ export interface IErrorCodeList {
539
558
  [key: string]: string;
540
559
  };
541
560
  }
542
- export declare type IVideoAudioType = 'muteAudio' | 'muteVideo' | 'unmuteAudio' | 'unmuteVideo';
543
- export declare type IVideoAudioMessageType = 'AUDIO_MUTE' | 'VIDEO_MUTE' | 'AUDIO_UN_MUTE' | 'VIDEO_UN_MUTE';
544
561
  export interface IMUTE_MAP {
545
562
  [type: string]: {
546
563
  type: IVideoAudioMessageType;
@@ -551,10 +568,6 @@ export interface IMeetingStatus {
551
568
  video: IVideoAudioType;
552
569
  audio: IVideoAudioType;
553
570
  }
554
- export declare type ISahreContentStatus = 'ended' | 'starting' | 'pending';
555
- export declare type IStreamTrackStatus = 'ENABLED' | 'MUTE' | 'ENDED';
556
- export declare type IVideoLoadStatus = 'LOAD_START' | 'CANPLAY' | 'ERROR';
557
- export declare type IVideoManagerState = '' | 'CANPLAY' | 'ENDED' | 'REQUEST';
558
571
  export interface IResultCustomLayoutItem {
559
572
  pid: number;
560
573
  resolution: number;
@@ -564,4 +577,25 @@ export interface IResultCustomLayoutItem {
564
577
  export declare type IResultCustomLayout = {
565
578
  customLayout: IResultCustomLayoutItem[];
566
579
  };
567
- export {};
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": "2.0.0",
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
  }