trtc-electron-sdk 11.0.501-beta.1 → 11.0.501
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 +1 -2
- package/liteav/trtc.js +2 -8
- package/package.json +3 -2
- package/scripts/download.js +18 -2
- package/scripts/utils.js +7 -0
package/liteav/trtc.d.ts
CHANGED
|
@@ -34,7 +34,6 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
34
34
|
private screenCaptureStreamType;
|
|
35
35
|
private isScreenCapturing;
|
|
36
36
|
private vodPlayers;
|
|
37
|
-
private isEnterRoom;
|
|
38
37
|
private isCaptureLocalVideoEnabled;
|
|
39
38
|
private localRotation;
|
|
40
39
|
private localMirrorType;
|
|
@@ -545,7 +544,7 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
545
544
|
* 当屏幕分享暂停时,SDK 会通过此回调通知
|
|
546
545
|
*
|
|
547
546
|
* @event TRTCCallback#onScreenCapturePaused
|
|
548
|
-
* @param {Number} reason - 停止原因,0:表示用户主动暂停;1
|
|
547
|
+
* @param {Number} reason - 停止原因,0:表示用户主动暂停;1:注意此字段的含义在 MAC 和 Windows 平台有稍微差异。屏幕窗口不可见暂停(Mac)。表示设置屏幕分享参数导致的暂停(Windows);2:表示屏幕分享窗口被最小化导致的暂停(仅 Windows);3:表示屏幕分享窗口被隐藏导致的暂停(仅 Windows)
|
|
549
548
|
*/
|
|
550
549
|
handleOnScreenCapturePaused(reason: number): void;
|
|
551
550
|
/**
|
package/liteav/trtc.js
CHANGED
|
@@ -184,7 +184,6 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
184
184
|
this.enableRenderFrame = true;
|
|
185
185
|
this.screenCaptureStreamType = trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeSub;
|
|
186
186
|
this.isScreenCapturing = false;
|
|
187
|
-
this.isEnterRoom = false;
|
|
188
187
|
this.isCaptureLocalVideoEnabled = false;
|
|
189
188
|
this.initEventHandler();
|
|
190
189
|
console.log('trtc:constructor pixelFormat:' + this.pixelFormat + '|sdk version:' + pkg.version +
|
|
@@ -253,7 +252,6 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
253
252
|
* 清理资源
|
|
254
253
|
*/
|
|
255
254
|
destroy() {
|
|
256
|
-
this.isEnterRoom = false;
|
|
257
255
|
this.firstVideoFrameList = [];
|
|
258
256
|
this.playAudioEffectIdList = [];
|
|
259
257
|
this.remoteFillModeMap.clear();
|
|
@@ -503,9 +501,6 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
503
501
|
*/
|
|
504
502
|
handleOnEnterRoom(result) {
|
|
505
503
|
this.fire('onEnterRoom', result);
|
|
506
|
-
if (result > 0) {
|
|
507
|
-
this.isEnterRoom = true;
|
|
508
|
-
}
|
|
509
504
|
const params = {
|
|
510
505
|
js_version: pkg.version,
|
|
511
506
|
electron_version: process && process.versions && process.versions.electron || '',
|
|
@@ -528,7 +523,6 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
528
523
|
*/
|
|
529
524
|
handleOnExitRoom(reason) {
|
|
530
525
|
this.firstVideoFrameList = [];
|
|
531
|
-
this.isEnterRoom = false;
|
|
532
526
|
this.fire('onExitRoom', reason);
|
|
533
527
|
}
|
|
534
528
|
/**
|
|
@@ -1134,7 +1128,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
1134
1128
|
* 当屏幕分享暂停时,SDK 会通过此回调通知
|
|
1135
1129
|
*
|
|
1136
1130
|
* @event TRTCCallback#onScreenCapturePaused
|
|
1137
|
-
* @param {Number} reason - 停止原因,0:表示用户主动暂停;1
|
|
1131
|
+
* @param {Number} reason - 停止原因,0:表示用户主动暂停;1:注意此字段的含义在 MAC 和 Windows 平台有稍微差异。屏幕窗口不可见暂停(Mac)。表示设置屏幕分享参数导致的暂停(Windows);2:表示屏幕分享窗口被最小化导致的暂停(仅 Windows);3:表示屏幕分享窗口被隐藏导致的暂停(仅 Windows)
|
|
1138
1132
|
*/
|
|
1139
1133
|
handleOnScreenCapturePaused(reason) {
|
|
1140
1134
|
this.fire('onScreenCapturePaused', reason);
|
|
@@ -4084,7 +4078,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
4084
4078
|
}
|
|
4085
4079
|
});
|
|
4086
4080
|
}
|
|
4087
|
-
if (uid.length == 0 && this.
|
|
4081
|
+
if (uid.length == 0 && this.isCaptureLocalVideoEnabled) {
|
|
4088
4082
|
this.fire(LOCAL_VIDEO_DATA, {
|
|
4089
4083
|
uid: '', type, rotation, timestamp,
|
|
4090
4084
|
pixelFormat: this.pixelFormat,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trtc-electron-sdk",
|
|
3
|
-
"version": "11.0.501
|
|
3
|
+
"version": "11.0.501",
|
|
4
4
|
"description": "trtc electron sdk",
|
|
5
5
|
"main": "./liteav/trtc.js",
|
|
6
6
|
"types": "./liteav/trtc.d.ts",
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
"semver": "^6.0.0",
|
|
16
16
|
"signale": "^1.4.0",
|
|
17
17
|
"yuv-buffer": "^1.0.0",
|
|
18
|
-
"yuv-canvas": "^1.2.6"
|
|
18
|
+
"yuv-canvas": "^1.2.6",
|
|
19
|
+
"hpagent": "^1.2.0"
|
|
19
20
|
},
|
|
20
21
|
"devDependencies": {
|
|
21
22
|
"@babel/cli": "^7.11.6",
|
package/scripts/download.js
CHANGED
|
@@ -4,6 +4,7 @@ const fs = require('fs-extra');
|
|
|
4
4
|
const rimraf = require('rimraf');
|
|
5
5
|
const signale = require('signale');
|
|
6
6
|
const { exec } = require('child_process');
|
|
7
|
+
const { HttpsProxyAgent } = require('hpagent');
|
|
7
8
|
|
|
8
9
|
const {
|
|
9
10
|
readCliArgv,
|
|
@@ -11,6 +12,7 @@ const {
|
|
|
11
12
|
detectOS,
|
|
12
13
|
detectOwnVersion,
|
|
13
14
|
detectOwnName,
|
|
15
|
+
readProxyUrlFromEnv,
|
|
14
16
|
} = require('./utils');
|
|
15
17
|
const { Platform } = require('./constant');
|
|
16
18
|
|
|
@@ -68,10 +70,24 @@ const main = () => {
|
|
|
68
70
|
signale.info('Download Url =', downloadUrl, '\n');
|
|
69
71
|
|
|
70
72
|
signale.pending('Downloading C++ addon Electron SDK...\n');
|
|
71
|
-
|
|
73
|
+
const downloadOptions = {
|
|
72
74
|
strip: 0,
|
|
73
75
|
extract: true
|
|
74
|
-
}
|
|
76
|
+
};
|
|
77
|
+
const proxyUrl = readProxyUrlFromEnv(downloadUrl);
|
|
78
|
+
if (proxyUrl) {
|
|
79
|
+
downloadOptions.agent = {
|
|
80
|
+
https: new HttpsProxyAgent({
|
|
81
|
+
keepAlive: true,
|
|
82
|
+
keepAliveMsecs: 1000,
|
|
83
|
+
maxSockets: 256,
|
|
84
|
+
maxFreeSockets: 256,
|
|
85
|
+
scheduling: 'lifo',
|
|
86
|
+
proxy: proxyUrl
|
|
87
|
+
})
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
download(downloadUrl, outputDir, downloadOptions).then(() => {
|
|
75
91
|
signale.success(`Download finished - ${platform}`);
|
|
76
92
|
|
|
77
93
|
fs.copySync(
|
package/scripts/utils.js
CHANGED
|
@@ -27,6 +27,13 @@ module.exports.readCliArgv = function() {
|
|
|
27
27
|
return newArgv;
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
+
module.exports.readProxyUrlFromEnv = function(downloadUrl) {
|
|
31
|
+
if (downloadUrl.indexOf('https') === 0) {
|
|
32
|
+
return process.env.https_proxy || ''
|
|
33
|
+
}
|
|
34
|
+
return process.env.http_proxy || '';
|
|
35
|
+
}
|
|
36
|
+
|
|
30
37
|
module.exports.readArgvFromNpmEnv = function() {
|
|
31
38
|
const result = {};
|
|
32
39
|
if (process.env.npm_config_trtc_electron_arch) {
|