@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.
- package/README.MD +30 -12
- package/build.config.json +10 -0
- package/lib/action/index.d.ts +57 -45
- package/lib/enum/analyser.d.ts +7 -0
- package/lib/enum/client.d.ts +8 -2
- package/lib/enum/constraints.d.ts +11 -16
- package/lib/enum/device.d.ts +0 -6
- package/lib/enum/errorCode.d.ts +5 -2
- package/lib/enum/index.d.ts +43 -5
- package/lib/enum/polling.d.ts +2 -0
- package/lib/feature/customMessage/index.d.ts +29 -0
- package/lib/feature/edu/index.d.ts +34 -0
- package/lib/feature/edu/index.type.d.ts +29 -0
- package/lib/feature/index.d.ts +3 -1
- package/lib/feature/{speaker.d.ts → speaker/index.d.ts} +29 -9
- package/lib/feature/speaker/index.type.d.ts +17 -0
- package/lib/index.d.ts +65 -28
- package/lib/interface/baseModule.type.d.ts +9 -0
- package/lib/interface/clientInterface.type.d.ts +83 -0
- package/lib/interface/contentTrackInterface.type.d.ts +15 -0
- package/lib/interface/event.type.d.ts +316 -0
- package/lib/interface/peopleTrackInterface.type.d.ts +17 -0
- package/lib/main/ability/const.d.ts +4 -1
- package/lib/main/ability/index.d.ts +7 -1
- package/lib/main/{auth.d.ts → auth/index.d.ts} +29 -19
- package/lib/main/client.d.ts +365 -595
- package/lib/main/clientBase.d.ts +38 -0
- package/lib/main/clientState.d.ts +56 -0
- package/lib/main/{deviceManager.d.ts → device/index.d.ts} +45 -13
- package/lib/{type/device.d.ts → main/device/index.type.d.ts} +65 -16
- package/lib/main/helper/index.d.ts +120 -0
- package/lib/main/layout/index.d.ts +118 -105
- package/lib/main/layout/index.type.d.ts +270 -0
- package/lib/main/layout/polling.d.ts +212 -0
- package/lib/main/layout/state.d.ts +163 -0
- package/lib/main/layout/template.d.ts +15 -7
- package/lib/main/media/index.d.ts +177 -0
- package/lib/main/media/index.type.d.ts +9 -0
- package/lib/main/meeting/control.d.ts +107 -0
- package/lib/main/meeting/control.type.d.ts +24 -0
- package/lib/main/{meeting.d.ts → meeting/index.d.ts} +46 -7
- package/lib/main/meeting/verify.d.ts +69 -0
- package/lib/main/peer.d.ts +120 -41
- package/lib/main/plugin/index.d.ts +28 -0
- package/lib/{tools/quality.d.ts → main/quality/index.d.ts} +2 -2
- package/lib/{tools → main/quality}/quality.worker.d.ts +1 -1
- package/lib/main/{qualityManager.d.ts → quality/report.d.ts} +11 -5
- package/lib/main/render/index.d.ts +116 -0
- package/lib/main/render/index.type.d.ts +24 -0
- package/lib/main/{videoManager.d.ts → render/videoManager.d.ts} +78 -28
- package/lib/main/render/videoManager.type.d.ts +66 -0
- package/lib/main/roster/index.d.ts +39 -0
- package/lib/main/server/index.d.ts +79 -0
- package/lib/main/server/index.type.d.ts +21 -0
- package/lib/main/signal/index.d.ts +15 -0
- package/lib/main/socket/index.d.ts +95 -0
- package/lib/main/stream/index.d.ts +182 -0
- package/lib/main/track/baseTrack.d.ts +178 -0
- package/lib/main/track/contentTrack.d.ts +161 -0
- package/lib/main/track/customContentTrack.d.ts +18 -0
- package/lib/main/track/customVideoAudioTrack.d.ts +18 -0
- package/lib/main/track/helper.d.ts +53 -0
- package/lib/main/track/videoAudioCapture.d.ts +90 -0
- package/lib/main/track/videoAudioTrack.d.ts +243 -0
- package/lib/main/vom/index.d.ts +44 -0
- package/lib/main/vom/index.type.d.ts +1 -0
- package/lib/tools/analyser.d.ts +30 -7
- package/lib/tools/analyserManager.d.ts +55 -0
- package/lib/tools/dbManager.d.ts +12 -1
- package/lib/tools/{browser.d.ts → detectBrowser/index.d.ts} +53 -5
- package/lib/tools/detectStream/index.d.ts +84 -0
- package/lib/tools/detectStream/index.type.d.ts +56 -0
- package/lib/tools/detectTool/index.d.ts +191 -0
- package/lib/tools/detectTool/index.type.d.ts +62 -0
- package/lib/tools/emitter.d.ts +27 -6
- package/lib/tools/enum.d.ts +1 -1
- package/lib/tools/httpClient.d.ts +5 -1
- package/lib/tools/i18n.d.ts +1 -1
- package/lib/tools/index.d.ts +1 -8
- package/lib/tools/log/logger.d.ts +41 -21
- package/lib/tools/log/logger.worker.d.ts +1 -1
- package/lib/tools/log/loggerManager.d.ts +2 -2
- package/lib/tools/pressure/index.d.ts +33 -0
- package/lib/tools/pressure/index.type.d.ts +22 -0
- package/lib/tools/promiseQueue.d.ts +6 -0
- package/lib/tools/regex.d.ts +4 -0
- package/lib/tools/snapshot.d.ts +1 -1
- package/lib/tools/socket.d.ts +12 -2
- package/lib/tools/template/index.d.ts +11 -88
- package/lib/tools/template/mobile.d.ts +1 -1
- package/lib/tools/template/polling.d.ts +8 -0
- package/lib/tools/utils.d.ts +25 -16
- package/lib/tools/verify.d.ts +7 -0
- package/lib/type/ability.d.ts +1 -1
- package/lib/type/analyser.d.ts +26 -1
- package/lib/type/auth.d.ts +19 -19
- package/lib/type/base.d.ts +27 -31
- package/lib/type/capture.d.ts +9 -0
- package/lib/type/client.d.ts +178 -333
- package/lib/type/index.d.ts +22 -2
- package/lib/type/layout.d.ts +81 -45
- package/lib/type/logger.d.ts +19 -12
- package/lib/type/meeting.d.ts +101 -56
- package/lib/type/peer.d.ts +65 -1
- package/lib/type/polling.d.ts +194 -0
- package/lib/type/quality.d.ts +12 -2
- package/lib/type/socket.d.ts +0 -18
- package/lib/type/stream.d.ts +42 -24
- package/lib/type/track.d.ts +131 -0
- package/lib/xyrtc.cjs.js +1 -1
- package/lib/xyrtc.umd.js +1 -1
- package/package.json +32 -52
- package/lib/main/clientImplements.d.ts +0 -99
- package/lib/main/helper.d.ts +0 -104
- package/lib/main/stream.d.ts +0 -418
- package/lib/tools/detect.d.ts +0 -44
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Device and Stream Detect
|
|
3
|
+
*
|
|
4
|
+
* @author JingHui Luo <luojinghui424@gmail.com>
|
|
5
|
+
*
|
|
6
|
+
* Created at : 2024-04-23 18:20:29
|
|
7
|
+
* Last modified : 2024-04-30 15:17:32
|
|
8
|
+
*/
|
|
9
|
+
import { DetectDeviceList, DetectMaxRes, DetectStreamType } from './index.type';
|
|
10
|
+
export declare class XYStreamDetector {
|
|
11
|
+
private deviceList;
|
|
12
|
+
private maxResolutionMap;
|
|
13
|
+
static instance: XYStreamDetector;
|
|
14
|
+
static getInstance(): XYStreamDetector;
|
|
15
|
+
/**
|
|
16
|
+
* 销毁资源
|
|
17
|
+
*/
|
|
18
|
+
destroy(): void;
|
|
19
|
+
/**
|
|
20
|
+
* 采集音视频流
|
|
21
|
+
*
|
|
22
|
+
* @param { DetectStreamType } type - 类型
|
|
23
|
+
* @param { object } config - 约束配置
|
|
24
|
+
* @returns { Promise<MediaStream> }
|
|
25
|
+
*/
|
|
26
|
+
captureStream(type: DetectStreamType, config?: object | boolean): Promise<MediaStream>;
|
|
27
|
+
/**
|
|
28
|
+
* 采集分享视频流
|
|
29
|
+
*
|
|
30
|
+
* @param { object } config - 约束配置
|
|
31
|
+
* @returns { Promise<MediaStream> }
|
|
32
|
+
*/
|
|
33
|
+
captureContentStream(config?: object): Promise<MediaStream>;
|
|
34
|
+
/**
|
|
35
|
+
* 检测是否允许使用摄像头
|
|
36
|
+
*/
|
|
37
|
+
checkAllowCamera(): Promise<{
|
|
38
|
+
allow: boolean;
|
|
39
|
+
msg: any;
|
|
40
|
+
}>;
|
|
41
|
+
/**
|
|
42
|
+
* 检测是否允许使用麦克风
|
|
43
|
+
*/
|
|
44
|
+
checkAllowMicroPhone(): Promise<{
|
|
45
|
+
allow: boolean;
|
|
46
|
+
msg: any;
|
|
47
|
+
}>;
|
|
48
|
+
/**
|
|
49
|
+
* 获取指定设备的最大采集分辨率
|
|
50
|
+
*/
|
|
51
|
+
getMaxResolution(): Promise<Map<string, DetectMaxRes>>;
|
|
52
|
+
/**
|
|
53
|
+
* 获取指定Device的采集最大分辨率数据
|
|
54
|
+
*/
|
|
55
|
+
private calculateMaxResolution;
|
|
56
|
+
/**
|
|
57
|
+
* 获取麦克风/摄像头/扬声器设备列表
|
|
58
|
+
*/
|
|
59
|
+
getDeviceList(): Promise<DetectDeviceList>;
|
|
60
|
+
/**
|
|
61
|
+
* 停止指定Stream流数据
|
|
62
|
+
*
|
|
63
|
+
* @param { MediaStream[] } streamList - 需要停止的流列表
|
|
64
|
+
*/
|
|
65
|
+
closeStream(streamList: MediaStream[]): void;
|
|
66
|
+
/**
|
|
67
|
+
* 获取浏览器支持的约束字段
|
|
68
|
+
*/
|
|
69
|
+
getSupportedConstraints(): string[];
|
|
70
|
+
/**
|
|
71
|
+
* 处理采集视频流错误码
|
|
72
|
+
*
|
|
73
|
+
* @param { any } err - 错误信息
|
|
74
|
+
* @returns { DetectResult } 错误码
|
|
75
|
+
*/
|
|
76
|
+
private handleCaptureStreamError;
|
|
77
|
+
/**
|
|
78
|
+
* 处理采集共享频流错误码
|
|
79
|
+
*
|
|
80
|
+
* @param { any } err - 错误信息
|
|
81
|
+
* @returns { DetectResult } 错误码
|
|
82
|
+
*/
|
|
83
|
+
private handleCreateContentStreamError;
|
|
84
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 设备检测工具库
|
|
3
|
+
*
|
|
4
|
+
* Created at : 2024-04-23 18:41:22
|
|
5
|
+
* Last modified : 2024-04-24 14:17:37
|
|
6
|
+
*/
|
|
7
|
+
export declare enum DetectStreamType {
|
|
8
|
+
'ALL' = 0,
|
|
9
|
+
'VIDEO' = 1,
|
|
10
|
+
'AUDIO' = 2,
|
|
11
|
+
'CONTENT' = 3
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* SDK对外回调错误消息
|
|
15
|
+
*
|
|
16
|
+
* @property { number } code - 错误码
|
|
17
|
+
* @property { string } msg - 错误信息
|
|
18
|
+
* @property { unknown } detail - 数据详情
|
|
19
|
+
*/
|
|
20
|
+
export interface DetectResult {
|
|
21
|
+
code: number;
|
|
22
|
+
msg: string;
|
|
23
|
+
detail?: any;
|
|
24
|
+
}
|
|
25
|
+
export interface DetectDeviceList {
|
|
26
|
+
audioInputList: DetectDeviceInfo[];
|
|
27
|
+
audioOutputList: DetectDeviceInfo[];
|
|
28
|
+
videoInputList: DetectDeviceInfo[];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* 获取设备信息
|
|
32
|
+
*
|
|
33
|
+
* @property { string } deviceId 设备id
|
|
34
|
+
* @property { string } label 设备名称
|
|
35
|
+
* @property { string } groupId 设备分组
|
|
36
|
+
* @property { 'output' | 'input' } direction 设备方向
|
|
37
|
+
* @value output 输出设备
|
|
38
|
+
* @value input 输入设备
|
|
39
|
+
* @property { 'audioinput' | 'audiooutput' | 'videoinput' } kind 设备种类
|
|
40
|
+
* @value audioinput 音频输入
|
|
41
|
+
* @value audiooutput 音频输出
|
|
42
|
+
* @value videoinput 摄像头输入
|
|
43
|
+
* @property { string } type 设备采集流类型:video/audio
|
|
44
|
+
*/
|
|
45
|
+
export interface DetectDeviceInfo {
|
|
46
|
+
deviceId: string;
|
|
47
|
+
label: string;
|
|
48
|
+
groupId?: string;
|
|
49
|
+
direction?: 'output' | 'input';
|
|
50
|
+
kind?: 'audioinput' | 'audiooutput' | 'videoinput';
|
|
51
|
+
type?: 'video' | 'audio';
|
|
52
|
+
}
|
|
53
|
+
export interface DetectMaxRes {
|
|
54
|
+
width: number;
|
|
55
|
+
height: number;
|
|
56
|
+
}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Detect 检测浏览器支持情况
|
|
3
|
+
* @authors Luo-jinghui (luojinghui424@gmail.com)
|
|
4
|
+
* @date 2019-10-22 11:11:55
|
|
5
|
+
*/
|
|
6
|
+
import { XYBrowserDetector } from '../detectBrowser/index';
|
|
7
|
+
import { XYStreamDetector } from '../detectStream/index';
|
|
8
|
+
import { ICheckSystemRequirements, DetectSupportFeature, DetectSupportTest, DetectDeviceCodecList } from './index.type';
|
|
9
|
+
export declare class XYDetector {
|
|
10
|
+
/**
|
|
11
|
+
* Canvas元素ID
|
|
12
|
+
*/
|
|
13
|
+
static CANVAS_TEST_ID: string;
|
|
14
|
+
/**
|
|
15
|
+
* Video元素ID
|
|
16
|
+
*/
|
|
17
|
+
static VIDEO_TEST_ID: string;
|
|
18
|
+
/**
|
|
19
|
+
* 浏览器检测模块
|
|
20
|
+
*/
|
|
21
|
+
static browser: typeof XYBrowserDetector;
|
|
22
|
+
/**
|
|
23
|
+
* 浏览器检测模块
|
|
24
|
+
*/
|
|
25
|
+
static stream: XYStreamDetector;
|
|
26
|
+
/**
|
|
27
|
+
* 是否是WebSDK支持的最低版本浏览器
|
|
28
|
+
*/
|
|
29
|
+
static isSupportDesktopBrowser(): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* 是否是WebSDK支持的最低版本移动端浏览器
|
|
32
|
+
*/
|
|
33
|
+
static isSupportMobileBrowser(): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* 是否支持设置视频流的宽高比
|
|
36
|
+
* iOS不支持,裁剪画面会造成画面有绿边
|
|
37
|
+
*/
|
|
38
|
+
static isSupportAspectRatio(): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* 是否支持采集设备流
|
|
41
|
+
*/
|
|
42
|
+
static isSupportUserMedia(): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* 创建Canvas测试视频流
|
|
45
|
+
*
|
|
46
|
+
* 配套方法:调用 removeDetectElement 清理节点资源
|
|
47
|
+
*
|
|
48
|
+
* @returns { MediaStream }
|
|
49
|
+
*/
|
|
50
|
+
static checkCanvasCapture(): {
|
|
51
|
+
canvasStream: MediaStream | null;
|
|
52
|
+
isSupportCanvasCapture: boolean;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* 创建Video测试视频流
|
|
56
|
+
*
|
|
57
|
+
* 配套方法:调用 removeDetectElement 清理节点资源
|
|
58
|
+
*
|
|
59
|
+
* @param { string } src - Video地址
|
|
60
|
+
* @returns { MediaStream }
|
|
61
|
+
*/
|
|
62
|
+
static checkVideoCapture(src: string): {
|
|
63
|
+
isSupportVideoCapture: boolean;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* 清理测试元素
|
|
67
|
+
*/
|
|
68
|
+
static removeDetectElement(id?: string): void;
|
|
69
|
+
/**
|
|
70
|
+
* 获取是否支持WebRTC相关API
|
|
71
|
+
*
|
|
72
|
+
* @param { MediaStream? } videoCapture - 视频流
|
|
73
|
+
*/
|
|
74
|
+
static isSupportRTC(videoCapture?: MediaStream | null): Promise<DetectSupportFeature>;
|
|
75
|
+
/**
|
|
76
|
+
* 是否支持WebRTC PeerConnection模块
|
|
77
|
+
*
|
|
78
|
+
* @param { MediaStream? } videoCapture - 视频流
|
|
79
|
+
*/
|
|
80
|
+
static isSupportPeerCB(videoCapture?: MediaStream | null): Promise<DetectSupportTest>;
|
|
81
|
+
/**
|
|
82
|
+
* 获取是否支持WebSocket连接
|
|
83
|
+
*/
|
|
84
|
+
static isSupportWebsocket(): boolean;
|
|
85
|
+
/**
|
|
86
|
+
* 获取是否支持从Video获取数据流
|
|
87
|
+
*/
|
|
88
|
+
static isSupportVideoCapture(videoRef: any): {
|
|
89
|
+
videoCaptureStream: any;
|
|
90
|
+
captureVideoVisible: boolean;
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* 获取是否支持 IndexDB 方法
|
|
94
|
+
*
|
|
95
|
+
* @returns
|
|
96
|
+
*/
|
|
97
|
+
static isSupportIndexDB(): boolean;
|
|
98
|
+
/**
|
|
99
|
+
* 获取是否支持权限检测方法
|
|
100
|
+
*/
|
|
101
|
+
static isSupportDevicePermission(): Promise<boolean>;
|
|
102
|
+
/**
|
|
103
|
+
* 获取是否支持WebAudio API
|
|
104
|
+
* @returns
|
|
105
|
+
*/
|
|
106
|
+
static isSupportAudioContext(): boolean;
|
|
107
|
+
/**
|
|
108
|
+
* 支持获取输入/输出设备数据
|
|
109
|
+
*/
|
|
110
|
+
static isSupportMediaDevices(): boolean;
|
|
111
|
+
/**
|
|
112
|
+
* 获取是否支持视频流录制
|
|
113
|
+
*/
|
|
114
|
+
static isSupportMediaRecorder(): boolean;
|
|
115
|
+
/**
|
|
116
|
+
* 获取是否支持WebWorker
|
|
117
|
+
*/
|
|
118
|
+
static isSupportWebWorker(): boolean;
|
|
119
|
+
/**
|
|
120
|
+
* 获取是否支持WebWorker
|
|
121
|
+
*/
|
|
122
|
+
static isSupportTransformStream(): boolean;
|
|
123
|
+
/**
|
|
124
|
+
* 获取是否支持H264编解码
|
|
125
|
+
*/
|
|
126
|
+
static isSupportH264(): Promise<boolean>;
|
|
127
|
+
/**
|
|
128
|
+
* 获取浏览器当前网络信息
|
|
129
|
+
* 兼容:Chrome、Edge,不兼容:Safari、Firefox
|
|
130
|
+
*
|
|
131
|
+
* @returns { undefined | NetworkInformation } 网络信息
|
|
132
|
+
*/
|
|
133
|
+
static getNetWork(): string;
|
|
134
|
+
/**
|
|
135
|
+
* 获取处理器数量
|
|
136
|
+
*
|
|
137
|
+
* @return { number } - 处理器数量
|
|
138
|
+
*/
|
|
139
|
+
static getCPUCount(): number;
|
|
140
|
+
/**
|
|
141
|
+
* 获取浏览器代理信息
|
|
142
|
+
*
|
|
143
|
+
* @returns { string } - 浏览器代理信息
|
|
144
|
+
*/
|
|
145
|
+
static getUserAgent(): string;
|
|
146
|
+
/**
|
|
147
|
+
* 获取Audio编解码器数据
|
|
148
|
+
*/
|
|
149
|
+
static getAudioCodec(RTCDecode: any): Promise<string[]>;
|
|
150
|
+
/**
|
|
151
|
+
* 获取Video编解码器数据
|
|
152
|
+
*/
|
|
153
|
+
static getVideoCodec(RTCDecode: any): Promise<string[]>;
|
|
154
|
+
/**
|
|
155
|
+
* 获取浏览器支持的编解码器
|
|
156
|
+
*/
|
|
157
|
+
static getSupportedCodec(): Promise<DetectDeviceCodecList>;
|
|
158
|
+
/**
|
|
159
|
+
* 获取屏幕分辨率、像素比、最大分辨率
|
|
160
|
+
*/
|
|
161
|
+
static getWidowResolution(): {
|
|
162
|
+
maxWidth: number;
|
|
163
|
+
maxHeight: number;
|
|
164
|
+
width: number;
|
|
165
|
+
height: number;
|
|
166
|
+
dpr: number;
|
|
167
|
+
maxScreenResolution: string;
|
|
168
|
+
};
|
|
169
|
+
/**
|
|
170
|
+
* 检测是否支持屏幕分享
|
|
171
|
+
*
|
|
172
|
+
* @returns { boolean } - 是否支持分享Content
|
|
173
|
+
*/
|
|
174
|
+
static isSupportShareContent(): boolean;
|
|
175
|
+
/**
|
|
176
|
+
* 是否支持针对屏幕采集设置处理器配置
|
|
177
|
+
*/
|
|
178
|
+
static isSupportSetCaptureHandleConfig(): boolean;
|
|
179
|
+
/**
|
|
180
|
+
* 是否支持系统压力检测API
|
|
181
|
+
*
|
|
182
|
+
* @returns { boolean } - 检测结果
|
|
183
|
+
*/
|
|
184
|
+
static isSupportDevicePressure(): boolean;
|
|
185
|
+
/**
|
|
186
|
+
* 检测WebRTC浏览器兼容性
|
|
187
|
+
*
|
|
188
|
+
* @returns { Promise<ICheckSystemRequirements> }
|
|
189
|
+
*/
|
|
190
|
+
static checkSupportWebRTC(): Promise<ICheckSystemRequirements>;
|
|
191
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 浏览器支持WebRTC能力详情
|
|
3
|
+
*
|
|
4
|
+
* @param { boolean } isSupportRTC - 是否支持RTCPeerConnection
|
|
5
|
+
* @param { boolean } isSupportWebsocket - 是否支持Websocket
|
|
6
|
+
* @param { boolean } isSupportBrowser - 是否支持SDK限制的浏览器类型及版本
|
|
7
|
+
* @param { boolean } isSupportMobileBrowser - 是否支持SDK限制的移动端浏览器类型及版本
|
|
8
|
+
* @param { boolean } isSupportH264 - 是否支持H264编解码器能力
|
|
9
|
+
* @param { boolean } isSupportAddTransceiver - 是否支持addTransceiver API
|
|
10
|
+
* @param { boolean } isSupportAddtrack - 是否支持addTrack API
|
|
11
|
+
* @param { boolean } isSupportUserMedia - 是否支持访问用户摄像头和麦克风的getUserMedia API
|
|
12
|
+
*/
|
|
13
|
+
export interface XYCheckSystemRequirementsDetail {
|
|
14
|
+
isSupportRTC: boolean;
|
|
15
|
+
isSupportWebsocket: boolean;
|
|
16
|
+
isSupportBrowser: boolean;
|
|
17
|
+
isSupportMobileBrowser: boolean;
|
|
18
|
+
isSupportH264: boolean;
|
|
19
|
+
isSupportAddTransceiver: boolean;
|
|
20
|
+
isSupportAddtrack: boolean;
|
|
21
|
+
isSupportUserMedia: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* 浏览器是否支持WebRTC能力
|
|
25
|
+
*
|
|
26
|
+
* @param { boolean } result - 结果
|
|
27
|
+
* @param { object } detail - 支持详情
|
|
28
|
+
*
|
|
29
|
+
*/
|
|
30
|
+
export interface ICheckSystemRequirements {
|
|
31
|
+
result: boolean;
|
|
32
|
+
detail: {
|
|
33
|
+
isSupportRTC: boolean;
|
|
34
|
+
isSupportWebsocket: boolean;
|
|
35
|
+
isSupportH264: boolean;
|
|
36
|
+
isSupportAddTransceiver: boolean;
|
|
37
|
+
isSupportAddtrack: boolean;
|
|
38
|
+
isSupportUserMedia: boolean;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export interface DetectSupportFeature {
|
|
42
|
+
isSupportRTC: boolean;
|
|
43
|
+
isSupportAddtrack: boolean;
|
|
44
|
+
isSupportAddTransceiver: boolean;
|
|
45
|
+
isSupportReplaceTrack: boolean;
|
|
46
|
+
isApplyConstraints: boolean;
|
|
47
|
+
isSupportSetStreams: boolean;
|
|
48
|
+
}
|
|
49
|
+
export interface DetectSupportTest {
|
|
50
|
+
isSupportPeer: boolean;
|
|
51
|
+
isSupportAddtrack: boolean;
|
|
52
|
+
isSupportAddTransceiver: boolean;
|
|
53
|
+
isSupportReplaceTrack: boolean;
|
|
54
|
+
isApplyConstraints: boolean;
|
|
55
|
+
isSupportSetStreams: boolean;
|
|
56
|
+
}
|
|
57
|
+
export interface DetectDeviceCodecList {
|
|
58
|
+
audioSenderCodecList: string[];
|
|
59
|
+
videoSenderCodecList: string[];
|
|
60
|
+
audioReceiverCodecList: string[];
|
|
61
|
+
videoReceiverCodecList: string[];
|
|
62
|
+
}
|
package/lib/tools/emitter.d.ts
CHANGED
|
@@ -4,12 +4,33 @@
|
|
|
4
4
|
* @authors Luo-jinghui (luojinghui424@gmail.com)
|
|
5
5
|
* @date 2019-10-17 19:14:39
|
|
6
6
|
*/
|
|
7
|
-
export default class Emitter {
|
|
8
|
-
private
|
|
7
|
+
export default class Emitter<T> {
|
|
8
|
+
private eventMap;
|
|
9
9
|
constructor();
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
/**
|
|
11
|
+
* 监听事件
|
|
12
|
+
*
|
|
13
|
+
* @param { string } key - 事件Key
|
|
14
|
+
* @param { Function } listener - 事件回调函数
|
|
15
|
+
* @param { number? } total - 可选,回调函数出发次数,默认是-1,表示无限制
|
|
16
|
+
*/
|
|
17
|
+
on(key: T, listener: Function, total?: number): void;
|
|
18
|
+
once(key: T, listener: Function, total?: number): void;
|
|
19
|
+
/**
|
|
20
|
+
* 移除指定事件的监听器
|
|
21
|
+
*
|
|
22
|
+
* @param { string } key - 事件Key
|
|
23
|
+
*/
|
|
24
|
+
removeListener(key: T): void;
|
|
25
|
+
/**
|
|
26
|
+
* 移除所有监听器
|
|
27
|
+
*/
|
|
13
28
|
removeAllListener(): void;
|
|
14
|
-
|
|
29
|
+
/**
|
|
30
|
+
* 触发事件
|
|
31
|
+
*
|
|
32
|
+
* @param { string } key - 事件Key
|
|
33
|
+
* @param { T[] } args - 事件数据
|
|
34
|
+
*/
|
|
35
|
+
emmit<U>(key: T, ...args: U[]): void;
|
|
15
36
|
}
|
package/lib/tools/enum.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { AxiosRequestConfig, AxiosInstance, AxiosError } from 'axios';
|
|
8
8
|
import Logger from './log/logger';
|
|
9
|
-
import { IToken } from '../type';
|
|
9
|
+
import { IToken } from '../type/index';
|
|
10
10
|
export interface IResponseSuccess {
|
|
11
11
|
code: number;
|
|
12
12
|
data: any;
|
|
@@ -20,6 +20,10 @@ export interface IAxiosRequestConfig extends AxiosRequestConfig {
|
|
|
20
20
|
clientSecret?: string;
|
|
21
21
|
clientId?: string;
|
|
22
22
|
}
|
|
23
|
+
export declare const invalidError: {
|
|
24
|
+
token_expired: number;
|
|
25
|
+
gateway_timestamp_expired: number;
|
|
26
|
+
};
|
|
23
27
|
declare class HttpClient {
|
|
24
28
|
commonOption: IAxiosRequestConfig;
|
|
25
29
|
axios: AxiosInstance;
|
package/lib/tools/i18n.d.ts
CHANGED
package/lib/tools/index.d.ts
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 辅助工具函数:设置Audio元素的输出设备
|
|
3
|
-
*
|
|
4
|
-
* @param { HTMLAudioElement } element - Audio元素节点
|
|
5
|
-
* @param { string } deviceId - 指定设备ID,如果指定错误,则使用系统默认设备
|
|
6
|
-
*/
|
|
7
|
-
declare const setOutputAudioDevice: (element: any, deviceId: string) => Promise<void>;
|
|
8
1
|
/**
|
|
9
2
|
* 转换HideId隐身入会字段
|
|
10
3
|
*
|
|
@@ -12,4 +5,4 @@ declare const setOutputAudioDevice: (element: any, deviceId: string) => Promise<
|
|
|
12
5
|
* @returns { string } hideId
|
|
13
6
|
*/
|
|
14
7
|
declare const getHideId: (hideId: string | number) => string;
|
|
15
|
-
export {
|
|
8
|
+
export { getHideId };
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @authors Luo-jinghui (luojinghui424@gmail.com)
|
|
6
6
|
* @date 2019-10-22 20:08:33
|
|
7
7
|
*/
|
|
8
|
-
import { LogLevel, ILoggerConfig, TLogLevel, UploadLogParams } from '../../type';
|
|
8
|
+
import { LogLevel, ILoggerConfig, TLogLevel, UploadLogParams } from '../../type/index';
|
|
9
9
|
declare class Logger {
|
|
10
10
|
private action;
|
|
11
11
|
private worker;
|
|
@@ -14,6 +14,7 @@ declare class Logger {
|
|
|
14
14
|
config: ILoggerConfig;
|
|
15
15
|
isProgress: boolean;
|
|
16
16
|
isUpdateVersion: boolean;
|
|
17
|
+
stopTaskKey: string;
|
|
17
18
|
taskPromiseMap: {
|
|
18
19
|
[key: string]: any;
|
|
19
20
|
};
|
|
@@ -37,12 +38,21 @@ declare class Logger {
|
|
|
37
38
|
* @param { any } msg - WebWorker消息
|
|
38
39
|
*/
|
|
39
40
|
onMessage(msg: any): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* 停止Logger,销毁数据,更新表索引
|
|
43
|
+
*/
|
|
44
|
+
private destroyPromiseTask;
|
|
40
45
|
/**
|
|
41
46
|
* 停止日志模块
|
|
47
|
+
*/
|
|
48
|
+
stop(): Promise<unknown>;
|
|
49
|
+
/**
|
|
50
|
+
* 停止日志模块-内部调用
|
|
51
|
+
* 此方法不需要更新表的索引,会一直在同一个表读/写数据
|
|
42
52
|
*
|
|
43
53
|
* @param { boolean } enabledUpdateIndex - 是否更新表
|
|
44
54
|
*/
|
|
45
|
-
|
|
55
|
+
stopWithoutUpdateIndex(): Promise<unknown>;
|
|
46
56
|
/**
|
|
47
57
|
* 监听WebWorker错误
|
|
48
58
|
*
|
|
@@ -68,13 +78,13 @@ declare class Logger {
|
|
|
68
78
|
*/
|
|
69
79
|
private getTableIndex;
|
|
70
80
|
/**
|
|
71
|
-
*
|
|
81
|
+
* 调试模式下,控制台输出日志的等级
|
|
72
82
|
*
|
|
73
83
|
* @param { LogLevel } level 日志等级
|
|
74
84
|
*/
|
|
75
85
|
setLogLevel: (level: TLogLevel) => void;
|
|
76
86
|
/**
|
|
77
|
-
*
|
|
87
|
+
* 设置日志服务器地址
|
|
78
88
|
*
|
|
79
89
|
* @public
|
|
80
90
|
* @param { string } logServer Log服务器地址
|
|
@@ -83,18 +93,18 @@ declare class Logger {
|
|
|
83
93
|
/**
|
|
84
94
|
* 控制台输出INFO信息,并写入日志
|
|
85
95
|
*
|
|
86
|
-
* @param { string } title
|
|
87
|
-
* @param { any } content
|
|
88
|
-
* @param { any[] } rest
|
|
96
|
+
* @param { string } title 可选,日志的标题
|
|
97
|
+
* @param { any } content 可选,日志内容,必须是可序列化的数据
|
|
98
|
+
* @param { any[] } rest 可选,函数剩余参数
|
|
89
99
|
*/
|
|
90
100
|
log(title: string, content?: any, ...rest: any[]): void;
|
|
91
101
|
/**
|
|
92
|
-
*
|
|
102
|
+
* 输出debug信息,并写入日志
|
|
93
103
|
*
|
|
94
104
|
* @public
|
|
95
|
-
* @param { string } title
|
|
96
|
-
* @param { any } content
|
|
97
|
-
* @param { any[] } rest
|
|
105
|
+
* @param { string } title 可选,日志的标题
|
|
106
|
+
* @param { any } content 可选,日志内容,必须是可序列化的数据
|
|
107
|
+
* @param { any[] } rest 可选,函数剩余参数
|
|
98
108
|
*/
|
|
99
109
|
debug(title?: string, content?: any, ...rest: any[]): void;
|
|
100
110
|
/**
|
|
@@ -102,21 +112,31 @@ declare class Logger {
|
|
|
102
112
|
* 输出 WARNING 和 ERROR 级别的日志信息
|
|
103
113
|
*
|
|
104
114
|
* @public
|
|
105
|
-
* @param { string } title
|
|
106
|
-
* @param { any } content
|
|
107
|
-
* @param { any[] } rest
|
|
115
|
+
* @param { string } title 可选,日志的标题
|
|
116
|
+
* @param { any } content 可选,日志内容,必须是可序列化的数据
|
|
117
|
+
* @param { any[] } rest 可选,函数剩余参数
|
|
108
118
|
*/
|
|
109
119
|
warn(title?: string, content?: any, ...rest: any[]): void;
|
|
110
120
|
/**
|
|
111
|
-
*
|
|
121
|
+
* 输出error信息,并写入日志
|
|
112
122
|
* 输出 ERROR 级别的日志信息
|
|
113
123
|
*
|
|
114
124
|
* @public
|
|
125
|
+
* @param { string } title 可选,日志的标题
|
|
126
|
+
* @param { any } content 可选,日志内容,必须是可序列化的数据
|
|
127
|
+
* @param { any[] } rest 可选,函数剩余参数
|
|
128
|
+
*/
|
|
129
|
+
error(title: any, content?: any, ...rest: any[]): void;
|
|
130
|
+
/**
|
|
131
|
+
* 控制台输出Fatal信息,并写入日志
|
|
132
|
+
* 输出 FATAL 级别的日志信息
|
|
133
|
+
*
|
|
134
|
+
* @public
|
|
115
135
|
* @param { string } title 日志key
|
|
116
136
|
* @param { any } content 日志内容,必须是可序列化的数据
|
|
117
137
|
* @param { any[] } rest 其他内容,同content
|
|
118
138
|
*/
|
|
119
|
-
|
|
139
|
+
fatal(title: any, content?: any, ...rest: any[]): void;
|
|
120
140
|
/**
|
|
121
141
|
* 发送日志内容
|
|
122
142
|
*
|
|
@@ -129,11 +149,11 @@ declare class Logger {
|
|
|
129
149
|
*/
|
|
130
150
|
downloadLog: (fileName?: string | '') => Promise<unknown>;
|
|
131
151
|
/**
|
|
132
|
-
*
|
|
152
|
+
* 上传会议日志到小鱼服务器
|
|
133
153
|
*
|
|
134
|
-
* @param { string } name
|
|
135
|
-
* @param { string } account
|
|
136
|
-
* @param { string } comments
|
|
154
|
+
* @param { string } name 可选,上传文件名,默认值是""
|
|
155
|
+
* @param { string } account 可选,上传账号,默认值是""
|
|
156
|
+
* @param { string } comments 可选,上传时备注信息,默认值是""
|
|
137
157
|
* @returns { boolean } 上传结果
|
|
138
158
|
*/
|
|
139
159
|
uploadLog(name?: string, account?: string, comments?: string): Promise<unknown>;
|
|
@@ -144,7 +164,7 @@ declare class Logger {
|
|
|
144
164
|
* @param { Blob } blob - 日志Blob数据
|
|
145
165
|
* @returns { boolean } 上传结果
|
|
146
166
|
*/
|
|
147
|
-
uploadLogProcess(config: UploadLogParams, blob: Blob): Promise<
|
|
167
|
+
uploadLogProcess(config: UploadLogParams, blob: Blob): Promise<boolean>;
|
|
148
168
|
/**
|
|
149
169
|
* 允许日志上传
|
|
150
170
|
*/
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @authors Luo-jinghui (luojinghui424@gmail.com)
|
|
5
5
|
*
|
|
6
6
|
* Created at : 2023-04-24 14:16:27
|
|
7
|
-
* Last modified :
|
|
7
|
+
* Last modified : 2024-04-23 19:02:52
|
|
8
8
|
*/
|
|
9
9
|
declare const _default: {
|
|
10
10
|
new (scriptURL: string | URL, options?: WorkerOptions | undefined): Worker;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Logger from './logger';
|
|
2
|
-
import { ILoggerConfig, UploadLogParams } from '../../type';
|
|
2
|
+
import { ILoggerConfig, UploadLogParams } from '../../type/index';
|
|
3
3
|
declare class LogManager {
|
|
4
4
|
private logMap;
|
|
5
5
|
private static instance;
|
|
@@ -56,7 +56,7 @@ declare class LogManager {
|
|
|
56
56
|
* @property { string } params.dbName - 日志库名称,默认不传,上传所有日志
|
|
57
57
|
* @returns { boolean } - 上传结果
|
|
58
58
|
*/
|
|
59
|
-
uploadLog({ name, account, comments, dbName }: UploadLogParams): Promise<
|
|
59
|
+
uploadLog({ name, account, comments, dbName }: UploadLogParams): Promise<boolean>;
|
|
60
60
|
/**
|
|
61
61
|
* 导出所有日志库Blob数据
|
|
62
62
|
*
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WebRTC SDK Pressure Manager
|
|
3
|
+
*
|
|
4
|
+
* Note: https://w3c.github.io/compute-pressure/#dfn-valid-source-types
|
|
5
|
+
*
|
|
6
|
+
* Created at : 2024-06-28 16:55:47
|
|
7
|
+
* Last modified : 2024-06-28 18:24:13
|
|
8
|
+
*/
|
|
9
|
+
import { XYBaseModule } from '../../interface/baseModule.type';
|
|
10
|
+
import Logger from '../log/logger';
|
|
11
|
+
/**
|
|
12
|
+
* @class
|
|
13
|
+
* @description: Device pressure
|
|
14
|
+
*/
|
|
15
|
+
export declare class XYDevicePressure implements XYBaseModule {
|
|
16
|
+
private observer;
|
|
17
|
+
private interval;
|
|
18
|
+
private logger;
|
|
19
|
+
private pressureState;
|
|
20
|
+
constructor(logger: Logger);
|
|
21
|
+
/**
|
|
22
|
+
* 初始化设备压力监听
|
|
23
|
+
*/
|
|
24
|
+
init(): void;
|
|
25
|
+
/**
|
|
26
|
+
* 监听回调事件
|
|
27
|
+
*/
|
|
28
|
+
private pressureChange;
|
|
29
|
+
/**
|
|
30
|
+
* 资源销毁
|
|
31
|
+
*/
|
|
32
|
+
destroy(): void;
|
|
33
|
+
}
|