trtc-electron-sdk 10.3.404-beta.1 → 10.3.404-beta.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.
@@ -1,5 +1,5 @@
1
1
  import { TRTCVideoFillMode } from "../trtc_define";
2
- export declare type TFrameData = {
2
+ export type TFrameData = {
3
3
  data: Uint8Array | ArrayBuffer;
4
4
  width: number;
5
5
  height: number;
@@ -7,7 +7,7 @@ export declare type TFrameData = {
7
7
  rotation: number;
8
8
  isNeedRotate: boolean;
9
9
  };
10
- export declare type TCanvasImageSourceStyleOptions = {
10
+ export type TCanvasImageSourceStyleOptions = {
11
11
  contentWidth: number;
12
12
  contentHeight: number;
13
13
  containerWidth: number;
package/liteav/trtc.d.ts CHANGED
@@ -1568,6 +1568,28 @@ declare class TRTCCloud extends EventEmitter {
1568
1568
  * @note 该方法只有在 TRTCScreenCaptureSourceInfo 中的 type 指定为 TRTCScreenCaptureSourceTypeScreen 时生效,即分享屏幕时生效
1569
1569
  */
1570
1570
  removeAllExcludedShareWindow(): void;
1571
+ /**
1572
+ * 8.16 将指定窗口加入屏幕分享的包含列表中(该接口仅支持桌面系统)
1573
+ *
1574
+ * @param {String} win - 希望被分享出去的窗口(Windows 平台下为窗口句柄: HWND)
1575
+ * - 该方法只有在 TRTCScreenCaptureSourceInfo 中的 type 指定为 TRTCScreenCaptureSourceTypeWindow 时生效,即分享窗口内容时,额外包含指定窗口的功能才生效。
1576
+ * - 您在 startScreenCapture 之前和之后调用均可。
1577
+ * - 通过该方法添加到包含列表中的窗口,会在退出房间后被 SDK 自动清除。
1578
+ */
1579
+ addIncludedShareWindow(win: string): void;
1580
+ /**
1581
+ * 8.17 将指定窗口从屏幕分享的包含列表中移除(该接口仅支持桌面系统)
1582
+ *
1583
+ * @param {String} win - 希望被分享出去的窗口(Mac 平台: 窗口 ID;Windows 平台: HWND)
1584
+ * - 该方法只有在 TRTCScreenCaptureSourceInfo 中的 type 指定为 TRTCScreenCaptureSourceTypeWindow 时生效,即分享窗口内容时,额外包含指定窗口的功能才生效。
1585
+ */
1586
+ removeIncludedShareWindow(win: string): void;
1587
+ /**
1588
+ * 8.18 将全部窗口从屏幕分享的包含列表中移除(该接口仅支持桌面系统)
1589
+ *
1590
+ * @note 该方法只有在 TRTCScreenCaptureSourceInfo 中的 type 指定为 TRTCScreenCaptureSourceTypeWindow 时生效,即分享窗口内容时,额外包含指定窗口的功能才生效。
1591
+ */
1592
+ removeAllIncludedShareWindow(): void;
1571
1593
  /**
1572
1594
  * @private
1573
1595
  * 9.5 设置本地视频自定义渲染(Electron 平台下不可用)
package/liteav/trtc.js CHANGED
@@ -1084,7 +1084,7 @@ class TRTCCloud extends events_1.EventEmitter {
1084
1084
  */
1085
1085
  handleOnScreenCaptureStarted() {
1086
1086
  this.isScreenCapturing = true;
1087
- // 只有在 Buffer 为 null 时才新建,否则只能在 handleVideoSizeChange 事件中重新申请 Buffer
1087
+ // 只有在 Buffer 为 null 时才新建,否则只能在 handleVideoSizeChange 事件中重新申请 Buffer
1088
1088
  if (!screenVideoBuffer.buffer) {
1089
1089
  screenVideoBuffer.userId = '';
1090
1090
  screenVideoBuffer.streamType = this.screenCaptureStreamType;
@@ -1663,7 +1663,7 @@ class TRTCCloud extends events_1.EventEmitter {
1663
1663
  this._initRender(key, view);
1664
1664
  }
1665
1665
  // view 为 null 时,可能启动了自定义渲染,所以 Buffer 还是要创建,否则自定义渲染就拿不到数据;
1666
- // view 非 null 时,当然必须创建 Buffer
1666
+ // view 非 null 时,当然必须创建 Buffer
1667
1667
  // 只有在 Buffer 为 null 时才新建,否则只能在 handleVideoSizeChange 事件中重新申请 Buffer
1668
1668
  if (!localVideoBuffer.buffer) {
1669
1669
  localVideoBuffer.streamType = trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeBig;
@@ -1742,7 +1742,7 @@ class TRTCCloud extends events_1.EventEmitter {
1742
1742
  this._initRender(key, view);
1743
1743
  }
1744
1744
  // view 为 null 时,可能启动了自定义渲染,所以 Buffer 还是要创建,否则自定义渲染就拿不到数据;
1745
- // view 非 null 时,当然必须创建 Buffer
1745
+ // view 非 null 时,当然必须创建 Buffer
1746
1746
  const videoBufferInfo = {
1747
1747
  userId: userId,
1748
1748
  buffer: (0, util_1.allocBuffer)(DEFAULT_VIDEO_WIDTH * DEFAULT_VIDEO_HEIGHT * this.pixelLength, userId, streamType),
@@ -2847,6 +2847,42 @@ class TRTCCloud extends events_1.EventEmitter {
2847
2847
  removeAllExcludedShareWindow() {
2848
2848
  this.rtcCloud.removeAllExcludedShareWindow();
2849
2849
  }
2850
+ /**
2851
+ * 8.16 将指定窗口加入屏幕分享的包含列表中(该接口仅支持桌面系统)
2852
+ *
2853
+ * @param {String} win - 希望被分享出去的窗口(Windows 平台下为窗口句柄: HWND)
2854
+ * - 该方法只有在 TRTCScreenCaptureSourceInfo 中的 type 指定为 TRTCScreenCaptureSourceTypeWindow 时生效,即分享窗口内容时,额外包含指定窗口的功能才生效。
2855
+ * - 您在 startScreenCapture 之前和之后调用均可。
2856
+ * - 通过该方法添加到包含列表中的窗口,会在退出房间后被 SDK 自动清除。
2857
+ */
2858
+ addIncludedShareWindow(win) {
2859
+ if (isNaN(+win)) {
2860
+ console.error('trtc:addIncludedShareWindow, win: ' + win + 'is not invalid!');
2861
+ return;
2862
+ }
2863
+ this.rtcCloud.addIncludedShareWindow(win);
2864
+ }
2865
+ /**
2866
+ * 8.17 将指定窗口从屏幕分享的包含列表中移除(该接口仅支持桌面系统)
2867
+ *
2868
+ * @param {String} win - 希望被分享出去的窗口(Mac 平台: 窗口 ID;Windows 平台: HWND)
2869
+ * - 该方法只有在 TRTCScreenCaptureSourceInfo 中的 type 指定为 TRTCScreenCaptureSourceTypeWindow 时生效,即分享窗口内容时,额外包含指定窗口的功能才生效。
2870
+ */
2871
+ removeIncludedShareWindow(win) {
2872
+ if (isNaN(+win)) {
2873
+ console.error('trtc:removeIncludedShareWindow, win: ' + win + 'is not invalid!');
2874
+ return;
2875
+ }
2876
+ this.rtcCloud.removeIncludedShareWindow(win);
2877
+ }
2878
+ /**
2879
+ * 8.18 将全部窗口从屏幕分享的包含列表中移除(该接口仅支持桌面系统)
2880
+ *
2881
+ * @note 该方法只有在 TRTCScreenCaptureSourceInfo 中的 type 指定为 TRTCScreenCaptureSourceTypeWindow 时生效,即分享窗口内容时,额外包含指定窗口的功能才生效。
2882
+ */
2883
+ removeAllIncludedShareWindow() {
2884
+ this.rtcCloud.removeAllIncludedShareWindow();
2885
+ }
2850
2886
  /////////////////////////////////////////////////////////////////////////////////
2851
2887
  //
2852
2888
  // (九)自定义采集和渲染
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trtc-electron-sdk",
3
- "version": "10.3.404-beta.1",
3
+ "version": "10.3.404-beta.2",
4
4
  "description": "trtc electron sdk",
5
5
  "main": "./liteav/trtc.js",
6
6
  "types": "./liteav/trtc.d.ts",