@xmaxai/web-sdk 1.0.0 → 1.0.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.
- package/dist/{VideoContentMode-BXkqM4XG.d.cts → VideoContentMode-BM97_H8V.d.cts} +96 -21
- package/dist/{VideoContentMode-BXkqM4XG.d.ts → VideoContentMode-BM97_H8V.d.ts} +96 -21
- package/dist/{chunk-JJWUZ3AW.cjs → chunk-5NIEZJP5.cjs} +1491 -552
- package/dist/chunk-5NIEZJP5.cjs.map +1 -0
- package/dist/{chunk-MJ72WWQX.js → chunk-6RIEDVRQ.js} +1454 -515
- package/dist/chunk-6RIEDVRQ.js.map +1 -0
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +627 -165
- package/dist/index.d.ts +627 -165
- package/dist/index.js +1 -1
- package/dist/react/index.cjs +3 -3
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +31 -11
- package/dist/react/index.d.ts +31 -11
- package/dist/react/index.js +1 -1
- package/dist/react/index.js.map +1 -1
- package/package.json +7 -8
- package/README.md +0 -430
- package/dist/chunk-JJWUZ3AW.cjs.map +0 -1
- package/dist/chunk-MJ72WWQX.js.map +0 -1
|
@@ -2,34 +2,74 @@
|
|
|
2
2
|
* 实时视频的编码策略偏好。
|
|
3
3
|
*/
|
|
4
4
|
declare enum RealtimeVideoEncoderPreference {
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* 优先保障帧率(弱网降分辨率)。
|
|
7
|
+
*/
|
|
6
8
|
maintainFramerate = "maintainFramerate",
|
|
7
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* 优先保障分辨率(弱网降帧率)。
|
|
11
|
+
*/
|
|
8
12
|
maintainQuality = "maintainQuality"
|
|
9
13
|
}
|
|
10
14
|
interface RealtimeVideoFormatInit {
|
|
11
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* 视频宽度,单位为像素。
|
|
17
|
+
*/
|
|
12
18
|
width: number;
|
|
13
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* 视频高度,单位为像素。
|
|
21
|
+
*/
|
|
14
22
|
height: number;
|
|
15
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* 视频帧率,必须大于 0。
|
|
25
|
+
*/
|
|
16
26
|
fps: number;
|
|
17
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* 最低上传码率,单位为 kbps;缺省使用 SDK 默认值,0 表示不设最低码率。
|
|
29
|
+
*/
|
|
18
30
|
minimumBitrate?: number;
|
|
19
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* 最高上传码率,单位为 kbps;缺省使用 SDK 默认值,指定时必须大于 0。
|
|
33
|
+
*/
|
|
20
34
|
maximumBitrate?: number;
|
|
21
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* 上传编码策略偏好,默认优先保障帧率。
|
|
37
|
+
*/
|
|
22
38
|
encoderPreference?: RealtimeVideoEncoderPreference;
|
|
23
39
|
}
|
|
24
40
|
/**
|
|
25
41
|
* 实时视频的尺寸、帧率和上传编码配置。
|
|
26
42
|
*/
|
|
27
43
|
declare class RealtimeVideoFormat {
|
|
44
|
+
/**
|
|
45
|
+
* 视频规格
|
|
46
|
+
*/
|
|
47
|
+
/**
|
|
48
|
+
* 视频宽度,单位为像素。
|
|
49
|
+
*/
|
|
28
50
|
readonly width: number;
|
|
51
|
+
/**
|
|
52
|
+
* 视频高度,单位为像素。
|
|
53
|
+
*/
|
|
29
54
|
readonly height: number;
|
|
55
|
+
/**
|
|
56
|
+
* 视频帧率,单位为 fps。
|
|
57
|
+
*/
|
|
30
58
|
readonly fps: number;
|
|
59
|
+
/**
|
|
60
|
+
* 上传编码配置
|
|
61
|
+
*/
|
|
62
|
+
/**
|
|
63
|
+
* 最低上传码率,单位为 kbps;未指定时由 SDK 计算,0 表示不设最低码率。
|
|
64
|
+
*/
|
|
31
65
|
readonly minimumBitrate?: number;
|
|
66
|
+
/**
|
|
67
|
+
* 最高上传码率,单位为 kbps;未指定时由 SDK 计算。
|
|
68
|
+
*/
|
|
32
69
|
readonly maximumBitrate?: number;
|
|
70
|
+
/**
|
|
71
|
+
* 弱网下优先保障帧率或分辨率的编码策略。
|
|
72
|
+
*/
|
|
33
73
|
readonly encoderPreference: RealtimeVideoEncoderPreference;
|
|
34
74
|
/**
|
|
35
75
|
* 创建实时视频格式。
|
|
@@ -47,7 +87,9 @@ declare class RealtimeVideoFormat {
|
|
|
47
87
|
* @throws 尺寸、帧率或码率配置无效时抛出错误。
|
|
48
88
|
*/
|
|
49
89
|
validate(): void;
|
|
50
|
-
/**
|
|
90
|
+
/**
|
|
91
|
+
* 调整尺寸,保留帧率和上传编码配置。
|
|
92
|
+
*/
|
|
51
93
|
resized(width: number, height: number): RealtimeVideoFormat;
|
|
52
94
|
}
|
|
53
95
|
|
|
@@ -58,18 +100,28 @@ declare class RealtimeVideoFormat {
|
|
|
58
100
|
* 摄像头,back 会回退到可用设备。
|
|
59
101
|
*/
|
|
60
102
|
declare enum CameraPosition {
|
|
61
|
-
/**
|
|
103
|
+
/**
|
|
104
|
+
* 前置摄像头(面向用户)。
|
|
105
|
+
*/
|
|
62
106
|
front = "front",
|
|
63
|
-
/**
|
|
107
|
+
/**
|
|
108
|
+
* 后置摄像头(面向环境)。
|
|
109
|
+
*/
|
|
64
110
|
back = "back"
|
|
65
111
|
}
|
|
66
112
|
|
|
67
113
|
interface RealtimeVideoTrackInit {
|
|
68
|
-
/**
|
|
114
|
+
/**
|
|
115
|
+
* 视频轨道标识。
|
|
116
|
+
*/
|
|
69
117
|
id: string;
|
|
70
|
-
/**
|
|
118
|
+
/**
|
|
119
|
+
* 轨道当前使用的视频格式。
|
|
120
|
+
*/
|
|
71
121
|
videoFormat?: RealtimeVideoFormat;
|
|
72
|
-
/**
|
|
122
|
+
/**
|
|
123
|
+
* 本地相机轨道的摄像头位置。
|
|
124
|
+
*/
|
|
73
125
|
position?: CameraPosition;
|
|
74
126
|
}
|
|
75
127
|
/**
|
|
@@ -79,9 +131,20 @@ interface RealtimeVideoTrackInit {
|
|
|
79
131
|
* 渲染层通过它把画面绑定到 `<video>` 元素。
|
|
80
132
|
*/
|
|
81
133
|
declare class RealtimeVideoTrack {
|
|
82
|
-
/**
|
|
134
|
+
/**
|
|
135
|
+
* 轨道信息
|
|
136
|
+
*/
|
|
137
|
+
/**
|
|
138
|
+
* 视频轨道标识。
|
|
139
|
+
*/
|
|
83
140
|
readonly id: string;
|
|
141
|
+
/**
|
|
142
|
+
* 动态元数据
|
|
143
|
+
*/
|
|
84
144
|
private metadata;
|
|
145
|
+
/**
|
|
146
|
+
* 平台资源
|
|
147
|
+
*/
|
|
85
148
|
/**
|
|
86
149
|
* SDK 内部:轨道对应的 Web 媒体轨。
|
|
87
150
|
* 本地轨道在采集启动后可用;远端轨道在订阅成功后可用。
|
|
@@ -95,13 +158,21 @@ declare class RealtimeVideoTrack {
|
|
|
95
158
|
* @param init.position 本地相机轨道的初始摄像头位置。
|
|
96
159
|
*/
|
|
97
160
|
constructor(init: RealtimeVideoTrackInit);
|
|
98
|
-
/**
|
|
161
|
+
/**
|
|
162
|
+
* 当前视频轨道使用的视频格式。
|
|
163
|
+
*/
|
|
99
164
|
get videoFormat(): RealtimeVideoFormat | undefined;
|
|
100
|
-
/**
|
|
165
|
+
/**
|
|
166
|
+
* 本地相机轨道当前使用的摄像头位置。
|
|
167
|
+
*/
|
|
101
168
|
get position(): CameraPosition | undefined;
|
|
102
|
-
/**
|
|
169
|
+
/**
|
|
170
|
+
* 更新轨道视频格式。 @internal
|
|
171
|
+
*/
|
|
103
172
|
updateVideoFormat(videoFormat: RealtimeVideoFormat): void;
|
|
104
|
-
/**
|
|
173
|
+
/**
|
|
174
|
+
* 更新轨道摄像头位置。 @internal
|
|
175
|
+
*/
|
|
105
176
|
updatePosition(position: CameraPosition): void;
|
|
106
177
|
}
|
|
107
178
|
|
|
@@ -109,9 +180,13 @@ declare class RealtimeVideoTrack {
|
|
|
109
180
|
* 视频内容在渲染容器中的显示模式。
|
|
110
181
|
*/
|
|
111
182
|
declare enum VideoContentMode {
|
|
112
|
-
/**
|
|
183
|
+
/**
|
|
184
|
+
* 等比完整显示,允许容器留空。
|
|
185
|
+
*/
|
|
113
186
|
fit = "fit",
|
|
114
|
-
/**
|
|
187
|
+
/**
|
|
188
|
+
* 等比铺满容器,允许裁剪画面。
|
|
189
|
+
*/
|
|
115
190
|
fill = "fill"
|
|
116
191
|
}
|
|
117
192
|
|
|
@@ -2,34 +2,74 @@
|
|
|
2
2
|
* 实时视频的编码策略偏好。
|
|
3
3
|
*/
|
|
4
4
|
declare enum RealtimeVideoEncoderPreference {
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* 优先保障帧率(弱网降分辨率)。
|
|
7
|
+
*/
|
|
6
8
|
maintainFramerate = "maintainFramerate",
|
|
7
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* 优先保障分辨率(弱网降帧率)。
|
|
11
|
+
*/
|
|
8
12
|
maintainQuality = "maintainQuality"
|
|
9
13
|
}
|
|
10
14
|
interface RealtimeVideoFormatInit {
|
|
11
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* 视频宽度,单位为像素。
|
|
17
|
+
*/
|
|
12
18
|
width: number;
|
|
13
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* 视频高度,单位为像素。
|
|
21
|
+
*/
|
|
14
22
|
height: number;
|
|
15
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* 视频帧率,必须大于 0。
|
|
25
|
+
*/
|
|
16
26
|
fps: number;
|
|
17
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* 最低上传码率,单位为 kbps;缺省使用 SDK 默认值,0 表示不设最低码率。
|
|
29
|
+
*/
|
|
18
30
|
minimumBitrate?: number;
|
|
19
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* 最高上传码率,单位为 kbps;缺省使用 SDK 默认值,指定时必须大于 0。
|
|
33
|
+
*/
|
|
20
34
|
maximumBitrate?: number;
|
|
21
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* 上传编码策略偏好,默认优先保障帧率。
|
|
37
|
+
*/
|
|
22
38
|
encoderPreference?: RealtimeVideoEncoderPreference;
|
|
23
39
|
}
|
|
24
40
|
/**
|
|
25
41
|
* 实时视频的尺寸、帧率和上传编码配置。
|
|
26
42
|
*/
|
|
27
43
|
declare class RealtimeVideoFormat {
|
|
44
|
+
/**
|
|
45
|
+
* 视频规格
|
|
46
|
+
*/
|
|
47
|
+
/**
|
|
48
|
+
* 视频宽度,单位为像素。
|
|
49
|
+
*/
|
|
28
50
|
readonly width: number;
|
|
51
|
+
/**
|
|
52
|
+
* 视频高度,单位为像素。
|
|
53
|
+
*/
|
|
29
54
|
readonly height: number;
|
|
55
|
+
/**
|
|
56
|
+
* 视频帧率,单位为 fps。
|
|
57
|
+
*/
|
|
30
58
|
readonly fps: number;
|
|
59
|
+
/**
|
|
60
|
+
* 上传编码配置
|
|
61
|
+
*/
|
|
62
|
+
/**
|
|
63
|
+
* 最低上传码率,单位为 kbps;未指定时由 SDK 计算,0 表示不设最低码率。
|
|
64
|
+
*/
|
|
31
65
|
readonly minimumBitrate?: number;
|
|
66
|
+
/**
|
|
67
|
+
* 最高上传码率,单位为 kbps;未指定时由 SDK 计算。
|
|
68
|
+
*/
|
|
32
69
|
readonly maximumBitrate?: number;
|
|
70
|
+
/**
|
|
71
|
+
* 弱网下优先保障帧率或分辨率的编码策略。
|
|
72
|
+
*/
|
|
33
73
|
readonly encoderPreference: RealtimeVideoEncoderPreference;
|
|
34
74
|
/**
|
|
35
75
|
* 创建实时视频格式。
|
|
@@ -47,7 +87,9 @@ declare class RealtimeVideoFormat {
|
|
|
47
87
|
* @throws 尺寸、帧率或码率配置无效时抛出错误。
|
|
48
88
|
*/
|
|
49
89
|
validate(): void;
|
|
50
|
-
/**
|
|
90
|
+
/**
|
|
91
|
+
* 调整尺寸,保留帧率和上传编码配置。
|
|
92
|
+
*/
|
|
51
93
|
resized(width: number, height: number): RealtimeVideoFormat;
|
|
52
94
|
}
|
|
53
95
|
|
|
@@ -58,18 +100,28 @@ declare class RealtimeVideoFormat {
|
|
|
58
100
|
* 摄像头,back 会回退到可用设备。
|
|
59
101
|
*/
|
|
60
102
|
declare enum CameraPosition {
|
|
61
|
-
/**
|
|
103
|
+
/**
|
|
104
|
+
* 前置摄像头(面向用户)。
|
|
105
|
+
*/
|
|
62
106
|
front = "front",
|
|
63
|
-
/**
|
|
107
|
+
/**
|
|
108
|
+
* 后置摄像头(面向环境)。
|
|
109
|
+
*/
|
|
64
110
|
back = "back"
|
|
65
111
|
}
|
|
66
112
|
|
|
67
113
|
interface RealtimeVideoTrackInit {
|
|
68
|
-
/**
|
|
114
|
+
/**
|
|
115
|
+
* 视频轨道标识。
|
|
116
|
+
*/
|
|
69
117
|
id: string;
|
|
70
|
-
/**
|
|
118
|
+
/**
|
|
119
|
+
* 轨道当前使用的视频格式。
|
|
120
|
+
*/
|
|
71
121
|
videoFormat?: RealtimeVideoFormat;
|
|
72
|
-
/**
|
|
122
|
+
/**
|
|
123
|
+
* 本地相机轨道的摄像头位置。
|
|
124
|
+
*/
|
|
73
125
|
position?: CameraPosition;
|
|
74
126
|
}
|
|
75
127
|
/**
|
|
@@ -79,9 +131,20 @@ interface RealtimeVideoTrackInit {
|
|
|
79
131
|
* 渲染层通过它把画面绑定到 `<video>` 元素。
|
|
80
132
|
*/
|
|
81
133
|
declare class RealtimeVideoTrack {
|
|
82
|
-
/**
|
|
134
|
+
/**
|
|
135
|
+
* 轨道信息
|
|
136
|
+
*/
|
|
137
|
+
/**
|
|
138
|
+
* 视频轨道标识。
|
|
139
|
+
*/
|
|
83
140
|
readonly id: string;
|
|
141
|
+
/**
|
|
142
|
+
* 动态元数据
|
|
143
|
+
*/
|
|
84
144
|
private metadata;
|
|
145
|
+
/**
|
|
146
|
+
* 平台资源
|
|
147
|
+
*/
|
|
85
148
|
/**
|
|
86
149
|
* SDK 内部:轨道对应的 Web 媒体轨。
|
|
87
150
|
* 本地轨道在采集启动后可用;远端轨道在订阅成功后可用。
|
|
@@ -95,13 +158,21 @@ declare class RealtimeVideoTrack {
|
|
|
95
158
|
* @param init.position 本地相机轨道的初始摄像头位置。
|
|
96
159
|
*/
|
|
97
160
|
constructor(init: RealtimeVideoTrackInit);
|
|
98
|
-
/**
|
|
161
|
+
/**
|
|
162
|
+
* 当前视频轨道使用的视频格式。
|
|
163
|
+
*/
|
|
99
164
|
get videoFormat(): RealtimeVideoFormat | undefined;
|
|
100
|
-
/**
|
|
165
|
+
/**
|
|
166
|
+
* 本地相机轨道当前使用的摄像头位置。
|
|
167
|
+
*/
|
|
101
168
|
get position(): CameraPosition | undefined;
|
|
102
|
-
/**
|
|
169
|
+
/**
|
|
170
|
+
* 更新轨道视频格式。 @internal
|
|
171
|
+
*/
|
|
103
172
|
updateVideoFormat(videoFormat: RealtimeVideoFormat): void;
|
|
104
|
-
/**
|
|
173
|
+
/**
|
|
174
|
+
* 更新轨道摄像头位置。 @internal
|
|
175
|
+
*/
|
|
105
176
|
updatePosition(position: CameraPosition): void;
|
|
106
177
|
}
|
|
107
178
|
|
|
@@ -109,9 +180,13 @@ declare class RealtimeVideoTrack {
|
|
|
109
180
|
* 视频内容在渲染容器中的显示模式。
|
|
110
181
|
*/
|
|
111
182
|
declare enum VideoContentMode {
|
|
112
|
-
/**
|
|
183
|
+
/**
|
|
184
|
+
* 等比完整显示,允许容器留空。
|
|
185
|
+
*/
|
|
113
186
|
fit = "fit",
|
|
114
|
-
/**
|
|
187
|
+
/**
|
|
188
|
+
* 等比铺满容器,允许裁剪画面。
|
|
189
|
+
*/
|
|
115
190
|
fill = "fill"
|
|
116
191
|
}
|
|
117
192
|
|