trtc-electron-sdk 9.3.301 → 9.5.8-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/liteav/trtc.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import { EventEmitter } from 'events';
3
- import { AudioMusicParam, Rect, TRTCAppScene, TRTCAudioEffectParam, TRTCAudioQuality, TRTCBeautyStyle, TRTCDeviceState, TRTCDeviceType, TRTCLogLevel, TRTCRenderParams, TRTCRoleType, TRTCSwitchRoomParam, TRTCVideoBufferType, TRTCVideoFillMode, TRTCVideoFrame, TRTCVideoPixelFormat, TRTCVideoRotation, TRTCVideoStreamType, TRTCWaterMarkSrcType, PluginInfo } from './trtc_define';
3
+ import { AudioMusicParam, Rect, TRTCAppScene, TRTCAudioEffectParam, TRTCAudioQuality, TRTCBeautyStyle, TRTCDeviceState, TRTCDeviceType, TRTCLogLevel, TRTCRenderParams, TRTCRoleType, TRTCSwitchRoomParam, TRTCVideoBufferType, TRTCVideoFillMode, TRTCVideoFrame, TRTCVideoPixelFormat, TRTCVideoRotation, TRTCVideoStreamType, TRTCWaterMarkSrcType, PluginInfo, TRTCScreenCaptureSourceInfo, TRTCScreenCaptureProperty } from './trtc_define';
4
4
  export * from './trtc_define';
5
5
  export * from './trtc_code';
6
6
  /**
@@ -1428,6 +1428,11 @@ declare class TRTCCloud extends EventEmitter {
1428
1428
  * - 共享指定区域:sourceInfoList 中 type 为 Screen 的 source,captureRect 设为非 NULL,例如 { 100, 100, 300, 300 }
1429
1429
  * - 共享整个窗口:sourceInfoList 中 type 为 Window 的 source,captureRect 设为 { 0, 0, 0, 0 }
1430
1430
  * - 共享窗口区域:sourceInfoList 中 type 为 Window 的 source,captureRect 设为非 NULL,例如 { 100, 100, 300, 300 }
1431
+ * @param {TRTCScreenCaptureSourceInfo} source - 指定分享源,详情参考TRTCScreenCaptureSourceInfo 定义
1432
+ * @param {Rect} captureRect - 指定捕获的区域
1433
+ * @param {TRTCScreenCaptureProperty} property - 指定屏幕分享目标的属性,包括捕获鼠标,高亮捕获窗口等,详情参考TRTCScreenCaptureProperty 定义
1434
+ *
1435
+ * 废弃参数使用方法(针对 9.3 以下版本):
1431
1436
  *
1432
1437
  * @param {TRTCScreenCaptureSourceType} type - 采集源类型
1433
1438
  * - TRTCScreenCaptureSourceTypeWindow: 该分享目标是某一个Windows窗口
@@ -1443,7 +1448,7 @@ declare class TRTCCloud extends EventEmitter {
1443
1448
  * @param {Boolean} captureMouse - 指定是否捕获鼠标指针
1444
1449
  * @param {Boolean} highlightWindow - 指定是否高亮正在共享的窗口,以及当捕获图像被遮挡时高亮遮挡窗口提示用户移走遮挡
1445
1450
  */
1446
- selectScreenCaptureTarget(type: number, sourceId: string, sourcename: string, captureRect: Rect, captureMouse: boolean, highlightWindow: boolean): any;
1451
+ selectScreenCaptureTarget(source: TRTCScreenCaptureSourceInfo | number, captureRect: Rect | string, property: TRTCScreenCaptureProperty | string, deprecatedCaptureRect?: Rect, captureMouse?: boolean, highlightWindow?: boolean): any;
1447
1452
  /**
1448
1453
  * 8.7 启动屏幕分享,支持选择使用主路或辅路进行屏幕分享。(暂不支持 mac 平台预览界面)
1449
1454
  *
package/liteav/trtc.js CHANGED
@@ -2289,6 +2289,11 @@ class TRTCCloud extends events_1.EventEmitter {
2289
2289
  * - 共享指定区域:sourceInfoList 中 type 为 Screen 的 source,captureRect 设为非 NULL,例如 { 100, 100, 300, 300 }
2290
2290
  * - 共享整个窗口:sourceInfoList 中 type 为 Window 的 source,captureRect 设为 { 0, 0, 0, 0 }
2291
2291
  * - 共享窗口区域:sourceInfoList 中 type 为 Window 的 source,captureRect 设为非 NULL,例如 { 100, 100, 300, 300 }
2292
+ * @param {TRTCScreenCaptureSourceInfo} source - 指定分享源,详情参考TRTCScreenCaptureSourceInfo 定义
2293
+ * @param {Rect} captureRect - 指定捕获的区域
2294
+ * @param {TRTCScreenCaptureProperty} property - 指定屏幕分享目标的属性,包括捕获鼠标,高亮捕获窗口等,详情参考TRTCScreenCaptureProperty 定义
2295
+ *
2296
+ * 废弃参数使用方法(针对 9.3 以下版本):
2292
2297
  *
2293
2298
  * @param {TRTCScreenCaptureSourceType} type - 采集源类型
2294
2299
  * - TRTCScreenCaptureSourceTypeWindow: 该分享目标是某一个Windows窗口
@@ -2304,9 +2309,19 @@ class TRTCCloud extends events_1.EventEmitter {
2304
2309
  * @param {Boolean} captureMouse - 指定是否捕获鼠标指针
2305
2310
  * @param {Boolean} highlightWindow - 指定是否高亮正在共享的窗口,以及当捕获图像被遮挡时高亮遮挡窗口提示用户移走遮挡
2306
2311
  */
2307
- selectScreenCaptureTarget(type, sourceId, sourcename, captureRect, captureMouse, highlightWindow) {
2308
- if (sourceId !== null && sourceId !== undefined && sourcename !== null && sourcename !== undefined) {
2309
- return this.rtcCloud.selectScreenCaptureTarget(type, sourceId, sourcename, captureRect.left, captureRect.top, captureRect.right, captureRect.bottom, captureMouse, highlightWindow);
2312
+ selectScreenCaptureTarget(source, captureRect, property, deprecatedCaptureRect, captureMouse, highlightWindow) {
2313
+ if (source && typeof source !== 'number' && captureRect instanceof trtc_define_1.Rect && property instanceof trtc_define_1.TRTCScreenCaptureProperty) {
2314
+ return this.rtcCloud.selectScreenCaptureTarget(source.type, source.sourceId, source.sourceName, source.isMinimizeWindow, captureRect.left, captureRect.top, captureRect.right, captureRect.bottom, property.enableCaptureMouse, property.enableHighLight, property.enableHighPerformance, property.highLightColor, property.highLightWidth, property.enableCaptureChildWindow);
2315
+ }
2316
+ const type = source;
2317
+ const sourceId = captureRect;
2318
+ const sourcename = property;
2319
+ if (sourceId !== null && sourceId !== undefined && sourcename !== null
2320
+ && sourcename !== undefined && deprecatedCaptureRect !== undefined && captureMouse !== undefined
2321
+ && highlightWindow !== undefined) {
2322
+ const selSource = new trtc_define_1.TRTCScreenCaptureSourceInfo(type, sourceId, sourcename);
2323
+ const selProperty = new trtc_define_1.TRTCScreenCaptureProperty(captureMouse, highlightWindow);
2324
+ return this.rtcCloud.selectScreenCaptureTarget(selSource.type, selSource.sourceId, selSource.sourceName, selSource.isMinimizeWindow, deprecatedCaptureRect.left, deprecatedCaptureRect.top, deprecatedCaptureRect.right, deprecatedCaptureRect.bottom, selProperty.enableCaptureMouse, selProperty.enableHighLight, selProperty.enableHighPerformance, selProperty.highLightColor, selProperty.highLightWidth, selProperty.enableCaptureChildWindow);
2310
2325
  }
2311
2326
  else {
2312
2327
  console.error('selectScreenCaptureTarget, sourceId or sourcename is undefined!');
@@ -142,7 +142,29 @@ export declare class TRTCScreenCaptureSourceInfo {
142
142
  constructor(type?: TRTCScreenCaptureSourceType, sourceId?: string, sourceName?: string, thumbBGRA?: TRTCImageBuffer, iconBGRA?: TRTCImageBuffer, isMinimizeWindow?: boolean);
143
143
  }
144
144
  /**
145
- * 3.6 设备信息
145
+ * 3.6 屏幕分享的进阶控制参数
146
+ *
147
+ * 该参数用于屏幕分享相关的接口 [selectScreenCaptureTarget]{@link TRTCCloud#selectScreenCaptureTarget},用于在指定分享目标时设定一系列进阶控制参数。
148
+ * 比如:是否采集鼠标、是否要采集子窗口、是否要在被分享目标周围绘制一个边框等。
149
+ *
150
+ * @param {Boolean} enableCaptureMouse - 是否采集目标内容的同时采集鼠标,默认为 true
151
+ * @param {Boolean} enableHighLight - 是否高亮正在共享的窗口(在被分享目标周围绘制一个边框),默认为 true。
152
+ * @param {Boolean} enableHighPerformance - 是否开启高性能模式(只会在分享屏幕时会生效),默认为 true。【特殊说明】开启后屏幕采集性能最佳,但会丧失抗遮挡能力,如果您同时开启 enableHighLight + enableHighPerformance,远端用户可以看到高亮的边框。
153
+ * @param {Number} highLightColor - 指定高亮边框的颜色,RGB 格式,传入 0 时代表采用默认颜色,默认颜色为 #8CBF26。
154
+ * @param {Number} highLightWidth - 指定高亮边框的宽度,传入0时采用默认描边宽度,默认宽度为 5px,您可以设置的最大值为 50。
155
+ * @param {Boolean} enableCaptureChildWindow - 窗口采集时是否采集子窗口(需要子窗口与被采集窗口具有 Owner 或 Popup 属性),默认为 false。
156
+ */
157
+ export declare class TRTCScreenCaptureProperty {
158
+ enableCaptureMouse: boolean;
159
+ enableHighLight: boolean;
160
+ enableHighPerformance: boolean;
161
+ highLightColor: number;
162
+ highLightWidth: number;
163
+ enableCaptureChildWindow: boolean;
164
+ constructor(enableCaptureMouse?: boolean, enableHighLight?: boolean, enableHighPerformance?: boolean, highLightColor?: number, highLightWidth?: number, enableCaptureChildWindow?: boolean);
165
+ }
166
+ /**
167
+ * 3.7 设备信息
146
168
  *
147
169
  * @param {String} deviceId - 设备PID,字符编码格式是UTF-8
148
170
  * @param {String} deviceName - 设备名称,字符编码格式是UTF-8
@@ -154,7 +176,7 @@ export declare class TRTCDeviceInfo {
154
176
  constructor(deviceId?: string, deviceName?: string);
155
177
  }
156
178
  /**
157
- * 3.7 视频帧数据
179
+ * 3.8 视频帧数据
158
180
  *
159
181
  * @param {TRTCVideoPixelFormat} videoFormat - 视频帧的格式
160
182
  * @param {TRTCVideoBufferType} bufferType - 视频数据结构类型
@@ -6,7 +6,7 @@
6
6
  *
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.TRTCSwitchRoomParam = exports.AudioMusicParam = exports.TRTCStatistics = exports.TRTCRemoteStatistics = exports.TRTCLocalStatistics = exports.TRTCAudioEffectParam = exports.TRTCAudioRecordingParams = exports.TRTCPublishCDNParam = exports.TRTCTranscodingConfig = exports.TRTCTranscodingConfigMode = exports.TRTCMixUser = exports.Rect = exports.TRTCSpeedTestResult = exports.TRTCVolumeInfo = exports.TRTCQualityInfo = exports.TRTCNetworkQosParam = exports.TRTCRenderParams = exports.TRTCVideoEncParam = exports.TRTCParams = exports.TRTCWaterMarkSrcType = exports.TRTCDeviceType = exports.TRTCDeviceState = exports.TRTCLogLevel = exports.TRTCVideoFrame = exports.TRTCDeviceInfo = exports.TRTCScreenCaptureSourceInfo = exports.TRTCImageBuffer = exports.TRTCAudioQuality = exports.TRTCScreenCaptureSourceType = exports.TRTCAudioFrameFormat = exports.TRTCVideoQosPreference = exports.TRTCQosControlMode = exports.TRTCRoleType = exports.TRTCAppScene = exports.TRTCVideoMirrorType = exports.TRTCVideoBufferType = exports.TRTCVideoPixelFormat = exports.TRTCBeautyStyle = exports.TRTCVideoRotation = exports.TRTCVideoFillMode = exports.TRTCQuality = exports.TRTCVideoStreamType = exports.TRTCVideoResolutionMode = exports.TRTCVideoResolution = void 0;
9
+ exports.TRTCSwitchRoomParam = exports.AudioMusicParam = exports.TRTCStatistics = exports.TRTCRemoteStatistics = exports.TRTCLocalStatistics = exports.TRTCAudioEffectParam = exports.TRTCAudioRecordingParams = exports.TRTCPublishCDNParam = exports.TRTCTranscodingConfig = exports.TRTCTranscodingConfigMode = exports.TRTCMixUser = exports.Rect = exports.TRTCSpeedTestResult = exports.TRTCVolumeInfo = exports.TRTCQualityInfo = exports.TRTCNetworkQosParam = exports.TRTCRenderParams = exports.TRTCVideoEncParam = exports.TRTCParams = exports.TRTCWaterMarkSrcType = exports.TRTCDeviceType = exports.TRTCDeviceState = exports.TRTCLogLevel = exports.TRTCVideoFrame = exports.TRTCDeviceInfo = exports.TRTCScreenCaptureProperty = exports.TRTCScreenCaptureSourceInfo = exports.TRTCImageBuffer = exports.TRTCAudioQuality = exports.TRTCScreenCaptureSourceType = exports.TRTCAudioFrameFormat = exports.TRTCVideoQosPreference = exports.TRTCQosControlMode = exports.TRTCRoleType = exports.TRTCAppScene = exports.TRTCVideoMirrorType = exports.TRTCVideoBufferType = exports.TRTCVideoPixelFormat = exports.TRTCBeautyStyle = exports.TRTCVideoRotation = exports.TRTCVideoFillMode = exports.TRTCQuality = exports.TRTCVideoStreamType = exports.TRTCVideoResolutionMode = exports.TRTCVideoResolution = void 0;
10
10
  /////////////////////////////////////////////////////////////////////////////////
11
11
  //
12
12
  // 【(一)视频相关枚举值定义】
@@ -539,7 +539,31 @@ class TRTCScreenCaptureSourceInfo {
539
539
  exports.TRTCScreenCaptureSourceInfo = TRTCScreenCaptureSourceInfo;
540
540
  ;
541
541
  /**
542
- * 3.6 设备信息
542
+ * 3.6 屏幕分享的进阶控制参数
543
+ *
544
+ * 该参数用于屏幕分享相关的接口 [selectScreenCaptureTarget]{@link TRTCCloud#selectScreenCaptureTarget},用于在指定分享目标时设定一系列进阶控制参数。
545
+ * 比如:是否采集鼠标、是否要采集子窗口、是否要在被分享目标周围绘制一个边框等。
546
+ *
547
+ * @param {Boolean} enableCaptureMouse - 是否采集目标内容的同时采集鼠标,默认为 true
548
+ * @param {Boolean} enableHighLight - 是否高亮正在共享的窗口(在被分享目标周围绘制一个边框),默认为 true。
549
+ * @param {Boolean} enableHighPerformance - 是否开启高性能模式(只会在分享屏幕时会生效),默认为 true。【特殊说明】开启后屏幕采集性能最佳,但会丧失抗遮挡能力,如果您同时开启 enableHighLight + enableHighPerformance,远端用户可以看到高亮的边框。
550
+ * @param {Number} highLightColor - 指定高亮边框的颜色,RGB 格式,传入 0 时代表采用默认颜色,默认颜色为 #8CBF26。
551
+ * @param {Number} highLightWidth - 指定高亮边框的宽度,传入0时采用默认描边宽度,默认宽度为 5px,您可以设置的最大值为 50。
552
+ * @param {Boolean} enableCaptureChildWindow - 窗口采集时是否采集子窗口(需要子窗口与被采集窗口具有 Owner 或 Popup 属性),默认为 false。
553
+ */
554
+ class TRTCScreenCaptureProperty {
555
+ constructor(enableCaptureMouse = true, enableHighLight = true, enableHighPerformance = true, highLightColor = 0, highLightWidth = 0, enableCaptureChildWindow = false) {
556
+ this.enableCaptureMouse = enableCaptureMouse;
557
+ this.enableHighLight = enableHighLight;
558
+ this.enableHighPerformance = enableHighPerformance;
559
+ this.highLightColor = highLightColor;
560
+ this.highLightWidth = highLightWidth;
561
+ this.enableCaptureChildWindow = enableCaptureChildWindow;
562
+ }
563
+ }
564
+ exports.TRTCScreenCaptureProperty = TRTCScreenCaptureProperty;
565
+ /**
566
+ * 3.7 设备信息
543
567
  *
544
568
  * @param {String} deviceId - 设备PID,字符编码格式是UTF-8
545
569
  * @param {String} deviceName - 设备名称,字符编码格式是UTF-8
@@ -554,7 +578,7 @@ class TRTCDeviceInfo {
554
578
  exports.TRTCDeviceInfo = TRTCDeviceInfo;
555
579
  ;
556
580
  /**
557
- * 3.7 视频帧数据
581
+ * 3.8 视频帧数据
558
582
  *
559
583
  * @param {TRTCVideoPixelFormat} videoFormat - 视频帧的格式
560
584
  * @param {TRTCVideoBufferType} bufferType - 视频数据结构类型
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trtc-electron-sdk",
3
- "version": "9.3.301",
3
+ "version": "9.5.8-beta.0",
4
4
  "description": "trtc electron sdk",
5
5
  "main": "./liteav/trtc.js",
6
6
  "types": "./liteav/trtc.d.ts",