@xylink/xy-rtc-sdk 2.1.2 → 2.1.3-beta.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,7 +4,7 @@
4
4
  * @authors Luo-jinghui (luojinghui424@gmail.com)
5
5
  * @date 2019-10-30 14:12:52
6
6
  */
7
- import { IDefault, IMUTE_MAP, ITemplateMode, IContentTemplateMode, IRoster } from '../type';
7
+ import { IDefault, IMUTE_MAP, ITemplateMode, IContentTemplateMode, IRoster, IFeatureConfig } from '../type';
8
8
  export * from './contraints';
9
9
  export declare const LOG_CACHE_COUNT = 10;
10
10
  export declare const DB_TABLE_COUNT = 10;
@@ -14,6 +14,8 @@ export declare const DEVICE_TYPE = 17;
14
14
  export declare const SELF_MOCK_PID = 9999999999;
15
15
  export declare const STREAM_CHANNEL_COUNT = 11;
16
16
  export declare const MAX_PARTICIPANT_COUNT = 112;
17
+ export declare const MAX_CUSTOM_MESSAGE_LEN = 1373333;
18
+ export declare const MAX_CUSTOM_MESSAGE_LOG_LEN = 13333;
17
19
  export declare const STREAM_ERROR_CODE_MAP: string[];
18
20
  /**
19
21
  * 支持呼叫的会议室类型
@@ -131,3 +133,7 @@ export declare const SupportLocalLanguages: readonly ["Chinese", "English"];
131
133
  * 日志中需要隐藏的关键词
132
134
  */
133
135
  export declare const HIDE_KEY_INFOS: string[];
136
+ /**
137
+ * SDK功能控制开关
138
+ */
139
+ export declare const DEFAULT_FEATURE_CONFIG: IFeatureConfig;
@@ -4,7 +4,7 @@
4
4
  * @authors Luo-jinghui (luojinghui424@gmail.com)
5
5
  * @date 2019-10-23 12:04:44
6
6
  */
7
- import { IClientConfig, IMackCall, IInvite, IRoster, ILayoutRoster, ISpeakerInfo, IScreenInfo, IServers, ILoginExtAccount, IPublishParams, ICustomLayout, ICustomStreamTrack, IInternels, IVideoAudioType, IShareContentStatus, IPushType, IMode, IReqInfo, TCommand, ILayout, IConference, IConferenceInfo, IContentMode, IToken, AutoMute, Key, IRecordPermission, TLocalLanguage } from '../type';
7
+ import { IClientConfig, IMackCall, IInvite, IRoster, ILayoutRoster, ISpeakerInfo, IScreenInfo, IServers, ILoginExtAccount, IPublishParams, ICustomLayout, ICustomStreamTrack, IInternels, IVideoAudioType, IShareContentStatus, IPushType, IMode, IReqInfo, TCommand, ILayout, IConference, IConferenceInfo, IContentMode, IToken, AutoMute, Key, IRecordPermission, TLocalLanguage, ICustomMessageConfig, IFeatureConfig } from '../type';
8
8
  import Emmitter from '../tools/emmitter';
9
9
  import Socket from '../tools/socket';
10
10
  import Stream from './stream';
@@ -73,6 +73,7 @@ export default class Client extends Emmitter {
73
73
  private qualityManager;
74
74
  private isShareContent;
75
75
  private isSubscribeTranslation;
76
+ private featureConfig;
76
77
  private onDocumentChange;
77
78
  constructor(config: IClientConfig, servers: IServers, logger: Logger);
78
79
  static instance: Client;
@@ -83,6 +84,7 @@ export default class Client extends Emmitter {
83
84
  quality: number;
84
85
  mediagroupid: number;
85
86
  };
87
+ getFeatureConfig(): IFeatureConfig;
86
88
  getClientConfig(): IClientConfig;
87
89
  getVideoManagers(): import("../type").IVideoRenders | undefined;
88
90
  getPreviewStreams(): import("../type").IGetMediaStreams | {
@@ -140,6 +142,19 @@ export default class Client extends Emmitter {
140
142
  */
141
143
  resetInitParameter(): void;
142
144
  setContentMode(mode: IContentMode): void;
145
+ /**
146
+ * SDK功能控制开关
147
+ *
148
+ * @public
149
+ * @param { IFeatureConfig } config 功能配置项
150
+ * @property { boolean } config.enableMobileNotAuth 移动端是否支持无授权入会, 默认设置为false;
151
+ * @returns { IResult }
152
+ */
153
+ setFeatureConfig(config: IFeatureConfig): {
154
+ code: string;
155
+ msg: string;
156
+ detail: any;
157
+ } | undefined;
143
158
  /**
144
159
  * 切换显示/隐藏 Local 画面
145
160
  *
@@ -460,6 +475,20 @@ export default class Client extends Emmitter {
460
475
  * @param { ISubTitle } data 字幕、点名消息
461
476
  */
462
477
  private onSubTitle;
478
+ /**
479
+ * 发送自定义消息
480
+ *
481
+ * @public
482
+ * @param { object } config - 配置参数
483
+ * @param { number } config.toPid - 消息的接收方pid,0表示广播消息、非0表示单点消息;
484
+ * @param { string } config.data - 消息内容,JSON字符串;因业务数据可能会传输图片,需要对二进制数据进行base64编码,消息长度限制最大:1030KB
485
+ * @return { { code: string, message: string, data: null | object } } 返回结果
486
+ */
487
+ sendCustomMessage(config: ICustomMessageConfig): {
488
+ code: string;
489
+ msg: string;
490
+ detail: any;
491
+ };
463
492
  /**
464
493
  * 处理媒体消息
465
494
  *
@@ -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 - build on 2022-09-20 14:31";
7
+ export declare const version = "2.1.3-beta.1 - build on 2022-12-09 17:27";
8
8
  export declare const proxy: {
9
9
  wssHost: string;
10
10
  restHost: string;
@@ -65,3 +65,10 @@ export declare const getMeetingStatus: (success: boolean, code?: string, msg?: s
65
65
  };
66
66
  };
67
67
  export declare const hideKeyInfo: (data: any, key: string | string[]) => any;
68
+ export declare const TYPEOF: {
69
+ isNumber(num: any): boolean;
70
+ isObject(obj: any): boolean;
71
+ isArray(arr: any): boolean;
72
+ isString(str: any): boolean;
73
+ isBoolean(str: any): boolean;
74
+ };
@@ -1103,4 +1103,37 @@ export interface ITranslationContent {
1103
1103
  srcLang: string;
1104
1104
  targetLang: string;
1105
1105
  }
1106
+ /**
1107
+ * 用户自定义消息
1108
+ *
1109
+ * @property { number } toPid - 消息的接收方pid,0表示广播消息、非0表示单点消息;
1110
+ * @property { string } data - 消息内容,可以被JSON序列化的字符串;因业务数据可能会传输图片,需要进行base64编码,消息最大长度限制:1MB
1111
+ */
1112
+ export interface ICustomMessageConfig {
1113
+ toPid: number;
1114
+ data: string;
1115
+ }
1116
+ /**
1117
+ * 接收到自定义消息
1118
+ *
1119
+ * @property { string } type - 消息Type
1120
+ * @property { number } fromPid - 消息的发送方pid
1121
+ * @property { number } toPid - 消息的接收方pid,0表示广播消息、非0表示单点消息;
1122
+ * @property { string } data - 消息内容,可以被JSON序列化的字符串;
1123
+ */
1124
+ export interface IReceiveCustomMessage {
1125
+ type: string;
1126
+ fromPid: number;
1127
+ toPid: number;
1128
+ data: string;
1129
+ }
1130
+ /**
1131
+ * SDK功能控制开关,用于内部是否启用某些功能的运行
1132
+ * 默认配置:src/enum/index.ts DEFAULT_FEATURE_CONFIG
1133
+ *
1134
+ * @property { boolean } enableMobileNotAuth 移动端是否支持无授权入会, 默认设置为false;
1135
+ */
1136
+ export interface IFeatureConfig {
1137
+ enableMobileNotAuth?: boolean;
1138
+ }
1106
1139
  export {};
package/package.json CHANGED
@@ -1,130 +1,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
- }
1
+ {
2
+ "name": "@xylink/xy-rtc-sdk",
3
+ "version": "2.1.3-beta.1",
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
+ }