trtc-electron-sdk 10.3.404-beta.0 → 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.
- package/liteav/Renderer/types.d.ts +2 -2
- package/liteav/trtc.d.ts +24 -2
- package/liteav/trtc.js +150 -32
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TRTCVideoFillMode } from "../trtc_define";
|
|
2
|
-
export
|
|
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
|
|
10
|
+
export type TCanvasImageSourceStyleOptions = {
|
|
11
11
|
contentWidth: number;
|
|
12
12
|
contentHeight: number;
|
|
13
13
|
containerWidth: number;
|
package/liteav/trtc.d.ts
CHANGED
|
@@ -1066,11 +1066,11 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
1066
1066
|
* 如果该 userId 没有开启双路编码模式,则此操作无效。
|
|
1067
1067
|
*
|
|
1068
1068
|
* @param {String} userId - 用户 ID
|
|
1069
|
-
* @param {TRTCVideoStreamType}
|
|
1069
|
+
* @param {TRTCVideoStreamType} streamType - 视频流类型,即选择看大画面还是小画面,默认为 TRTCVideoStreamTypeBig
|
|
1070
1070
|
* - TRTCVideoStreamTypeBig : 大画面视频流
|
|
1071
1071
|
* - TRTCVideoStreamTypeSmall: 小画面视频流
|
|
1072
1072
|
*/
|
|
1073
|
-
setRemoteVideoStreamType(userId: string,
|
|
1073
|
+
setRemoteVideoStreamType(userId: string, streamType: TRTCVideoStreamType): void;
|
|
1074
1074
|
/**
|
|
1075
1075
|
* 3.22 视频画面截图
|
|
1076
1076
|
*
|
|
@@ -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
|
@@ -619,10 +619,16 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
619
619
|
return !(userId === item.uid && item.type !== trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeSub);
|
|
620
620
|
});
|
|
621
621
|
}
|
|
622
|
-
const
|
|
623
|
-
if (
|
|
624
|
-
|
|
625
|
-
|
|
622
|
+
const remoteUserVideoBuffers = remoteVideoBufferMap.get(userId);
|
|
623
|
+
if (remoteUserVideoBuffers) {
|
|
624
|
+
if (remoteUserVideoBuffers.big) {
|
|
625
|
+
this.rtcCloud.setRemoteVideoBuffer(userId, remoteUserVideoBuffers.big.buffer, remoteUserVideoBuffers.big.streamType, 0, 0, remoteUserVideoBuffers.big.pixelFormat);
|
|
626
|
+
remoteUserVideoBuffers.big.buffer = null;
|
|
627
|
+
}
|
|
628
|
+
if (remoteUserVideoBuffers.small) {
|
|
629
|
+
this.rtcCloud.setRemoteVideoBuffer(userId, remoteUserVideoBuffers.small.buffer, remoteUserVideoBuffers.small.streamType, 0, 0, remoteUserVideoBuffers.small.pixelFormat);
|
|
630
|
+
remoteUserVideoBuffers.small.buffer = null;
|
|
631
|
+
}
|
|
626
632
|
remoteVideoBufferMap.delete(userId);
|
|
627
633
|
}
|
|
628
634
|
}
|
|
@@ -1078,7 +1084,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
1078
1084
|
*/
|
|
1079
1085
|
handleOnScreenCaptureStarted() {
|
|
1080
1086
|
this.isScreenCapturing = true;
|
|
1081
|
-
// 只有在 Buffer 为 null 时才新建,否则只能在 handleVideoSizeChange 事件中重新申请 Buffer
|
|
1087
|
+
// 只有在 Buffer 为 null 时才新建,否则只能在 handleVideoSizeChange 事件中重新申请 Buffer
|
|
1082
1088
|
if (!screenVideoBuffer.buffer) {
|
|
1083
1089
|
screenVideoBuffer.userId = '';
|
|
1084
1090
|
screenVideoBuffer.streamType = this.screenCaptureStreamType;
|
|
@@ -1215,14 +1221,25 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
1215
1221
|
console.debug('trtc:handleVideoSizeChange', userId, streamType, width, height);
|
|
1216
1222
|
if (userId && userId !== CAMERA_DEVICE_TEST_ID) {
|
|
1217
1223
|
if (streamType !== trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeSub) {
|
|
1218
|
-
const
|
|
1219
|
-
if (
|
|
1220
|
-
if (
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1224
|
+
const remoteUserVideoBuffers = remoteVideoBufferMap.get(userId);
|
|
1225
|
+
if (remoteUserVideoBuffers) {
|
|
1226
|
+
if (streamType === trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeBig && remoteUserVideoBuffers.big) {
|
|
1227
|
+
if (remoteUserVideoBuffers.big.width !== width || remoteUserVideoBuffers.big.height !== height) {
|
|
1228
|
+
remoteUserVideoBuffers.big.buffer = (0, util_1.allocBuffer)(width * height * this.pixelLength, userId, streamType);
|
|
1229
|
+
remoteUserVideoBuffers.big.width = width;
|
|
1230
|
+
remoteUserVideoBuffers.big.height = height;
|
|
1231
|
+
remoteUserVideoBuffers.big.pixelFormat = this.pixelformate;
|
|
1232
|
+
this.rtcCloud.setRemoteVideoBuffer(userId, remoteUserVideoBuffers.big.buffer, streamType, width, height, remoteUserVideoBuffers.big.pixelFormat);
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1235
|
+
else if (streamType === trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeSmall && remoteUserVideoBuffers.small) {
|
|
1236
|
+
if (remoteUserVideoBuffers.small.width !== width || remoteUserVideoBuffers.small.height !== height) {
|
|
1237
|
+
remoteUserVideoBuffers.small.buffer = (0, util_1.allocBuffer)(width * height * this.pixelLength, userId, streamType);
|
|
1238
|
+
remoteUserVideoBuffers.small.width = width;
|
|
1239
|
+
remoteUserVideoBuffers.small.height = height;
|
|
1240
|
+
remoteUserVideoBuffers.small.pixelFormat = this.pixelformate;
|
|
1241
|
+
this.rtcCloud.setRemoteVideoBuffer(userId, remoteUserVideoBuffers.small.buffer, streamType, width, height, remoteUserVideoBuffers.small.pixelFormat);
|
|
1242
|
+
}
|
|
1226
1243
|
}
|
|
1227
1244
|
}
|
|
1228
1245
|
else {
|
|
@@ -1345,8 +1362,14 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
1345
1362
|
this._destroyRender(key, null);
|
|
1346
1363
|
});
|
|
1347
1364
|
remoteVideoBufferMap.forEach((value, key) => {
|
|
1348
|
-
|
|
1349
|
-
|
|
1365
|
+
if (value.big) {
|
|
1366
|
+
this.rtcCloud.setRemoteVideoBuffer(key, value.big.buffer, value.big.streamType, 0, 0, value.big.pixelFormat);
|
|
1367
|
+
value.big.buffer = null;
|
|
1368
|
+
}
|
|
1369
|
+
if (value.small) {
|
|
1370
|
+
this.rtcCloud.setRemoteVideoBuffer(key, value.small.buffer, value.small.streamType, 0, 0, value.small.pixelFormat);
|
|
1371
|
+
value.small.buffer = null;
|
|
1372
|
+
}
|
|
1350
1373
|
});
|
|
1351
1374
|
remoteVideoBufferMap.clear();
|
|
1352
1375
|
if (localVideoBuffer.buffer) {
|
|
@@ -1640,7 +1663,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
1640
1663
|
this._initRender(key, view);
|
|
1641
1664
|
}
|
|
1642
1665
|
// view 为 null 时,可能启动了自定义渲染,所以 Buffer 还是要创建,否则自定义渲染就拿不到数据;
|
|
1643
|
-
// view 非 null 时,当然必须创建 Buffer
|
|
1666
|
+
// view 非 null 时,当然必须创建 Buffer
|
|
1644
1667
|
// 只有在 Buffer 为 null 时才新建,否则只能在 handleVideoSizeChange 事件中重新申请 Buffer
|
|
1645
1668
|
if (!localVideoBuffer.buffer) {
|
|
1646
1669
|
localVideoBuffer.streamType = trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeBig;
|
|
@@ -1719,7 +1742,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
1719
1742
|
this._initRender(key, view);
|
|
1720
1743
|
}
|
|
1721
1744
|
// view 为 null 时,可能启动了自定义渲染,所以 Buffer 还是要创建,否则自定义渲染就拿不到数据;
|
|
1722
|
-
// view 非 null 时,当然必须创建 Buffer
|
|
1745
|
+
// view 非 null 时,当然必须创建 Buffer
|
|
1723
1746
|
const videoBufferInfo = {
|
|
1724
1747
|
userId: userId,
|
|
1725
1748
|
buffer: (0, util_1.allocBuffer)(DEFAULT_VIDEO_WIDTH * DEFAULT_VIDEO_HEIGHT * this.pixelLength, userId, streamType),
|
|
@@ -1729,11 +1752,27 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
1729
1752
|
pixelFormat: this.pixelformate,
|
|
1730
1753
|
};
|
|
1731
1754
|
if (streamType !== trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeSub) {
|
|
1732
|
-
|
|
1755
|
+
const remoteUserVideoBuffers = remoteVideoBufferMap.get(userId);
|
|
1756
|
+
if (!remoteUserVideoBuffers) {
|
|
1733
1757
|
// Buffer 不存在时才新建,否则只能在 handleVideoSizeChange 事件中重新申请 Buffer
|
|
1734
|
-
|
|
1758
|
+
if (streamType === trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeBig) {
|
|
1759
|
+
remoteVideoBufferMap.set(userId, { big: videoBufferInfo });
|
|
1760
|
+
}
|
|
1761
|
+
else if (streamType === trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeSmall) {
|
|
1762
|
+
remoteVideoBufferMap.set(userId, { small: videoBufferInfo });
|
|
1763
|
+
}
|
|
1735
1764
|
this.rtcCloud.setRemoteVideoBuffer(userId, videoBufferInfo.buffer, videoBufferInfo.streamType, videoBufferInfo.width, videoBufferInfo.height, videoBufferInfo.pixelFormat);
|
|
1736
1765
|
}
|
|
1766
|
+
else {
|
|
1767
|
+
if (streamType === trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeBig && !remoteUserVideoBuffers.big) {
|
|
1768
|
+
remoteUserVideoBuffers.big = videoBufferInfo;
|
|
1769
|
+
this.rtcCloud.setRemoteVideoBuffer(userId, videoBufferInfo.buffer, videoBufferInfo.streamType, videoBufferInfo.width, videoBufferInfo.height, videoBufferInfo.pixelFormat);
|
|
1770
|
+
}
|
|
1771
|
+
else if (streamType === trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeSmall && !remoteUserVideoBuffers.small) {
|
|
1772
|
+
remoteUserVideoBuffers.small = videoBufferInfo;
|
|
1773
|
+
this.rtcCloud.setRemoteVideoBuffer(userId, videoBufferInfo.buffer, videoBufferInfo.streamType, videoBufferInfo.width, videoBufferInfo.height, videoBufferInfo.pixelFormat);
|
|
1774
|
+
}
|
|
1775
|
+
}
|
|
1737
1776
|
}
|
|
1738
1777
|
else {
|
|
1739
1778
|
// 远端屏幕分享
|
|
@@ -1765,11 +1804,21 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
1765
1804
|
let key = this.getKey(userId, streamType);
|
|
1766
1805
|
this._destroyRender(key, null);
|
|
1767
1806
|
this.rtcCloud.stopRemoteView(userId, streamType);
|
|
1768
|
-
const
|
|
1769
|
-
if (
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1807
|
+
const remoteUserVideoBuffers = remoteVideoBufferMap.get(userId);
|
|
1808
|
+
if (remoteUserVideoBuffers && streamType !== trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeSub) {
|
|
1809
|
+
if (streamType === trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeBig && remoteUserVideoBuffers.big) {
|
|
1810
|
+
this.rtcCloud.setRemoteVideoBuffer(userId, remoteUserVideoBuffers.big.buffer, remoteUserVideoBuffers.big.streamType, 0, 0, remoteUserVideoBuffers.big.pixelFormat);
|
|
1811
|
+
remoteUserVideoBuffers.big.buffer = null;
|
|
1812
|
+
remoteUserVideoBuffers.big = undefined;
|
|
1813
|
+
}
|
|
1814
|
+
else if (streamType === trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeSmall && remoteUserVideoBuffers.small) {
|
|
1815
|
+
this.rtcCloud.setRemoteVideoBuffer(userId, remoteUserVideoBuffers.small.buffer, remoteUserVideoBuffers.small.streamType, 0, 0, remoteUserVideoBuffers.small.pixelFormat);
|
|
1816
|
+
remoteUserVideoBuffers.small.buffer = null;
|
|
1817
|
+
remoteUserVideoBuffers.small = undefined;
|
|
1818
|
+
}
|
|
1819
|
+
if (!remoteUserVideoBuffers.big && !remoteUserVideoBuffers.small) {
|
|
1820
|
+
remoteVideoBufferMap.delete(userId);
|
|
1821
|
+
}
|
|
1773
1822
|
}
|
|
1774
1823
|
else if (screenVideoBuffer.userId === userId && screenVideoBuffer.streamType === streamType) {
|
|
1775
1824
|
this.rtcCloud.setSubVideoBuffer(userId, screenVideoBuffer.buffer, screenVideoBuffer.streamType, 0, 0, screenVideoBuffer.pixelFormat);
|
|
@@ -1791,8 +1840,14 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
1791
1840
|
});
|
|
1792
1841
|
this.rtcCloud.stopAllRemoteView();
|
|
1793
1842
|
remoteVideoBufferMap.forEach((value, key) => {
|
|
1794
|
-
|
|
1795
|
-
|
|
1843
|
+
if (value.big) {
|
|
1844
|
+
this.rtcCloud.setRemoteVideoBuffer(key, value.big.buffer, value.big.streamType, 0, 0, value.big.pixelFormat);
|
|
1845
|
+
value.big.buffer = null;
|
|
1846
|
+
}
|
|
1847
|
+
if (value.small) {
|
|
1848
|
+
this.rtcCloud.setRemoteVideoBuffer(key, value.small.buffer, value.small.streamType, 0, 0, value.small.pixelFormat);
|
|
1849
|
+
value.small.buffer = null;
|
|
1850
|
+
}
|
|
1796
1851
|
});
|
|
1797
1852
|
remoteVideoBufferMap.clear();
|
|
1798
1853
|
if (screenVideoBuffer.buffer && !this.isScreenCapturing) {
|
|
@@ -2055,12 +2110,34 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
2055
2110
|
* 如果该 userId 没有开启双路编码模式,则此操作无效。
|
|
2056
2111
|
*
|
|
2057
2112
|
* @param {String} userId - 用户 ID
|
|
2058
|
-
* @param {TRTCVideoStreamType}
|
|
2113
|
+
* @param {TRTCVideoStreamType} streamType - 视频流类型,即选择看大画面还是小画面,默认为 TRTCVideoStreamTypeBig
|
|
2059
2114
|
* - TRTCVideoStreamTypeBig : 大画面视频流
|
|
2060
2115
|
* - TRTCVideoStreamTypeSmall: 小画面视频流
|
|
2061
2116
|
*/
|
|
2062
|
-
setRemoteVideoStreamType(userId,
|
|
2063
|
-
|
|
2117
|
+
setRemoteVideoStreamType(userId, streamType) {
|
|
2118
|
+
const remoteUserVideoBuffers = remoteVideoBufferMap.get(userId);
|
|
2119
|
+
if (remoteUserVideoBuffers) {
|
|
2120
|
+
const videoBufferInfo = {
|
|
2121
|
+
userId: userId,
|
|
2122
|
+
buffer: (0, util_1.allocBuffer)(DEFAULT_VIDEO_WIDTH * DEFAULT_VIDEO_HEIGHT * this.pixelLength, userId, streamType),
|
|
2123
|
+
streamType: streamType,
|
|
2124
|
+
width: DEFAULT_VIDEO_WIDTH,
|
|
2125
|
+
height: DEFAULT_VIDEO_HEIGHT,
|
|
2126
|
+
pixelFormat: this.pixelformate,
|
|
2127
|
+
};
|
|
2128
|
+
if (streamType === trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeBig && !remoteUserVideoBuffers.big) {
|
|
2129
|
+
remoteUserVideoBuffers.big = videoBufferInfo;
|
|
2130
|
+
this.rtcCloud.setRemoteVideoBuffer(userId, videoBufferInfo.buffer, videoBufferInfo.streamType, videoBufferInfo.width, videoBufferInfo.height, videoBufferInfo.pixelFormat);
|
|
2131
|
+
}
|
|
2132
|
+
else if (streamType === trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeSmall && !remoteUserVideoBuffers.small) {
|
|
2133
|
+
remoteUserVideoBuffers.small = videoBufferInfo;
|
|
2134
|
+
this.rtcCloud.setRemoteVideoBuffer(userId, videoBufferInfo.buffer, videoBufferInfo.streamType, videoBufferInfo.width, videoBufferInfo.height, videoBufferInfo.pixelFormat);
|
|
2135
|
+
}
|
|
2136
|
+
else {
|
|
2137
|
+
videoBufferInfo.buffer = null;
|
|
2138
|
+
}
|
|
2139
|
+
}
|
|
2140
|
+
this.rtcCloud.setRemoteVideoStreamType(userId, streamType);
|
|
2064
2141
|
}
|
|
2065
2142
|
/**
|
|
2066
2143
|
* 3.22 视频画面截图
|
|
@@ -2770,6 +2847,42 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
2770
2847
|
removeAllExcludedShareWindow() {
|
|
2771
2848
|
this.rtcCloud.removeAllExcludedShareWindow();
|
|
2772
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
|
+
}
|
|
2773
2886
|
/////////////////////////////////////////////////////////////////////////////////
|
|
2774
2887
|
//
|
|
2775
2888
|
// (九)自定义采集和渲染
|
|
@@ -3493,9 +3606,14 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
3493
3606
|
this.rtcCloud.addRemoteVideoRenderCallback(userId, (id, type, width, height, timestamp, rotation, valid) => {
|
|
3494
3607
|
if (this.enableRenderFrame) {
|
|
3495
3608
|
if (valid === 1) {
|
|
3496
|
-
const
|
|
3497
|
-
if (
|
|
3498
|
-
|
|
3609
|
+
const remoteUserVideoBuffers = remoteVideoBufferMap.get(id);
|
|
3610
|
+
if (remoteUserVideoBuffers && type !== trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeSub) {
|
|
3611
|
+
if (type === trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeBig && remoteUserVideoBuffers.big) {
|
|
3612
|
+
this._onRenderFrame(id, type, width, height, timestamp, rotation, remoteUserVideoBuffers.big.buffer);
|
|
3613
|
+
}
|
|
3614
|
+
else if (type === trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeSmall && remoteUserVideoBuffers.small) {
|
|
3615
|
+
this._onRenderFrame(id, type, width, height, timestamp, rotation, remoteUserVideoBuffers.small.buffer);
|
|
3616
|
+
}
|
|
3499
3617
|
}
|
|
3500
3618
|
else {
|
|
3501
3619
|
this._onRenderFrame(id, type, width, height, timestamp, rotation, screenVideoBuffer.buffer);
|