@xylink/xy-rtc-sdk 2.1.2-beta.7 → 2.1.2

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.
@@ -225,6 +225,12 @@ declare class Action {
225
225
  * @returns
226
226
  */
227
227
  getWebRxBandwidth(userId: number): Promise<any>;
228
+ /**
229
+ * 刷新Token
230
+ *
231
+ * @returns
232
+ */
233
+ refreshToken(refresh_token: string): Promise<any>;
228
234
  }
229
235
  declare const _default: Action;
230
236
  export default _default;
@@ -113,3 +113,4 @@ export declare const CONTENT_CONTRAINTS: {
113
113
  */
114
114
  export declare const PEOPLE_CONTRAINTS: any;
115
115
  export declare const RESOLUTION_MAP: Record<string, number>;
116
+ export declare const MIN_BANDWIDTH_MAP: Record<string, number>;
@@ -72,6 +72,7 @@ export default class Client extends Emmitter {
72
72
  private recordState;
73
73
  private qualityManager;
74
74
  private isShareContent;
75
+ private isSubscribeTranslation;
75
76
  private onDocumentChange;
76
77
  constructor(config: IClientConfig, servers: IServers, logger: Logger);
77
78
  static instance: Client;
@@ -680,6 +681,12 @@ export default class Client extends Emmitter {
680
681
  * @param { boolean } isLog 是否写入日志
681
682
  */
682
683
  sendSocketMessage(data: any, isAutoAdd?: boolean, isLog?: boolean): void;
684
+ /**
685
+ * 获取用户、会议室基本信息
686
+ *
687
+ * @param { ICall } params
688
+ * @returns
689
+ */
683
690
  private getBasicInfo;
684
691
  /**
685
692
  * 校验会议室号
@@ -689,6 +696,10 @@ export default class Client extends Emmitter {
689
696
  * @returns { Promise<{success: boolean; data: any;}> } 是否通过校验
690
697
  */
691
698
  private verifyMeeting;
699
+ /**
700
+ * 刷新Token
701
+ */
702
+ refreshToken(refresh_token: string): Promise<any>;
692
703
  /**
693
704
  * 设置扬声器
694
705
  *
@@ -19,7 +19,6 @@ import { IDeviceList, ISelectedDevice, ICurrentPermission } from '../type';
19
19
  */
20
20
  declare class DeviceManager extends Emmitter {
21
21
  private navigator;
22
- private mediaDevices;
23
22
  private currentDeviceList;
24
23
  private nextDeviceList;
25
24
  private currentUsedDevice;
@@ -43,7 +42,7 @@ declare class DeviceManager extends Emmitter {
43
42
  *
44
43
  * @param devices 设备数据
45
44
  */
46
- setCurrentUsedDevice(devices: ISelectedDevice): void;
45
+ setCurrentUsedDevice(currentDevice: ISelectedDevice): Promise<void>;
47
46
  /**
48
47
  * 设置当前正在使用的设备信息
49
48
  * 切换设备时,需重新设置此值,为下次diffDevice 使用
@@ -32,6 +32,7 @@ export default class Peer {
32
32
  private senderInterval;
33
33
  private isResendContentOffer;
34
34
  private isRestartIceConnection;
35
+ private isFirstConnected;
35
36
  constructor(client: Client, stream: Stream);
36
37
  getInternels(): IInternels;
37
38
  /**
@@ -135,6 +136,7 @@ export default class Peer {
135
136
  * 关闭PeerConnection连接、销毁状态
136
137
  */
137
138
  close(): void;
139
+ setRestartIceConnection(isRestartIceConnection?: boolean): void;
138
140
  /**
139
141
  * add Track for stream, default push all
140
142
  *
@@ -184,6 +186,13 @@ export default class Peer {
184
186
  * @private
185
187
  */
186
188
  private calcMeetingStats;
189
+ /**
190
+ * 过滤远端音频中没有带宽或者没有音量的数据
191
+ *
192
+ * @param { IInternels } internels
193
+ * @returns
194
+ */
195
+ private filterInternels;
187
196
  /**
188
197
  * 计算丢包率
189
198
  *
@@ -261,6 +270,13 @@ export default class Peer {
261
270
  * @returns { ISender } 自定义统计数据内容
262
271
  */
263
272
  private getSenderStatus;
273
+ /**
274
+ * 计算音量值, 显示0-100
275
+ *
276
+ * @param { number } audioLevel
277
+ * @returns
278
+ */
279
+ private calcAudioLevel;
264
280
  /**
265
281
  * 获取receiver的数据
266
282
  *
@@ -206,8 +206,8 @@ export default class Stream extends Emmitter {
206
206
  */
207
207
  createElectronContentStream(selectedSourceId: string): Promise<IStreamObj[]>;
208
208
  getPreviewStream(isVideo?: boolean, isAudio?: boolean, params?: {
209
- video: {};
210
- audio: {};
209
+ video: any;
210
+ audio: any;
211
211
  }): Promise<MediaStream>;
212
212
  private getUserMedia;
213
213
  private handleCloseShareContentEvent;
@@ -5,7 +5,7 @@
5
5
  * @author jinghui-Luo
6
6
  *
7
7
  * Created at : 2020-12-18 16:54:15
8
- * Last modified : 2022-06-09 17:42:49
8
+ * Last modified : 2022-08-31 20:10:23
9
9
  */
10
10
  import Logger from '../tools/logger';
11
11
  declare class VideoManager {
@@ -4,7 +4,7 @@
4
4
  * @authors Luo-jinghui (luojinghui424@gmail.com)
5
5
  * @date 2019-10-24 14:06:05
6
6
  */
7
- export declare const version = "2.1.2-beta.7 - build on 2022-08-01 17:25";
7
+ export declare const version = "2.1.2 - build on 2022-09-20 14:31";
8
8
  export declare const proxy: {
9
9
  wssHost: string;
10
10
  restHost: string;
@@ -10,6 +10,7 @@ declare class DB {
10
10
  dbName: string;
11
11
  tableCount: number;
12
12
  tableName: string;
13
+ maxTableCount: number;
13
14
  constructor(tableCount?: number, tableName?: string, dbName?: string);
14
15
  /**
15
16
  * 表 添加数据
@@ -3,17 +3,43 @@
3
3
  * @authors Luo-jinghui (luojinghui424@gmail.com)
4
4
  * @date 2019-10-22 11:11:55
5
5
  */
6
+ interface ISupportFeature {
7
+ isSupportRTC: boolean;
8
+ isSupportAddtrack: boolean;
9
+ isSupportAddTransceiver: boolean;
10
+ isSupportReplaceTrack: boolean;
11
+ isApplyConstraints: boolean;
12
+ isSupportSetStreams: boolean;
13
+ }
14
+ interface ISupportTest {
15
+ isSupportPeer: boolean;
16
+ isSupportAddtrack: boolean;
17
+ isSupportAddTransceiver: boolean;
18
+ isSupportReplaceTrack: boolean;
19
+ isApplyConstraints: boolean;
20
+ isSupportSetStreams: boolean;
21
+ }
6
22
  export declare const detect: {
7
23
  isMinBrowser: () => boolean;
8
24
  isMobile: () => boolean;
9
25
  isFirefox: () => boolean;
10
26
  isSupportReauthorize: () => boolean;
11
27
  isSupportAppendTrack: () => boolean;
12
- isSupportRTC: () => boolean;
13
- isSupportPeerCB: () => boolean;
28
+ isSupportUserMedia: () => boolean;
29
+ isSupportRTC: (videoCapture?: MediaStream) => Promise<ISupportFeature>;
30
+ isSupportPeerCB: (videoCapture?: MediaStream) => Promise<ISupportTest>;
14
31
  isSupportWebsocket: () => boolean;
15
32
  isSupportMedia: () => boolean;
16
33
  isSupportH264: () => Promise<boolean>;
17
34
  osVersion: () => string;
35
+ getNetWork: () => {
36
+ type: any;
37
+ downlink: any;
38
+ effectiveType: any;
39
+ rtt: any;
40
+ downlinkMax: any;
41
+ saveData: any;
42
+ } | null;
18
43
  };
19
44
  export declare const isFirefox: boolean;
45
+ export {};
@@ -30,7 +30,10 @@ declare class HttpClient {
30
30
  private clientSecret;
31
31
  private retryCount;
32
32
  constructor(commonOption: IAxiosRequestConfig);
33
- refreshToken(baseURL?: string): Promise<any>;
33
+ refreshToken({ baseURL, refresh_token }: {
34
+ baseURL?: string | undefined;
35
+ refresh_token?: string | undefined;
36
+ }): Promise<any>;
34
37
  setLogger(logger: Logger): void;
35
38
  setBaseUrl(url: string): void;
36
39
  setClientInfo({ clientId, clientSecret }: {
@@ -1,3 +1,8 @@
1
+ /**
2
+ * 关闭视频流
3
+ *
4
+ * @param { MediaStream } stream
5
+ */
1
6
  declare const closePreviewStream: (stream: MediaStream) => Promise<void>;
2
7
  declare const setOutputAudioDevice: (element: any, outputValue: string) => void;
3
8
  export { closePreviewStream, setOutputAudioDevice };
@@ -27,6 +27,8 @@ declare class Socket {
27
27
  private isClose;
28
28
  private logger;
29
29
  private client;
30
+ private reconnectOffset;
31
+ private reconnectTimer;
30
32
  constructor(options: socketOptions, client: any);
31
33
  connect(isReconnect?: boolean): void;
32
34
  addEvent(): void;
@@ -36,10 +38,11 @@ declare class Socket {
36
38
  onCloseSocket: (e: CloseEvent) => void;
37
39
  onErrorSocket: (e: any) => void;
38
40
  sendHeartBeat(): void;
39
- creatTimeout(): void;
41
+ clearTimeout(): void;
40
42
  emit(type: string, data: any): void;
41
43
  clearPangTimer(): void;
42
44
  clearBeatTimer(): void;
45
+ clearReconnectTimer(): void;
43
46
  reset(): void;
44
47
  on(type: string, fn: any): void;
45
48
  close(isReconnect?: boolean): void;
@@ -23,8 +23,12 @@ export interface ICheckSystemRequirements {
23
23
  detail: {
24
24
  isSupportRTC: boolean;
25
25
  isSupportWebsocket: boolean;
26
- isSupportH264: boolean;
27
26
  isSupportBrowser: boolean;
27
+ isSupportMobileBrowser: boolean;
28
+ isSupportH264: boolean;
29
+ isSupportAddTransceiver: boolean;
30
+ isSupportAddtrack: boolean;
31
+ isSupportUserMedia: boolean;
28
32
  };
29
33
  }
30
34
  /**
@@ -361,11 +361,15 @@ export interface ISender {
361
361
  * @property { ConstrainDouble } frameRate 帧率配置
362
362
  * @property { number } aspectRatio 视频比例
363
363
  * @property { 'crop-and-scale' } resizeMode 裁剪模式,此处使用裁剪比例模式,以满足分辨率要求;
364
+ * @property { number } width 采集分辨率-width
365
+ * @property { number } height 采集分辨率-height
364
366
  */
365
367
  export interface IBASE_CONTRAINTS {
366
368
  frameRate?: ConstrainDouble;
367
369
  aspectRatio: number;
368
370
  resizeMode: 'crop-and-scale';
371
+ width?: number;
372
+ height?: number;
369
373
  }
370
374
  /**
371
375
  * 初始化视频约束设置
package/package.json CHANGED
@@ -1,130 +1,130 @@
1
- {
2
- "name": "@xylink/xy-rtc-sdk",
3
- "version": "2.1.2-beta.7",
4
- "description": "XYRTC SDK(小鱼易连web音视频 sdk)",
5
- "keywords": [
6
- "webrtc",
7
- "xylink",
8
- "xyrtc",
9
- "xyrtc sdk"
10
- ],
11
- "main": "lib/index.js",
12
- "types": "lib/src/index.d.ts",
13
- "scripts": {
14
- "start": "vite",
15
- "dev": "vite",
16
- "build:demo": "tsc && vite build",
17
- "preview": "vite preview",
18
- "build-watch": "rollup -c -w",
19
- "build": "NODE_ENV=production rollup -c",
20
- "test": "jest",
21
- "version:beta": "npm version prerelease --preid=beta",
22
- "publish:beta": "npm publish --tag beta --access public",
23
- "xytools": "xytools"
24
- },
25
- "author": "jinghui-Luo",
26
- "email": "luojinghui424@gmail.com",
27
- "bugs": {
28
- "url": "https://github.com/xylink-com/xylink-rtc-demo/issues",
29
- "email": "luojinghui424@gmail.com"
30
- },
31
- "devDependencies": {
32
- "@babel/core": "^7.7.4",
33
- "@babel/plugin-proposal-class-properties": "^7.7.4",
34
- "@babel/plugin-syntax-dynamic-import": "^7.7.4",
35
- "@babel/plugin-transform-typescript": "^7.7.4",
36
- "@babel/preset-env": "^7.7.4",
37
- "@babel/preset-react": "^7.6.3",
38
- "@babel/preset-typescript": "^7.7.4",
39
- "@rollup/plugin-node-resolve": "^7.0.0",
40
- "@rollup/plugin-replace": "^2.3.0",
41
- "@types/clone-deep": "^4.0.1",
42
- "@types/crypto-js": "^4.0.1",
43
- "@types/downloadjs": "^1.4.2",
44
- "@types/react": "^17.0.3",
45
- "@types/react-dom": "^17.0.6",
46
- "@types/uuid": "^8.3.0",
47
- "@typescript-eslint/eslint-plugin": "^2.9.0",
48
- "@typescript-eslint/parser": "^2.9.0",
49
- "@vitejs/plugin-react-refresh": "^1.3.2",
50
- "antd": "4.10.1",
51
- "axios": "^0.19.1",
52
- "babel-loader": "^8.0.6",
53
- "babel-plugin-import": "^1.12.2",
54
- "babel-polyfill": "^6.26.0",
55
- "babel-preset-env": "^1.7.0",
56
- "babel-preset-es2015": "^6.24.1",
57
- "babel-preset-react": "^6.24.1",
58
- "babel-preset-react-app": "^9.0.2",
59
- "clone-deep": "^4.0.1",
60
- "core-js": "^3.6.5",
61
- "downloadjs": "^1.4.7",
62
- "eslint": "^6.7.1",
63
- "eslint-config-alloy": "^3.4.0",
64
- "husky": "^4.3.8",
65
- "jest": "^25.1.0",
66
- "jszip": "^3.5.0",
67
- "less": "^3.10.3",
68
- "lint-staged": "^10.5.4",
69
- "prettier": "^1.19.1",
70
- "react": "^16.10.2",
71
- "react-dom": "^16.10.2",
72
- "rollup": "^2.44.0",
73
- "rollup-plugin-babel": "^4.3.3",
74
- "rollup-plugin-cleanup": "^3.2.1",
75
- "rollup-plugin-clear": "^2.0.7",
76
- "rollup-plugin-commonjs": "^10.1.0",
77
- "rollup-plugin-json": "^4.0.0",
78
- "rollup-plugin-sourcemaps": "^0.4.2",
79
- "rollup-plugin-terser": "^5.1.2",
80
- "rollup-plugin-typescript2": "^0.25.2",
81
- "sass": "^1.32.10",
82
- "typescript": "^4.3.2",
83
- "validate-commit-msg": "^2.14.0",
84
- "vconsole": "^3.3.4",
85
- "vite": "^2.6.13",
86
- "vite-plugin-imp": "^2.0.7",
87
- "vite-plugin-importer": "^0.2.1",
88
- "vite-plugin-svgr": "^1.1.0",
89
- "xytools": "1.5.2-beta.4"
90
- },
91
- "dependencies": {
92
- "crypto-browserify": "^3.12.0",
93
- "crypto-js": "^4.1.1",
94
- "dexie": "^2.0.4",
95
- "dexie-export-import": "^1.0.0-rc.1",
96
- "encryptlong": "^3.1.4",
97
- "js-base64": "^3.6.1",
98
- "qs": "^6.9.4",
99
- "uuid": "^7.0.2"
100
- },
101
- "husky": {
102
- "hooks": {
103
- "pre-commit": "lint-staged",
104
- "commit-msg": "validate-commit-msg"
105
- }
106
- },
107
- "config": {
108
- "validate-commit-msg": {
109
- "types": [
110
- "feat",
111
- "fix",
112
- "docs",
113
- "style",
114
- "refactor",
115
- "perf",
116
- "test",
117
- "build",
118
- "ci",
119
- "chore",
120
- "revert",
121
- "merge"
122
- ]
123
- }
124
- },
125
- "lint-staged": {
126
- "{src,demo}/**/*.{js,jsx,json,ts,tsx,scss,sass,css,md}": [
127
- "prettier --write"
128
- ]
129
- }
130
- }
1
+ {
2
+ "name": "@xylink/xy-rtc-sdk",
3
+ "version": "2.1.2",
4
+ "description": "XYRTC SDK(小鱼易连web音视频 sdk)",
5
+ "keywords": [
6
+ "webrtc",
7
+ "xylink",
8
+ "xyrtc",
9
+ "xyrtc sdk"
10
+ ],
11
+ "main": "lib/index.js",
12
+ "types": "lib/src/index.d.ts",
13
+ "scripts": {
14
+ "start": "vite",
15
+ "dev": "vite",
16
+ "build:demo": "tsc && vite build",
17
+ "preview": "vite preview",
18
+ "build-watch": "rollup -c -w",
19
+ "build": "NODE_ENV=production rollup -c",
20
+ "test": "jest",
21
+ "version:beta": "npm version prerelease --preid=beta",
22
+ "publish:beta": "npm publish --tag beta --access public",
23
+ "xytools": "xytools"
24
+ },
25
+ "author": "jinghui-Luo",
26
+ "email": "luojinghui424@gmail.com",
27
+ "bugs": {
28
+ "url": "https://github.com/xylink-com/xylink-rtc-demo/issues",
29
+ "email": "luojinghui424@gmail.com"
30
+ },
31
+ "devDependencies": {
32
+ "@babel/core": "^7.7.4",
33
+ "@babel/plugin-proposal-class-properties": "^7.7.4",
34
+ "@babel/plugin-syntax-dynamic-import": "^7.7.4",
35
+ "@babel/plugin-transform-typescript": "^7.7.4",
36
+ "@babel/preset-env": "^7.7.4",
37
+ "@babel/preset-react": "^7.6.3",
38
+ "@babel/preset-typescript": "^7.7.4",
39
+ "@rollup/plugin-node-resolve": "^7.0.0",
40
+ "@rollup/plugin-replace": "^2.3.0",
41
+ "@types/clone-deep": "^4.0.1",
42
+ "@types/crypto-js": "^4.0.1",
43
+ "@types/downloadjs": "^1.4.2",
44
+ "@types/react": "^17.0.3",
45
+ "@types/react-dom": "^17.0.6",
46
+ "@types/uuid": "^8.3.0",
47
+ "@typescript-eslint/eslint-plugin": "^2.9.0",
48
+ "@typescript-eslint/parser": "^2.9.0",
49
+ "@vitejs/plugin-react-refresh": "^1.3.2",
50
+ "antd": "4.10.1",
51
+ "axios": "^0.19.1",
52
+ "babel-loader": "^8.0.6",
53
+ "babel-plugin-import": "^1.12.2",
54
+ "babel-polyfill": "^6.26.0",
55
+ "babel-preset-env": "^1.7.0",
56
+ "babel-preset-es2015": "^6.24.1",
57
+ "babel-preset-react": "^6.24.1",
58
+ "babel-preset-react-app": "^9.0.2",
59
+ "clone-deep": "^4.0.1",
60
+ "core-js": "^3.6.5",
61
+ "downloadjs": "^1.4.7",
62
+ "eslint": "^6.7.1",
63
+ "eslint-config-alloy": "^3.4.0",
64
+ "husky": "^4.3.8",
65
+ "jest": "^25.1.0",
66
+ "jszip": "^3.5.0",
67
+ "less": "^3.10.3",
68
+ "lint-staged": "^10.5.4",
69
+ "prettier": "^1.19.1",
70
+ "react": "^16.10.2",
71
+ "react-dom": "^16.10.2",
72
+ "rollup": "^2.44.0",
73
+ "rollup-plugin-babel": "^4.3.3",
74
+ "rollup-plugin-cleanup": "^3.2.1",
75
+ "rollup-plugin-clear": "^2.0.7",
76
+ "rollup-plugin-commonjs": "^10.1.0",
77
+ "rollup-plugin-json": "^4.0.0",
78
+ "rollup-plugin-sourcemaps": "^0.4.2",
79
+ "rollup-plugin-terser": "^5.1.2",
80
+ "rollup-plugin-typescript2": "^0.25.2",
81
+ "sass": "^1.32.10",
82
+ "typescript": "^4.3.2",
83
+ "validate-commit-msg": "^2.14.0",
84
+ "vconsole": "^3.3.4",
85
+ "vite": "^2.6.13",
86
+ "vite-plugin-imp": "^2.0.7",
87
+ "vite-plugin-importer": "^0.2.1",
88
+ "vite-plugin-svgr": "^1.1.0",
89
+ "xytools": "1.5.2-beta.4"
90
+ },
91
+ "dependencies": {
92
+ "crypto-browserify": "^3.12.0",
93
+ "crypto-js": "^4.1.1",
94
+ "dexie": "^2.0.4",
95
+ "dexie-export-import": "^1.0.0-rc.1",
96
+ "encryptlong": "^3.1.4",
97
+ "js-base64": "^3.6.1",
98
+ "qs": "^6.9.4",
99
+ "uuid": "^7.0.2"
100
+ },
101
+ "husky": {
102
+ "hooks": {
103
+ "pre-commit": "lint-staged",
104
+ "commit-msg": "validate-commit-msg"
105
+ }
106
+ },
107
+ "config": {
108
+ "validate-commit-msg": {
109
+ "types": [
110
+ "feat",
111
+ "fix",
112
+ "docs",
113
+ "style",
114
+ "refactor",
115
+ "perf",
116
+ "test",
117
+ "build",
118
+ "ci",
119
+ "chore",
120
+ "revert",
121
+ "merge"
122
+ ]
123
+ }
124
+ },
125
+ "lint-staged": {
126
+ "{src,demo}/**/*.{js,jsx,json,ts,tsx,scss,sass,css,md}": [
127
+ "prettier --write"
128
+ ]
129
+ }
130
+ }