trtc-electron-sdk 12.3.705-beta.2 → 12.3.705-beta.3
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/MediaMixingDesigner/Resizable.js +6 -6
- package/liteav/VideoRenderControl/VideoRenderFPSMonitor.d.ts +2 -1
- package/liteav/VideoRenderControl/VideoRenderFPSMonitor.js +25 -12
- package/liteav/trtc.d.ts +9 -8
- package/liteav/trtc.js +39 -10
- package/liteav/trtc_define.d.ts +2 -2
- package/liteav/trtc_define.js +1 -1
- package/package.json +1 -1
|
@@ -24,8 +24,8 @@ const ResizeAnchorCSSClass = {
|
|
|
24
24
|
const ResizeAnchorStyle = {
|
|
25
25
|
resizeAnchor: {
|
|
26
26
|
position: 'absolute',
|
|
27
|
-
width: '
|
|
28
|
-
height: '
|
|
27
|
+
width: '8px',
|
|
28
|
+
height: '8px',
|
|
29
29
|
border: '1px solid transparent',
|
|
30
30
|
backgroundColor: 'transparent'
|
|
31
31
|
},
|
|
@@ -36,7 +36,7 @@ const ResizeAnchorStyle = {
|
|
|
36
36
|
},
|
|
37
37
|
topAnchor: {
|
|
38
38
|
top: '0',
|
|
39
|
-
left: 'calc(50% -
|
|
39
|
+
left: 'calc(50% - 4px)',
|
|
40
40
|
cursor: 'n-resize'
|
|
41
41
|
},
|
|
42
42
|
topRightAnchor: {
|
|
@@ -45,12 +45,12 @@ const ResizeAnchorStyle = {
|
|
|
45
45
|
cursor: 'ne-resize'
|
|
46
46
|
},
|
|
47
47
|
leftAnchor: {
|
|
48
|
-
top: 'calc(50% -
|
|
48
|
+
top: 'calc(50% - 4px)',
|
|
49
49
|
left: '0',
|
|
50
50
|
cursor: 'w-resize'
|
|
51
51
|
},
|
|
52
52
|
rightAnchor: {
|
|
53
|
-
top: 'calc(50% -
|
|
53
|
+
top: 'calc(50% - 4px)',
|
|
54
54
|
right: '0',
|
|
55
55
|
cursor: 'e-resize'
|
|
56
56
|
},
|
|
@@ -61,7 +61,7 @@ const ResizeAnchorStyle = {
|
|
|
61
61
|
},
|
|
62
62
|
bottomAnchor: {
|
|
63
63
|
bottom: '0',
|
|
64
|
-
left: 'calc(50% -
|
|
64
|
+
left: 'calc(50% - 4px)',
|
|
65
65
|
cursor: 's-resize'
|
|
66
66
|
},
|
|
67
67
|
bottomRightAnchor: {
|
|
@@ -23,13 +23,28 @@ class VideoRenderFPSMonitor {
|
|
|
23
23
|
this.statisticDuration = 2000;
|
|
24
24
|
this.statisticPageRefreshFPS = this.statisticPageRefreshFPS.bind(this);
|
|
25
25
|
this.onVisibilityChange = this.onVisibilityChange.bind(this);
|
|
26
|
-
this.
|
|
27
|
-
document.addEventListener('visibilitychange', this.onVisibilityChange);
|
|
26
|
+
this.start();
|
|
28
27
|
}
|
|
29
|
-
|
|
28
|
+
start() {
|
|
29
|
+
logger_1.default.debug(`${this.logPrefix}start`);
|
|
30
30
|
if (window.requestAnimationFrame) {
|
|
31
31
|
this.nextAnimationFrame = window.requestAnimationFrame(this.statisticPageRefreshFPS);
|
|
32
32
|
}
|
|
33
|
+
document.addEventListener('visibilitychange', this.onVisibilityChange);
|
|
34
|
+
}
|
|
35
|
+
stop() {
|
|
36
|
+
logger_1.default.debug(`${this.logPrefix}stop`);
|
|
37
|
+
if (this.nextAnimationFrame !== 0) {
|
|
38
|
+
window.cancelAnimationFrame(this.nextAnimationFrame);
|
|
39
|
+
this.nextAnimationFrame = 0;
|
|
40
|
+
}
|
|
41
|
+
document.removeEventListener('visibilitychange', this.onVisibilityChange);
|
|
42
|
+
this.lastTimestamp = 0;
|
|
43
|
+
this.refreshCount = 0;
|
|
44
|
+
this.pageRefreshFPS = 0;
|
|
45
|
+
this.lastPageRefreshFPS = 60;
|
|
46
|
+
this.videoRenderFPS = 0;
|
|
47
|
+
this.lastVideoRenderFPS = -1;
|
|
33
48
|
}
|
|
34
49
|
statisticPageRefreshFPS(timestamp) {
|
|
35
50
|
if (this.lastTimestamp === 0) {
|
|
@@ -100,18 +115,16 @@ class VideoRenderFPSMonitor {
|
|
|
100
115
|
}
|
|
101
116
|
notifyFPS() {
|
|
102
117
|
logger_1.default.debug(`${this.logPrefix} pageRefreshFPS:${this.pageRefreshFPS} videoRenderFPS: ${this.videoRenderFPS}`);
|
|
103
|
-
this.emit('videoRenderFPS', {
|
|
104
|
-
pageFPS: this.pageRefreshFPS,
|
|
105
|
-
videoFPS: this.videoRenderFPS,
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
destroy() {
|
|
109
118
|
if (this.nextAnimationFrame) {
|
|
110
|
-
|
|
111
|
-
|
|
119
|
+
this.emit('videoRenderFPS', {
|
|
120
|
+
pageFPS: this.pageRefreshFPS,
|
|
121
|
+
videoFPS: this.videoRenderFPS,
|
|
122
|
+
});
|
|
112
123
|
}
|
|
124
|
+
}
|
|
125
|
+
destroy() {
|
|
126
|
+
this.stop();
|
|
113
127
|
this.emitter.removeAllListeners();
|
|
114
|
-
document.removeEventListener('visibilitychange', this.onVisibilityChange);
|
|
115
128
|
}
|
|
116
129
|
on(event, listener) {
|
|
117
130
|
this.emitter.on(event, listener);
|
package/liteav/trtc.d.ts
CHANGED
|
@@ -2768,14 +2768,6 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
2768
2768
|
* @param {Function | null} callback - 日志回调。 Function 的参数格式为 (log:string, level:TRTCLogLevel, module:string) => void。
|
|
2769
2769
|
*/
|
|
2770
2770
|
setLogCallback(callback?: (log: string, level: TRTCLogLevel, module: string) => void | null): void;
|
|
2771
|
-
/**
|
|
2772
|
-
* 调用实验性 API 接口
|
|
2773
|
-
*
|
|
2774
|
-
* 注意:该接口用于调用一些实验性功能
|
|
2775
|
-
*
|
|
2776
|
-
* @param {String} jsonStr - 接口及参数描述的 JSON 字符串
|
|
2777
|
-
*/
|
|
2778
|
-
callExperimentalAPI(jsonStr: string): void;
|
|
2779
2771
|
private _localVideoRenderCallback;
|
|
2780
2772
|
addLocalVideoRenderCallback(): void;
|
|
2781
2773
|
removeLocalVideoRenderCallback(): void;
|
|
@@ -2940,5 +2932,14 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
2940
2932
|
* @returns {TRTCPluginManager}
|
|
2941
2933
|
*/
|
|
2942
2934
|
private getPluginManager;
|
|
2935
|
+
/**
|
|
2936
|
+
* 调用实验性 API 接口
|
|
2937
|
+
*
|
|
2938
|
+
* 注意:该接口用于调用一些实验性功能
|
|
2939
|
+
*
|
|
2940
|
+
* @param {String} jsonStr - 接口及参数描述的 JSON 字符串
|
|
2941
|
+
*/
|
|
2942
|
+
callExperimentalAPI(jsonStr: string): void;
|
|
2943
|
+
private disableLocalRenderFPSOptimization;
|
|
2943
2944
|
}
|
|
2944
2945
|
export default TRTCCloud;
|
package/liteav/trtc.js
CHANGED
|
@@ -4617,16 +4617,6 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
4617
4617
|
setLogCallback(callback) {
|
|
4618
4618
|
this.rtcCloud.setLogCallback(callback);
|
|
4619
4619
|
}
|
|
4620
|
-
/**
|
|
4621
|
-
* 调用实验性 API 接口
|
|
4622
|
-
*
|
|
4623
|
-
* 注意:该接口用于调用一些实验性功能
|
|
4624
|
-
*
|
|
4625
|
-
* @param {String} jsonStr - 接口及参数描述的 JSON 字符串
|
|
4626
|
-
*/
|
|
4627
|
-
callExperimentalAPI(jsonStr) {
|
|
4628
|
-
this.rtcCloud.callExperimentalAPI(jsonStr);
|
|
4629
|
-
}
|
|
4630
4620
|
/////////////////////////////////////////////////////////////////////////////////
|
|
4631
4621
|
//
|
|
4632
4622
|
// (十五) 废弃接口函数
|
|
@@ -5334,6 +5324,45 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
5334
5324
|
getPluginManager() {
|
|
5335
5325
|
return this.pluginManager;
|
|
5336
5326
|
}
|
|
5327
|
+
/////////////////////////////////////////////////////////////////////////////////
|
|
5328
|
+
//
|
|
5329
|
+
// 实验接口
|
|
5330
|
+
//
|
|
5331
|
+
/////////////////////////////////////////////////////////////////////////////////
|
|
5332
|
+
/**
|
|
5333
|
+
* 调用实验性 API 接口
|
|
5334
|
+
*
|
|
5335
|
+
* 注意:该接口用于调用一些实验性功能
|
|
5336
|
+
*
|
|
5337
|
+
* @param {String} jsonStr - 接口及参数描述的 JSON 字符串
|
|
5338
|
+
*/
|
|
5339
|
+
callExperimentalAPI(jsonStr) {
|
|
5340
|
+
try {
|
|
5341
|
+
const json = JSON.parse(jsonStr);
|
|
5342
|
+
const { api, params } = json;
|
|
5343
|
+
if (this[api] && typeof this[api] === 'function') {
|
|
5344
|
+
this[api](params);
|
|
5345
|
+
}
|
|
5346
|
+
else {
|
|
5347
|
+
this.rtcCloud.callExperimentalAPI(jsonStr);
|
|
5348
|
+
}
|
|
5349
|
+
}
|
|
5350
|
+
catch (error) {
|
|
5351
|
+
this.logger.warn(`callExperimentalAPI invalid JSON parameter`, error);
|
|
5352
|
+
}
|
|
5353
|
+
}
|
|
5354
|
+
disableLocalRenderFPSOptimization(params) {
|
|
5355
|
+
this.videoRenderFPS = 60;
|
|
5356
|
+
if (params.disable === true) {
|
|
5357
|
+
VideoRenderFPSMonitor_1.videoRenderFPSMonitor.stop();
|
|
5358
|
+
}
|
|
5359
|
+
else {
|
|
5360
|
+
VideoRenderFPSMonitor_1.videoRenderFPSMonitor.start();
|
|
5361
|
+
}
|
|
5362
|
+
if (!TRTCCloud.isIPCMode) {
|
|
5363
|
+
this.rtcCloud.setVideoRenderFPS(this.videoRenderFPS);
|
|
5364
|
+
}
|
|
5365
|
+
}
|
|
5337
5366
|
}
|
|
5338
5367
|
class VideoRenderCallback {
|
|
5339
5368
|
constructor() {
|
package/liteav/trtc_define.d.ts
CHANGED
|
@@ -234,7 +234,7 @@ export declare class TRTCVideoFrame {
|
|
|
234
234
|
* 音频帧数据
|
|
235
235
|
*
|
|
236
236
|
* @param {TRTCAudioFrameFormat} audioFormat - 音频帧的格式
|
|
237
|
-
* @param {ArrayBuffer} data - 音频数据
|
|
237
|
+
* @param {Buffer|ArrayBuffer} data - 音频数据
|
|
238
238
|
* @param {Number} length - 音频数据的长度
|
|
239
239
|
* @param {Number} sampleRate - 采样率
|
|
240
240
|
* @param {Number} channel - 声道数
|
|
@@ -244,7 +244,7 @@ export declare class TRTCVideoFrame {
|
|
|
244
244
|
*/
|
|
245
245
|
export declare class TRTCAudioFrame {
|
|
246
246
|
audioFormat: TRTCAudioFrameFormat;
|
|
247
|
-
data: ArrayBuffer | null;
|
|
247
|
+
data: Buffer | ArrayBuffer | null;
|
|
248
248
|
length: number;
|
|
249
249
|
sampleRate: number;
|
|
250
250
|
channel: number;
|
package/liteav/trtc_define.js
CHANGED
|
@@ -651,7 +651,7 @@ exports.TRTCVideoFrame = TRTCVideoFrame;
|
|
|
651
651
|
* 音频帧数据
|
|
652
652
|
*
|
|
653
653
|
* @param {TRTCAudioFrameFormat} audioFormat - 音频帧的格式
|
|
654
|
-
* @param {ArrayBuffer} data - 音频数据
|
|
654
|
+
* @param {Buffer|ArrayBuffer} data - 音频数据
|
|
655
655
|
* @param {Number} length - 音频数据的长度
|
|
656
656
|
* @param {Number} sampleRate - 采样率
|
|
657
657
|
* @param {Number} channel - 声道数
|