@xylink/xy-rtc-sdk 2.1.2 → 2.1.3-beta.0
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 +37 -37
- package/lib/index.es.js +1 -1
- package/lib/index.js +1 -1
- package/lib/src/enum/index.d.ts +2 -0
- package/lib/src/main/client.d.ts +15 -1
- package/lib/src/tools/config.d.ts +1 -1
- package/lib/src/type/client.d.ts +24 -0
- package/package.json +130 -130
package/lib/src/enum/index.d.ts
CHANGED
|
@@ -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
|
* 支持呼叫的会议室类型
|
package/lib/src/main/client.d.ts
CHANGED
|
@@ -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 } from '../type';
|
|
8
8
|
import Emmitter from '../tools/emmitter';
|
|
9
9
|
import Socket from '../tools/socket';
|
|
10
10
|
import Stream from './stream';
|
|
@@ -460,6 +460,20 @@ export default class Client extends Emmitter {
|
|
|
460
460
|
* @param { ISubTitle } data 字幕、点名消息
|
|
461
461
|
*/
|
|
462
462
|
private onSubTitle;
|
|
463
|
+
/**
|
|
464
|
+
* 发送自定义消息
|
|
465
|
+
*
|
|
466
|
+
* @public
|
|
467
|
+
* @param { object } config - 配置参数
|
|
468
|
+
* @param { number } config.toPid - 消息的接收方pid,0表示广播消息、非0表示单点消息;
|
|
469
|
+
* @param { string } config.data - 消息内容,JSON字符串;因业务数据可能会传输图片,需要对二进制数据进行base64编码,消息长度限制最大:1030KB
|
|
470
|
+
* @return { { code: string, message: string, data: null | object } } 返回结果
|
|
471
|
+
*/
|
|
472
|
+
sendCustomMessage(config: ICustomMessageConfig): {
|
|
473
|
+
code: string;
|
|
474
|
+
msg: string;
|
|
475
|
+
detail: any;
|
|
476
|
+
};
|
|
463
477
|
/**
|
|
464
478
|
* 处理媒体消息
|
|
465
479
|
*
|
|
@@ -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.
|
|
7
|
+
export declare const version = "2.1.3-beta.0 - build on 2022-12-02 19:45";
|
|
8
8
|
export declare const proxy: {
|
|
9
9
|
wssHost: string;
|
|
10
10
|
restHost: string;
|
package/lib/src/type/client.d.ts
CHANGED
|
@@ -1103,4 +1103,28 @@ 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
|
+
}
|
|
1106
1130
|
export {};
|
package/package.json
CHANGED
|
@@ -1,130 +1,130 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@xylink/xy-rtc-sdk",
|
|
3
|
-
"version": "2.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
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@xylink/xy-rtc-sdk",
|
|
3
|
+
"version": "2.1.3-beta.0",
|
|
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
|
+
}
|