@xylink/xy-rtc-sdk 3.10.0-beta.4 → 100.0.0-beta.44

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.
Files changed (116) hide show
  1. package/README.MD +30 -12
  2. package/build.config.json +10 -0
  3. package/lib/action/index.d.ts +57 -45
  4. package/lib/enum/analyser.d.ts +7 -0
  5. package/lib/enum/client.d.ts +8 -2
  6. package/lib/enum/constraints.d.ts +11 -16
  7. package/lib/enum/device.d.ts +0 -6
  8. package/lib/enum/errorCode.d.ts +5 -2
  9. package/lib/enum/index.d.ts +43 -5
  10. package/lib/enum/polling.d.ts +2 -0
  11. package/lib/feature/customMessage/index.d.ts +29 -0
  12. package/lib/feature/edu/index.d.ts +34 -0
  13. package/lib/feature/edu/index.type.d.ts +29 -0
  14. package/lib/feature/index.d.ts +3 -1
  15. package/lib/feature/{speaker.d.ts → speaker/index.d.ts} +29 -9
  16. package/lib/feature/speaker/index.type.d.ts +17 -0
  17. package/lib/index.d.ts +65 -28
  18. package/lib/interface/baseModule.type.d.ts +9 -0
  19. package/lib/interface/clientInterface.type.d.ts +83 -0
  20. package/lib/interface/contentTrackInterface.type.d.ts +15 -0
  21. package/lib/interface/event.type.d.ts +316 -0
  22. package/lib/interface/peopleTrackInterface.type.d.ts +17 -0
  23. package/lib/main/ability/const.d.ts +4 -1
  24. package/lib/main/ability/index.d.ts +7 -1
  25. package/lib/main/{auth.d.ts → auth/index.d.ts} +29 -19
  26. package/lib/main/client.d.ts +365 -595
  27. package/lib/main/clientBase.d.ts +38 -0
  28. package/lib/main/clientState.d.ts +56 -0
  29. package/lib/main/{deviceManager.d.ts → device/index.d.ts} +45 -13
  30. package/lib/{type/device.d.ts → main/device/index.type.d.ts} +65 -16
  31. package/lib/main/helper/index.d.ts +120 -0
  32. package/lib/main/layout/index.d.ts +118 -105
  33. package/lib/main/layout/index.type.d.ts +270 -0
  34. package/lib/main/layout/polling.d.ts +212 -0
  35. package/lib/main/layout/state.d.ts +163 -0
  36. package/lib/main/layout/template.d.ts +15 -7
  37. package/lib/main/media/index.d.ts +177 -0
  38. package/lib/main/media/index.type.d.ts +9 -0
  39. package/lib/main/meeting/control.d.ts +107 -0
  40. package/lib/main/meeting/control.type.d.ts +24 -0
  41. package/lib/main/{meeting.d.ts → meeting/index.d.ts} +46 -7
  42. package/lib/main/meeting/verify.d.ts +69 -0
  43. package/lib/main/peer.d.ts +120 -41
  44. package/lib/main/plugin/index.d.ts +28 -0
  45. package/lib/{tools/quality.d.ts → main/quality/index.d.ts} +2 -2
  46. package/lib/{tools → main/quality}/quality.worker.d.ts +1 -1
  47. package/lib/main/{qualityManager.d.ts → quality/report.d.ts} +11 -5
  48. package/lib/main/render/index.d.ts +116 -0
  49. package/lib/main/render/index.type.d.ts +24 -0
  50. package/lib/main/{videoManager.d.ts → render/videoManager.d.ts} +78 -28
  51. package/lib/main/render/videoManager.type.d.ts +66 -0
  52. package/lib/main/roster/index.d.ts +39 -0
  53. package/lib/main/server/index.d.ts +79 -0
  54. package/lib/main/server/index.type.d.ts +21 -0
  55. package/lib/main/signal/index.d.ts +15 -0
  56. package/lib/main/socket/index.d.ts +95 -0
  57. package/lib/main/stream/index.d.ts +182 -0
  58. package/lib/main/track/baseTrack.d.ts +178 -0
  59. package/lib/main/track/contentTrack.d.ts +161 -0
  60. package/lib/main/track/customContentTrack.d.ts +18 -0
  61. package/lib/main/track/customVideoAudioTrack.d.ts +18 -0
  62. package/lib/main/track/helper.d.ts +53 -0
  63. package/lib/main/track/videoAudioCapture.d.ts +90 -0
  64. package/lib/main/track/videoAudioTrack.d.ts +243 -0
  65. package/lib/main/vom/index.d.ts +44 -0
  66. package/lib/main/vom/index.type.d.ts +1 -0
  67. package/lib/tools/analyser.d.ts +30 -7
  68. package/lib/tools/analyserManager.d.ts +55 -0
  69. package/lib/tools/dbManager.d.ts +12 -1
  70. package/lib/tools/{browser.d.ts → detectBrowser/index.d.ts} +53 -5
  71. package/lib/tools/detectStream/index.d.ts +84 -0
  72. package/lib/tools/detectStream/index.type.d.ts +56 -0
  73. package/lib/tools/detectTool/index.d.ts +191 -0
  74. package/lib/tools/detectTool/index.type.d.ts +62 -0
  75. package/lib/tools/emitter.d.ts +27 -6
  76. package/lib/tools/enum.d.ts +1 -1
  77. package/lib/tools/httpClient.d.ts +5 -1
  78. package/lib/tools/i18n.d.ts +1 -1
  79. package/lib/tools/index.d.ts +1 -8
  80. package/lib/tools/log/logger.d.ts +41 -21
  81. package/lib/tools/log/logger.worker.d.ts +1 -1
  82. package/lib/tools/log/loggerManager.d.ts +2 -2
  83. package/lib/tools/pressure/index.d.ts +33 -0
  84. package/lib/tools/pressure/index.type.d.ts +22 -0
  85. package/lib/tools/promiseQueue.d.ts +6 -0
  86. package/lib/tools/regex.d.ts +4 -0
  87. package/lib/tools/snapshot.d.ts +1 -1
  88. package/lib/tools/socket.d.ts +12 -2
  89. package/lib/tools/template/index.d.ts +11 -88
  90. package/lib/tools/template/mobile.d.ts +1 -1
  91. package/lib/tools/template/polling.d.ts +8 -0
  92. package/lib/tools/utils.d.ts +25 -16
  93. package/lib/tools/verify.d.ts +7 -0
  94. package/lib/type/ability.d.ts +1 -1
  95. package/lib/type/analyser.d.ts +26 -1
  96. package/lib/type/auth.d.ts +19 -19
  97. package/lib/type/base.d.ts +27 -31
  98. package/lib/type/capture.d.ts +9 -0
  99. package/lib/type/client.d.ts +178 -333
  100. package/lib/type/index.d.ts +22 -2
  101. package/lib/type/layout.d.ts +81 -45
  102. package/lib/type/logger.d.ts +19 -12
  103. package/lib/type/meeting.d.ts +101 -56
  104. package/lib/type/peer.d.ts +65 -1
  105. package/lib/type/polling.d.ts +194 -0
  106. package/lib/type/quality.d.ts +12 -2
  107. package/lib/type/socket.d.ts +0 -18
  108. package/lib/type/stream.d.ts +42 -24
  109. package/lib/type/track.d.ts +131 -0
  110. package/lib/xyrtc.cjs.js +1 -1
  111. package/lib/xyrtc.umd.js +1 -1
  112. package/package.json +32 -52
  113. package/lib/main/clientImplements.d.ts +0 -99
  114. package/lib/main/helper.d.ts +0 -104
  115. package/lib/main/stream.d.ts +0 -418
  116. package/lib/tools/detect.d.ts +0 -44
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xylink/xy-rtc-sdk",
3
- "version": "3.10.0-beta.4",
3
+ "version": "100.0.0-beta.44",
4
4
  "description": "XYLink RTC SDK(小鱼易连WebRTC SDK)",
5
5
  "keywords": [
6
6
  "XYLink RTC SDK",
@@ -10,29 +10,24 @@
10
10
  ],
11
11
  "main": "lib/xyrtc.cjs.js",
12
12
  "types": "lib/index.d.ts",
13
- "scripts": {
14
- "dev": "npm run start",
15
- "start": "cross-env NODE_ENV=development webpack serve --config ./scripts/webpack.dev.js",
16
- "build:demo": "cross-env NODE_ENV=production webpack --config ./scripts/webpack.common.js",
17
- "build:lib": "cross-env NODE_ENV=production webpack --config ./scripts/webpack.sdk.js",
18
- "build:nodeLib": "node ./scripts/build_lib.js",
19
- "test": "jest",
20
- "xytools": "xytools",
21
- "version:beta": "npm version prerelease --preid=beta",
22
- "publish:beta": "npm publish --tag beta --access public"
23
- },
24
13
  "author": "jinghui-Luo",
25
14
  "email": "luojinghui424@gmail.com",
26
15
  "bugs": {
27
16
  "url": "https://github.com/xylink-com/xylink-rtc-demo/issues",
28
17
  "email": "luojinghui424@gmail.com"
29
18
  },
19
+ "engines": {
20
+ "node": ">=18.20.3"
21
+ },
30
22
  "devDependencies": {
23
+ "@ant-design/icons": "^5.3.7",
31
24
  "@babel/core": "^7.18.10",
25
+ "@babel/plugin-proposal-decorators": "^7.24.1",
32
26
  "@babel/plugin-transform-runtime": "^7.18.10",
33
27
  "@babel/preset-env": "^7.18.10",
34
28
  "@babel/preset-react": "^7.18.6",
35
29
  "@babel/preset-typescript": "^7.7.4",
30
+ "@babel/runtime": "^7.24.7",
36
31
  "@svgr/webpack": "^6.3.1",
37
32
  "@types/clone-deep": "^4.0.1",
38
33
  "@types/crypto-js": "^4.0.1",
@@ -40,24 +35,31 @@
40
35
  "@types/react": "^17.0.3",
41
36
  "@types/react-dom": "^17.0.6",
42
37
  "@types/uuid": "^8.3.0",
43
- "@xylink/xy_api_gateway": "0.4.9-lite.2",
38
+ "@xylink/xy-virtual-background-plugin": "0.0.4",
39
+ "@xylink/xy_api_gateway": "0.4.9-lite.3",
40
+ "ali-oss-folder": "^1.2.2",
44
41
  "antd": "4.15.5",
45
42
  "axios": "^0.19.1",
46
43
  "babel-loader": "^8.2.5",
47
44
  "babel-plugin-import": "^1.13.5",
45
+ "chalk": "^5.3.0",
48
46
  "clone-deep": "^4.0.1",
49
47
  "copy-webpack-plugin": "^11.0.0",
50
48
  "core-js": "^3.24.1",
51
49
  "cross-env": "^7.0.3",
50
+ "crypto-browserify": "^3.12.0",
52
51
  "css-loader": "^6.7.1",
53
52
  "dexie": "^3.2.3",
54
53
  "dexie-export-import": "^4.0.7",
55
54
  "downloadjs": "^1.4.7",
55
+ "encryptlong": "^3.1.4",
56
56
  "eslint": "^6.7.1",
57
57
  "eslint-config-alloy": "^3.4.0",
58
+ "fork-ts-checker-webpack-plugin": "^9.0.2",
58
59
  "html-webpack-plugin": "^5.5.0",
59
- "husky": "^4.3.8",
60
+ "inquirer": "^9.3.2",
60
61
  "jest": "^25.1.0",
62
+ "js-base64": "^3.7.5",
61
63
  "js-sha512": "^0.8.0",
62
64
  "jszip": "^3.5.0",
63
65
  "less": "^4.1.3",
@@ -65,8 +67,10 @@
65
67
  "lint-staged": "^10.5.4",
66
68
  "mini-css-extract-plugin": "^2.6.1",
67
69
  "portfinder": "^1.0.32",
70
+ "postcss": "^8.4.39",
68
71
  "postcss-loader": "^7.0.1",
69
72
  "prettier": "^2.8.8",
73
+ "publisher-npm": "^0.0.22",
70
74
  "react": "^16.10.2",
71
75
  "react-dom": "^16.10.2",
72
76
  "sass": "^1.54.3",
@@ -74,49 +78,25 @@
74
78
  "style-loader": "^3.3.1",
75
79
  "terser-webpack-plugin": "^5.3.3",
76
80
  "ts-loader": "^9.3.1",
81
+ "tsc-alias": "^1.8.8",
77
82
  "typescript": "^4.3.2",
78
- "validate-commit-msg": "^2.14.0",
83
+ "uuid": "^7.0.2",
79
84
  "vconsole": "^3.3.4",
80
85
  "webpack": "^5.74.0",
81
86
  "webpack-cli": "^4.10.0",
82
87
  "webpack-dev-server": "^4.9.3",
83
88
  "worker-loader": "^3.0.8",
84
- "xytools": "^1.5.7",
85
- "zustand": "^4.4.4"
89
+ "xytools": "^1.5.9",
90
+ "zustand": "^4.5.1"
86
91
  },
87
- "dependencies": {
88
- "crypto-browserify": "^3.12.0",
89
- "encryptlong": "^3.1.4",
90
- "js-base64": "^3.6.1",
91
- "uuid": "^7.0.2"
92
- },
93
- "husky": {
94
- "hooks": {
95
- "pre-commit": "lint-staged",
96
- "commit-msg": "validate-commit-msg"
97
- }
98
- },
99
- "config": {
100
- "validate-commit-msg": {
101
- "types": [
102
- "feat",
103
- "fix",
104
- "docs",
105
- "style",
106
- "refactor",
107
- "perf",
108
- "test",
109
- "build",
110
- "ci",
111
- "chore",
112
- "revert",
113
- "merge"
114
- ]
115
- }
116
- },
117
- "lint-staged": {
118
- "{src,demo}/**/*.{js,jsx,json,ts,tsx,scss,sass,css,md}": [
119
- "prettier --write"
120
- ]
92
+ "scripts": {
93
+ "dev": "npm run start",
94
+ "start": "cross-env NODE_ENV=development webpack serve --config ./scripts/webpack.dev.js",
95
+ "build:demo": "cross-env NODE_ENV=production webpack --config ./scripts/webpack.common.js",
96
+ "build:sdk": "cross-env NODE_ENV=production webpack --config ./scripts/webpack.sdk.js && tsc-alias -p tsconfig.lib.json",
97
+ "publish:beta": "publisher-npm run --beta",
98
+ "publish:common": "publisher-npm run",
99
+ "preinstall": "npx only-allow pnpm",
100
+ "test": "jest"
121
101
  }
122
- }
102
+ }
@@ -1,99 +0,0 @@
1
- /**
2
- * Client implements lib
3
- *
4
- * @summary client module functions entry
5
- *
6
- * Created at : 2023-08-30 15:24:24
7
- * Last modified : 2023-11-03 14:48:54
8
- */
9
- import Client from './client';
10
- import { SnapshotParams, SnapshotResult, AnalyserConfig, IReturnResult, OriginalNotification, OriginalRealTimeNotification } from '../type';
11
- import Logger from '../tools/log/logger';
12
- import { AudioAnalyser } from '../tools/analyser';
13
- declare class ClientImplements {
14
- logger: Logger;
15
- private client;
16
- private action;
17
- constructor(client: Client);
18
- /**
19
- * 获取视频的Stream数据
20
- *
21
- * @param { string } rosterId - 参会者唯一ID,通过roster数据获取,没有则获取本地视频流
22
- * @return { MediaStream || null } - 获取到的Stream
23
- */
24
- getVideoStream(rosterId?: string): MediaStream | IReturnResult | null;
25
- /**
26
- * 获取音频的Stream数据
27
- *
28
- * @param { string } rosterId - 参会者唯一ID,通过roster数据获取,没有则获取本地音频流
29
- * @return { MediaStream || null } - 获取到的Stream
30
- */
31
- getAudioStream(rosterId?: string): MediaStream | IReturnResult | null;
32
- /**
33
- * 通过TrackId找到对应的MediaStream数据
34
- *
35
- * @private
36
- * @param { string } replaceTrackId - trackId
37
- * @param { ICustomStreamTrack[] } tracks - StreamList缓存的流列表数据
38
- * @returns { MediaStream | null } - 返回媒体流数据,如果没有找到,则返回null
39
- */
40
- private getMediaStreamByTrackId;
41
- /**
42
- * 获取音频的分析器实例
43
- * 使用场景:获取远端或本地端音频音量大小
44
- *
45
- * @param { string } rosterId - 参会者唯一ID,通过roster数据获取
46
- * @param { AnalyserConfig } config - Analyser分析器构造器配置
47
- * @return { AudioAnalyser | null } - 获取到的Stream
48
- */
49
- getAudioAnalyser(rosterId?: string, config?: AnalyserConfig): IReturnResult | AudioAnalyser | null;
50
- /**
51
- * 指定画面屏幕截图
52
- *
53
- * @param { SnapshotParams } params 参数
54
- * @property { string } params.rosterId - 用户id,通过layout事件列表获取
55
- * @property { string } params.imageType - 图片格式, 默认'image/png'
56
- * @property { number } params.compressLevel - 图片质量,0-1
57
- *
58
- * @returns { Promise<SnapshotResult> } - 截图信息
59
- */
60
- getSnapshot(params: SnapshotParams): Promise<SnapshotResult>;
61
- /**
62
- * 校验会控主持密码
63
- *
64
- * @param { string } pwd - 会控密码
65
- * @returns { Promise<IReturnResult> } - 校验结果
66
- */
67
- verifyControlPassword(pwd: string): Promise<IReturnResult>;
68
- /**
69
- * 签到
70
- *
71
- * @property { string } questionnaireId - 业务ID
72
- * @returns { Promise<IReturnResult> } - 签到结果
73
- */
74
- signIn(questionnaireId: string): Promise<IReturnResult>;
75
- /**
76
- * 处理联席主持人消息
77
- *
78
- * @param { OriginalNotification } data - 消息内容
79
- */
80
- onNotification(data: OriginalNotification): void;
81
- /**
82
- * 会控互动工具相关数据, 签到等
83
- *
84
- * @param { OriginalRealTimeNotification } data - 信令下发的原始数据
85
- */
86
- onRealTimeNotification(data: OriginalRealTimeNotification): Promise<void>;
87
- /**
88
- * 结束全体会议
89
- */
90
- endAllMeeting(): Promise<IReturnResult | undefined>;
91
- /**
92
- * 获取签到文案
93
- *
94
- * @property { SignInTextParams } - 参数
95
- * @returns { Promise<SignInText | null> } - 签到文案
96
- */
97
- private getSignInText;
98
- }
99
- export default ClientImplements;
@@ -1,104 +0,0 @@
1
- /**
2
- * Common Helper Function Lib
3
- *
4
- * Created at : 2021-01-09 14:45:46
5
- * Last modified : 2023-09-25 14:32:59
6
- */
7
- import { ILayout, IVideoManagerState, IRotationInfoTotalItem, IRosterIdInfo, IRotateStyle, DEVICE_KIND } from '../type';
8
- export declare const getLayoutItemState: (item: ILayout | ILayout, stream: MediaStream | null, vmState: IVideoManagerState) => "REQUEST" | "NORMAL" | "MUTE" | "AUDIO_TEL" | "AUDIO_ONLY" | "AUDIO_CONTENT";
9
- /**
10
- * Get video real display size and rotate of transform infos
11
- * @param width video real width of resolution
12
- * @param height video real height of resolution
13
- * @param containerHeight display video container size
14
- * @param containerWidth display video container size
15
- * @param rotate video real ratio
16
- */
17
- export declare const getVideoInfoByRotation: (width: number, height: number, containerHeight: number, containerWidth: number, rotate: number) => {
18
- realWidth: number;
19
- realHeight: number;
20
- realRotate: number;
21
- };
22
- /**
23
- * 通过旋转信息配合画面容器计算应该旋转的角度和宽高
24
- *
25
- * @param { IRotationInfoTotalItem } rotationInfo - rotateInfo 设备旋转item,通过rotate-info接口回调获取
26
- * @param { number } containerWidth - 当前参会者画面容器的宽度
27
- * @param { number } containerHeight - 当前参会者画面容器的高度
28
- */
29
- export declare const getLayoutRotateInfo: (rotationInfo: IRotationInfoTotalItem, containerWidth: number, containerHeight: number) => IRotateStyle | null;
30
- /**
31
- * 获取可支持的编解码
32
- *
33
- * @public
34
- * @returns { Promise<Object> }
35
- */
36
- export declare const getSendSupportedCodec: () => Object;
37
- /**
38
- * WebRTC 内外网探测
39
- *
40
- * @public
41
- * @returns { Promise<Object> }
42
- */
43
- export declare const detectLocator: ({ extId, clientId, clientSecret, httpServer }: {
44
- extId: string;
45
- clientId: string;
46
- clientSecret: string;
47
- httpServer?: string | undefined;
48
- }) => Promise<string>;
49
- /**
50
- * 生成用户唯一ID值
51
- *
52
- * @param { string } callUri - callUri或者endpointId值
53
- * @param { number | string } mediagroupid - mid,多分组通道,常见:0代表people,1代表content,会控喊话有>10值
54
- * @return { string } 唯一ID
55
- */
56
- export declare const getRosterId: (callUri?: string, mediagroupid?: number | string) => string;
57
- /**
58
- * 切割RosterId,获取endpointId和mediagroupId信息
59
- *
60
- * @param { string } rosterId - 唯一ID
61
- * @return { IRosterIdInfo } 切割后的数据
62
- */
63
- export declare const getRosterIdInfo: (rosterId: string) => IRosterIdInfo;
64
- /**
65
- * 通过participantId和mediagroupId获取用户的UniquePd值?
66
- *
67
- * @param { string } participantId - 小鱼设计的唯一用户ID,迁会后自动创建新的Pid子段;
68
- * @param { string } mediagroupId - 多分组通道ID
69
- * @returns { string } 创建的ID值
70
- */
71
- export declare const getUniquePid: (participantId: string | number, mediagroupId: string | number) => string;
72
- /**
73
- * 基于生成的UniquePid值获取participantId和mediagroupId
74
- *
75
- * @param { string } partId - UniquePid值
76
- * @returns
77
- */
78
- export declare const getUniquePidInfo: (partId: string) => {
79
- participantId: string;
80
- mediagroupId: string;
81
- };
82
- /**
83
- * 获取副屏渲染ID
84
- *
85
- * @param { string } viewId - 视图容器节点ID
86
- * @returns { string }
87
- */
88
- export declare const getSlaveId: (viewId: string) => string;
89
- /**
90
- * 生成设备唯一Key
91
- *
92
- * @param { string } deviceId - 设备ID
93
- * @param { boolean } isDefault - 是否是默认设备
94
- * @param { DEVICE_KIND } kind - 设备类型
95
- * @returns { string } 设备唯一Key
96
- */
97
- export declare const getDeviceUniKey: (deviceId: string, isDefault: boolean, kind: DEVICE_KIND) => string;
98
- /**
99
- * 根据名称及相应规则获得对应的名称头像
100
- *
101
- * @param { string } displayName - layout名称
102
- * @returns { string } - 名称头像 文字内容
103
- */
104
- export declare const getTextAvatar: (displayName: string) => string;