@xmaxai/web-sdk 1.0.10 → 1.1.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.
@@ -11,6 +11,9 @@ declare enum RealtimeVideoEncoderPreference {
11
11
  */
12
12
  maintainQuality = "maintainQuality"
13
13
  }
14
+ /**
15
+ * 视频尺寸、帧率和上传编码选项。
16
+ */
14
17
  interface RealtimeVideoFormatInit {
15
18
  /**
16
19
  * 视频宽度,单位为像素。
@@ -25,7 +28,7 @@ interface RealtimeVideoFormatInit {
25
28
  */
26
29
  fps: number;
27
30
  /**
28
- * 最低上传码率,单位为 kbps;缺省使用 SDK 默认值,0 表示不设最低码率。
31
+ * 最低上传码率,单位为 kbps;缺省取 500 与最高码率的较小值,0 表示不设下限。
29
32
  */
30
33
  minimumBitrate?: number;
31
34
  /**
@@ -41,9 +44,6 @@ interface RealtimeVideoFormatInit {
41
44
  * 实时视频的尺寸、帧率和上传编码配置。
42
45
  */
43
46
  declare class RealtimeVideoFormat {
44
- /**
45
- * 视频规格
46
- */
47
47
  /**
48
48
  * 视频宽度,单位为像素。
49
49
  */
@@ -57,10 +57,7 @@ declare class RealtimeVideoFormat {
57
57
  */
58
58
  readonly fps: number;
59
59
  /**
60
- * 上传编码配置
61
- */
62
- /**
63
- * 最低上传码率,单位为 kbps;缺省为 100,0 表示不设最低码率;仅支持该参数的 RTC 链路生效。
60
+ * 最低上传码率,单位为 kbps;缺省取 500 与最高码率的较小值,0 表示不设下限;仅支持该参数的 RTC 链路生效。
64
61
  */
65
62
  readonly minimumBitrate?: number;
66
63
  /**
@@ -73,13 +70,6 @@ declare class RealtimeVideoFormat {
73
70
  readonly encoderPreference: RealtimeVideoEncoderPreference;
74
71
  /**
75
72
  * 创建实时视频格式。
76
- *
77
- * @param init.width 视频宽度,单位为像素。
78
- * @param init.height 视频高度,单位为像素。
79
- * @param init.fps 视频帧率,必须大于 0。
80
- * @param init.minimumBitrate 最低上传码率,单位为 kbps;缺省为 100,仅支持该参数的 RTC 链路生效。
81
- * @param init.maximumBitrate 最高上传码率,单位为 kbps;缺省按最终上传尺寸和帧率计算。
82
- * @param init.encoderPreference 上传编码策略偏好,默认值为 maintainFramerate。
83
73
  */
84
74
  constructor(init: RealtimeVideoFormatInit);
85
75
  /**
@@ -110,6 +100,9 @@ declare enum CameraPosition {
110
100
  back = "back"
111
101
  }
112
102
 
103
+ /**
104
+ * 视频轨道身份及初始媒体信息。
105
+ */
113
106
  interface RealtimeVideoTrackInit {
114
107
  /**
115
108
  * 视频轨道标识。
@@ -131,9 +124,6 @@ interface RealtimeVideoTrackInit {
131
124
  * 渲染层通过它把画面绑定到 `<video>` 元素。
132
125
  */
133
126
  declare class RealtimeVideoTrack {
134
- /**
135
- * 轨道信息
136
- */
137
127
  /**
138
128
  * 视频轨道标识。
139
129
  */
@@ -142,9 +132,6 @@ declare class RealtimeVideoTrack {
142
132
  * 动态元数据
143
133
  */
144
134
  private metadata;
145
- /**
146
- * 平台资源
147
- */
148
135
  /**
149
136
  * SDK 内部:轨道对应的 Web 媒体轨。
150
137
  * 本地轨道在采集启动后可用;远端轨道在订阅成功后可用。
@@ -152,10 +139,6 @@ declare class RealtimeVideoTrack {
152
139
  mediaStreamTrack?: MediaStreamTrack;
153
140
  /**
154
141
  * 创建实时视频轨道。
155
- *
156
- * @param init.id 视频轨道标识。
157
- * @param init.videoFormat 轨道初始视频格式。
158
- * @param init.position 本地相机轨道的初始摄像头位置。
159
142
  */
160
143
  constructor(init: RealtimeVideoTrackInit);
161
144
  /**
@@ -195,21 +178,17 @@ declare enum VideoContentMode {
195
178
  */
196
179
  interface VideoRenderStatistics {
197
180
  /**
198
- * video 按浏览器 presentedFrames 增量计数;canvas 按实际呈现提交计数。
181
+ * 按浏览器 presentedFrames 增量计数的视频呈现来源。
199
182
  */
200
- readonly source: "video" | "canvas";
183
+ readonly source: "video";
201
184
  /**
202
- * 原帧与插值帧的总呈现帧率,单位 fps。
185
+ * 视频呈现帧率,单位 fps。
203
186
  */
204
187
  readonly frameRate: number;
205
188
  /**
206
189
  * 原帧呈现帧率,单位 fps。
207
190
  */
208
191
  readonly originalFrameRate: number;
209
- /**
210
- * 插值帧呈现帧率,单位 fps;未开启插帧时为 0。
211
- */
212
- readonly interpolatedFrameRate: number;
213
192
  }
214
193
 
215
194
  /**
@@ -220,15 +199,27 @@ type TrajectoryID = number;
220
199
  * 供视觉效果使用的触点;location 为视口 CSS 像素,timestamp 为毫秒。
221
200
  */
222
201
  interface TrajectoryPoint {
202
+ /**
203
+ * 同一触点在连续采样期间保持不变的轨迹标识。
204
+ */
223
205
  readonly id: TrajectoryID;
206
+ /**
207
+ * 触点在视口中的位置,单位为 CSS 像素。
208
+ */
224
209
  readonly location: Readonly<{
225
210
  x: number;
226
211
  y: number;
227
212
  }>;
213
+ /**
214
+ * 触点在视口中的归一化位置,横纵范围为 0–1。
215
+ */
228
216
  readonly normalizedLocation: Readonly<{
229
217
  x: number;
230
218
  y: number;
231
219
  }>;
220
+ /**
221
+ * 触点采样时的单调时钟时间,单位为毫秒。
222
+ */
232
223
  readonly timestamp: number;
233
224
  }
234
225
 
@@ -259,4 +250,4 @@ interface TrajectoryEffectRendering {
259
250
  reset(): void;
260
251
  }
261
252
 
262
- export { CameraPosition as C, RealtimeVideoFormat as R, type TrajectoryEffectRendering as T, VideoContentMode as V, RealtimeVideoTrack as a, type VideoRenderStatistics as b, RealtimeVideoEncoderPreference as c, type RealtimeVideoFormatInit as d, type TrajectoryID as e, type TrajectoryPoint as f };
253
+ export { CameraPosition as C, RealtimeVideoFormat as R, type TrajectoryEffectRendering as T, VideoContentMode as V, RealtimeVideoTrack as a, type VideoRenderStatistics as b, type TrajectoryPoint as c, type TrajectoryID as d, RealtimeVideoEncoderPreference as e, type RealtimeVideoFormatInit as f };