trtc-electron-sdk 10.3.404 → 10.6.115-beta.1
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/LocalMediaTranscoder/index.d.ts +359 -0
- package/liteav/LocalMediaTranscoder/index.js +420 -0
- package/liteav/Renderer/Canvas2DRenderer/index.d.ts +1 -1
- package/liteav/Renderer/IRenderer.d.ts +3 -1
- package/liteav/Renderer/index.d.ts +3 -1
- package/liteav/Renderer/index.js +16 -0
- package/liteav/trtc.d.ts +194 -32
- package/liteav/trtc.js +308 -154
- package/liteav/trtc_define.d.ts +12 -1
- package/liteav/trtc_define.js +28 -2
- package/liteav/vod_player.d.ts +51 -0
- package/liteav/vod_player.js +168 -0
- package/package.json +5 -4
- package/scripts/constant.js +2 -1
- package/scripts/download.js +71 -18
- package/scripts/utils.js +5 -1
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { EventEmitter } from 'events';
|
|
3
|
+
import { TRTCVideoStreamType, TRTCScreenCaptureSourceInfo, Rect, TRTCVideoEncParam, TRTCVideoPixelFormat, TRTCRenderParams } from '../trtc_define';
|
|
4
|
+
export declare enum TRTCLocalMediaTranscodingEvents {
|
|
5
|
+
onTranscodingStarted = "onTranscodingStarted",
|
|
6
|
+
onTranscodingStopped = "onTranscodingStopped",
|
|
7
|
+
onCameraSourceStarted = "onCameraSourceStarted",
|
|
8
|
+
onCameraSourceStopped = "onCameraSourceStopped",
|
|
9
|
+
onImageSourceStarted = "onImageSourceStarted",
|
|
10
|
+
onImageSourceStopped = "onImageSourceStopped",
|
|
11
|
+
onScreenSourceStarted = "onScreenSourceStarted",
|
|
12
|
+
onScreenSourcePaused = "onScreenSourcePaused",
|
|
13
|
+
onScreenSourceResumed = "onScreenSourceResumed",
|
|
14
|
+
onScreenSourceStopped = "onScreenSourceStopped"
|
|
15
|
+
}
|
|
16
|
+
export declare enum TRTCLocalMediaTranscodingSourceType {
|
|
17
|
+
MediaSourceCamera = 0,
|
|
18
|
+
MediaSourceScreen = 1,
|
|
19
|
+
MediaSourceImage = 2,
|
|
20
|
+
MediaSourceRemoteVideo = 3
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* 媒体源
|
|
24
|
+
* @typedef {Object} TRTCLocalMediaTranscodingSource - 媒体源
|
|
25
|
+
* @property {TRTCLocalMediaTranscodingSourceType} mode - 媒体类型
|
|
26
|
+
* @property {String} cameraDeviceId - 摄像头 ID,当 sourceType 为 MediaSourceCamera 时此字段有效,您可以使用该字段指定摄像头的设备 ID,摄像头的设备 ID 可以通过 TXDeviceManager 中的接口获取.
|
|
27
|
+
* @property {String} screenSourceId - 屏幕或窗口 ID,当 sourceType 为 MediaSourceScreen 时此字段有效,您可以使用该字段指定整个屏幕或者某个窗口的窗口 ID,您可以通过 TRTCCloud 中的 getScreenCaptureSources 接口获取可以被分享的窗口 ID。
|
|
28
|
+
* @property {String} imagePath - 图像的地址,当 sourceType 为 MediaSourceImage 时此字段有效,您可以使用该字段指定图片的文件路径,目前版本只支持 BMP、JPG、PNG、GIF 四种图像格式。
|
|
29
|
+
* @property {String} userId - 远端视频流的用户 ID,当 sourceType 为 MediaSourceRemoteVideo 时此字段有效,不过当前版本的 SDK 还不支持这个能力。
|
|
30
|
+
* @property {Rect} rect - 指定该路画面的坐标区域(单位:像素)。
|
|
31
|
+
* @property {Number} zOrder - 指定该路画面的层级(取值范围:0 - 15,不可重复)。
|
|
32
|
+
* @property {Boolean} mirror - 指定该路画面是否要开启左右镜像
|
|
33
|
+
*/
|
|
34
|
+
/**
|
|
35
|
+
* 媒体源
|
|
36
|
+
*/
|
|
37
|
+
export declare class TRTCLocalMediaTranscodingSource {
|
|
38
|
+
/**
|
|
39
|
+
* 【字段含义】媒体类型
|
|
40
|
+
* @property {TRTCLocalMediaTranscodingSourceType} sourceType
|
|
41
|
+
* @public
|
|
42
|
+
*/
|
|
43
|
+
sourceType: TRTCLocalMediaTranscodingSourceType;
|
|
44
|
+
/**
|
|
45
|
+
* 【字段含义】摄像头 ID
|
|
46
|
+
* 当 sourceType 为 MediaSourceCamera 时此字段有效,您可以使用该字段指定摄像头的设备 ID,摄像头的设备 ID 可以通过 TXDeviceManager 中的接口获取
|
|
47
|
+
* @property {string} cameraDeviceId
|
|
48
|
+
* @public
|
|
49
|
+
*/
|
|
50
|
+
cameraDeviceId?: string;
|
|
51
|
+
/**
|
|
52
|
+
* 【字段含义】屏幕或窗口 ID
|
|
53
|
+
* 当 sourceType 为 MediaSourceScreen 时此字段有效,您可以使用该字段指定整个屏幕或者某个窗口的窗口 ID,您可以通过 TRTCCloud 中的 getScreenCaptureSources 接口获取可以被分享的窗口 ID。
|
|
54
|
+
* @property {string} screenSourceId
|
|
55
|
+
* @public
|
|
56
|
+
*/
|
|
57
|
+
screenSourceId?: string;
|
|
58
|
+
/**
|
|
59
|
+
* 【字段含义】图像的地址
|
|
60
|
+
* 当 sourceType 为 MediaSourceImage 时此字段有效,您可以使用该字段指定图片的文件路径,目前版本只支持 BMP、JPG、PNG、GIF 四种图像格式。
|
|
61
|
+
* @property {string} imagePath
|
|
62
|
+
* @public
|
|
63
|
+
*/
|
|
64
|
+
imagePath?: string;
|
|
65
|
+
/**
|
|
66
|
+
*【字段含义】远端视频流的用户 ID
|
|
67
|
+
* 当 sourceType 为 MediaSourceRemoteVideo 时此字段有效,不过当前版本的 SDK 还不支持这个能力。
|
|
68
|
+
* @property {string} userId
|
|
69
|
+
* @public
|
|
70
|
+
*/
|
|
71
|
+
userId?: string;
|
|
72
|
+
/**
|
|
73
|
+
* 【字段含义】指定该路画面的坐标区域(单位:像素)。
|
|
74
|
+
* @property {Rect} rect
|
|
75
|
+
* @public
|
|
76
|
+
*/
|
|
77
|
+
rect: Rect;
|
|
78
|
+
/**
|
|
79
|
+
* 【字段含义】指定该路画面的层级(取值范围:0 - 15,不可重复)。
|
|
80
|
+
* @property {Number} zOrder
|
|
81
|
+
* @public
|
|
82
|
+
*/
|
|
83
|
+
zOrder: number;
|
|
84
|
+
/**
|
|
85
|
+
* 【字段含义】指定该路画面是否要开启左右镜像
|
|
86
|
+
* @property {Boolean} mirror
|
|
87
|
+
* @public
|
|
88
|
+
*/
|
|
89
|
+
mirror: boolean;
|
|
90
|
+
constructor();
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* 本地媒体流混流转码配置参数
|
|
94
|
+
* @typedef {Object} TRTCLocalMediaTranscodingParams - 本地媒体流混流转码配置参数
|
|
95
|
+
* @property {Array<TRTCLocalMediaTranscodingSource>} inputSourceList - 【字段含义】指定转码流中的每一路输入媒体源配置的信息。
|
|
96
|
+
* @property {TRTCVideoEncParam} videoEncoderParams - 【字段含义】转码流的视频编码参数
|
|
97
|
+
* @property {Number} canvasColor - 【字段含义】指定混合画面的底色。
|
|
98
|
+
*/
|
|
99
|
+
/**
|
|
100
|
+
* 本地媒体流混流转码配置参数
|
|
101
|
+
*/
|
|
102
|
+
export declare class TRTCLocalMediaTranscodingParams {
|
|
103
|
+
/**
|
|
104
|
+
* 【字段含义】指定转码流中的每一路输入媒体源配置的信息。
|
|
105
|
+
* 【推荐取值】该字段是一个 TRTCLocalMediaTranscodingSource 类型的数组,数组中的每一个元素都用来代表每一路输入媒体源的信息。
|
|
106
|
+
* 【特别说明】媒体源信息不支持留空,否则 TRTCLocalMediaoTranscodingCallback.onTranscodingStarted 会报错。
|
|
107
|
+
*/
|
|
108
|
+
inputSourceList: TRTCLocalMediaTranscodingSource[];
|
|
109
|
+
/**
|
|
110
|
+
* 【字段含义】转码流的视频编码参数
|
|
111
|
+
*/
|
|
112
|
+
videoEncoderParams: TRTCVideoEncParam;
|
|
113
|
+
/**
|
|
114
|
+
* 【字段含义】指定混合画面的底色。
|
|
115
|
+
* 【推荐取值】默认值:0x000000 代表黑色。格式为十六进制数字,比如:“0x61B9F1” 代表 RGB 分别为(97、158、241)。
|
|
116
|
+
*/
|
|
117
|
+
canvasColor: number;
|
|
118
|
+
constructor();
|
|
119
|
+
}
|
|
120
|
+
export declare enum TRTCCameraCaptureMode {
|
|
121
|
+
CameraResolutionStrategyAuto = 0,
|
|
122
|
+
CameraResolutionStrategyPerformance = 1,
|
|
123
|
+
CameraResolutionStrategyHighQuality = 2,
|
|
124
|
+
CameraCaptureManual = 3
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* 摄像头采集参数,该设置能决定本地预览图像画质。
|
|
128
|
+
* @typedef {Object} TRTCCameraCaptureParams - 摄像头采集参数
|
|
129
|
+
* @property {mode} TRTCCameraCaptureMode - 摄像头采集偏好
|
|
130
|
+
* @property {width} Number - 采集图像宽度
|
|
131
|
+
* @property {height} Number - 采集图像高度
|
|
132
|
+
*/
|
|
133
|
+
/**
|
|
134
|
+
* 摄像头采集参数
|
|
135
|
+
*
|
|
136
|
+
* 该设置能决定本地预览图像画质。
|
|
137
|
+
*/
|
|
138
|
+
export declare class TRTCCameraCaptureParams {
|
|
139
|
+
/** 摄像头采集偏好 */
|
|
140
|
+
mode: TRTCCameraCaptureMode;
|
|
141
|
+
/** 采集图像宽度 */
|
|
142
|
+
width: number;
|
|
143
|
+
/** 采集图像高度 */
|
|
144
|
+
height: number;
|
|
145
|
+
constructor();
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* 本地混流转码类
|
|
149
|
+
* @extends EventEmitter
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
* // 运行示例
|
|
153
|
+
* import TRTCCloud, {
|
|
154
|
+
* TRTCCameraCaptureMode,
|
|
155
|
+
* TRTCVideoRotation,
|
|
156
|
+
* TRTCVideoFillMode,
|
|
157
|
+
* TRTCVideoMirrorType,
|
|
158
|
+
* TRTCVideoStreamType,
|
|
159
|
+
* TRTCLocalMediaTranscodingSourceType,
|
|
160
|
+
* TRTCVideoResolution,
|
|
161
|
+
* TRTCVideoResolutionMode,
|
|
162
|
+
* TRTCVideoPixelFormat
|
|
163
|
+
* } from 'trtc-electron-sdk';
|
|
164
|
+
*
|
|
165
|
+
* const trtcCloud = new TRTCCloud();
|
|
166
|
+
* const cameraList =trtcCloud.getCameraDevicesList();
|
|
167
|
+
*
|
|
168
|
+
* // 获取本地合图转码推流对象
|
|
169
|
+
* const localMediaTranscoder =trtcCloud.createLocalMediaTranscoder({
|
|
170
|
+
* pixelFormat: TRTCVideoPixelFormat.TRTCVideoPixelFormat_I420,
|
|
171
|
+
* });
|
|
172
|
+
*
|
|
173
|
+
* // 注册事件监听
|
|
174
|
+
* // 监听合图开始、结束事件
|
|
175
|
+
* localMediaTranscoder.on('onTranscodingStarted', (errCode: number, errMsg: string) => {
|
|
176
|
+
* logger.log(`onTranscodingStarted { errCode:${errCode} errMsg:${errMsg}`);
|
|
177
|
+
* });
|
|
178
|
+
* localMediaTranscoder.on('onTranscodingStopped', (reason: number, reasonMsg: string) => {
|
|
179
|
+
* logger.log(`onTranscodingStopped { reason:${reason} reasonMsg:${reasonMsg} }`);
|
|
180
|
+
* });
|
|
181
|
+
* // 监听摄像头事件
|
|
182
|
+
* localMediaTranscoder.on('onCameraSourceStarted', (deviceId: string, errCode: number, errMsg: string) => {
|
|
183
|
+
* logger.log(`onCameraSourceStarted { deviceId:${deviceId} errCode:${errCode} errMsg:${errMsg} }`);
|
|
184
|
+
* });
|
|
185
|
+
* localMediaTranscoder.on('onCameraSourceStopped', (deviceId: string, reasonMsg: string) => {
|
|
186
|
+
* logger.log(`onCameraSourceStopped { deviceId:${deviceId} reasonMsg:${reasonMsg}}`);
|
|
187
|
+
* });
|
|
188
|
+
* // 监听屏幕、窗口分享事件
|
|
189
|
+
* localMediaTranscoder.on('onScreenSourceStarted', (sourceId: string, errCode: number, errMsg: string) => {
|
|
190
|
+
* logger.log(`onScreenSourceStarted { sourceId:${sourceId} errCode:${errCode} errMsg:${errMsg} }`);
|
|
191
|
+
* });
|
|
192
|
+
* localMediaTranscoder.on('onScreenSourceStopped', (sourceId: string, reason: number) => {
|
|
193
|
+
* logger.log(`onScreenSourceStopped { sourceId:${sourceId}, reason:${reason} }`);
|
|
194
|
+
* });
|
|
195
|
+
*
|
|
196
|
+
* // 开启摄像头一
|
|
197
|
+
* localMediaTranscoder.startCameraSource(
|
|
198
|
+
* cameraList[0].deviceId,
|
|
199
|
+
* {
|
|
200
|
+
* mode: TRTCCameraCaptureMode.CameraResolutionStrategyAuto,
|
|
201
|
+
* width: 640,
|
|
202
|
+
* height: 360,
|
|
203
|
+
* },
|
|
204
|
+
* {
|
|
205
|
+
* rotation: TRTCVideoRotation.TRTCVideoRotation0,
|
|
206
|
+
* fillMode: TRTCVideoFillMode.TRTCVideoFillMode_Fit,
|
|
207
|
+
* mirrorType: TRTCVideoMirrorType.TRTCVideoMirrorType_Disable,
|
|
208
|
+
* }
|
|
209
|
+
* );
|
|
210
|
+
*
|
|
211
|
+
* // 开启摄像头二
|
|
212
|
+
* localMediaTranscoder.startCameraSource(
|
|
213
|
+
* cameraList[1].deviceId,
|
|
214
|
+
* {
|
|
215
|
+
* mode: TRTCCameraCaptureMode.CameraResolutionStrategyAuto,
|
|
216
|
+
* width: 640,
|
|
217
|
+
* height: 360
|
|
218
|
+
* },
|
|
219
|
+
* {
|
|
220
|
+
* rotation: TRTCVideoRotation.TRTCVideoRotation0,
|
|
221
|
+
* fillMode: TRTCVideoFillMode.TRTCVideoFillMode_Fit,
|
|
222
|
+
* mirrorType: TRTCVideoMirrorType.TRTCVideoMirrorType_Disable
|
|
223
|
+
* }
|
|
224
|
+
* );
|
|
225
|
+
*
|
|
226
|
+
* // 开启屏幕一
|
|
227
|
+
* localMediaTranscoder.startScreenSource(screenSourceList[0], {top:10, left:10, right:1200, bottom:800});
|
|
228
|
+
*
|
|
229
|
+
* // 开启屏幕二
|
|
230
|
+
* localMediaTranscoder.startScreenSource(screenSourceList[1], {top:0, left:0, right:0, bottom:0});
|
|
231
|
+
*
|
|
232
|
+
* // 启动合图转码并推流
|
|
233
|
+
* localMediaTranscoder.startTranscoding(
|
|
234
|
+
* TRTCVideoStreamType.TRTCVideoStreamTypeBig,
|
|
235
|
+
* {
|
|
236
|
+
* inputSourceList: [
|
|
237
|
+
* { // camera 1
|
|
238
|
+
* sourceType: TRTCLocalMediaTranscodingSourceType.MediaSourceCamera,
|
|
239
|
+
* cameraDeviceId: cameraList[0].deviceId,
|
|
240
|
+
* rect: { left: 0, top: 0, right: 320, bottom: 180 },
|
|
241
|
+
* zOrder: 1,
|
|
242
|
+
* mirror: false,
|
|
243
|
+
* },
|
|
244
|
+
* { // camera 2
|
|
245
|
+
* sourceType: TRTCLocalMediaTranscodingSourceType.MediaSourceCamera,
|
|
246
|
+
* cameraDeviceId: cameraList[1].deviceId,
|
|
247
|
+
* rect: {left: 320 + 20, top: 180 + 20, right: 640 + 20, bottom: 360 + 20},
|
|
248
|
+
* zOrder: 2,
|
|
249
|
+
* mirror: false
|
|
250
|
+
* },
|
|
251
|
+
* {
|
|
252
|
+
* // screen 1
|
|
253
|
+
* sourceType: TRTCLocalMediaTranscodingSourceType.MediaSourceScreen,
|
|
254
|
+
* screenSourceId: screenSourceList[0].sourceId,
|
|
255
|
+
* rect: {left: 320 + 20, top: 0, right: 640 + 20, bottom: 180},
|
|
256
|
+
* zOrder: 3,
|
|
257
|
+
* mirror: false
|
|
258
|
+
* },
|
|
259
|
+
* {
|
|
260
|
+
* // screen 2
|
|
261
|
+
* sourceType: TRTCLocalMediaTranscodingSourceType.MediaSourceScreen,
|
|
262
|
+
* screenSourceId: screenSourceList[1].sourceId,
|
|
263
|
+
* rect: {left: 0, top: 180 + 20, right: 320, bottom: 360 + 20},
|
|
264
|
+
* zOrder: 4,
|
|
265
|
+
* mirror: false
|
|
266
|
+
* },
|
|
267
|
+
* ],
|
|
268
|
+
* videoEncoderParams: {
|
|
269
|
+
* videoResolution: TRTCVideoResolution.TRTCVideoResolution_960_720,
|
|
270
|
+
* resMode: TRTCVideoResolutionMode.TRTCVideoResolutionModeLandscape,
|
|
271
|
+
* videoFps: 30,
|
|
272
|
+
* videoBitrate: 800,
|
|
273
|
+
* minVideoBitrate: 0,
|
|
274
|
+
* enableAdjustRes: false,
|
|
275
|
+
* },
|
|
276
|
+
* canvasColor: 0xff0000, // 0x61b9f1,
|
|
277
|
+
* }
|
|
278
|
+
* );
|
|
279
|
+
*
|
|
280
|
+
* // 设置本地预览
|
|
281
|
+
* const view = document.getElementById("preview-view");
|
|
282
|
+
* localMediaTranscoder.setMixedVideoRenderView(view as HTMLElement);
|
|
283
|
+
*/
|
|
284
|
+
declare class TRTCLocalMediaTranscoder extends EventEmitter {
|
|
285
|
+
private nativeLocalMediaTranscoder;
|
|
286
|
+
private renderer;
|
|
287
|
+
private container;
|
|
288
|
+
private pixelFormat;
|
|
289
|
+
constructor(nativeLocalMediaTranscoder: any, pixelFormat?: TRTCVideoPixelFormat);
|
|
290
|
+
destroy(): void;
|
|
291
|
+
/**
|
|
292
|
+
* 启动本地混流转码
|
|
293
|
+
*
|
|
294
|
+
* @param streamType {TRTCVideoStreamType} - 指定使用 TRTC 的 TRTCVideoStreamTypeBig 来推流,还是 TRTCVideoStreamTypeSub 来推流。
|
|
295
|
+
* @param params {TRTCLocalMediaTranscodingParams} - 指定本地混流转码的参数
|
|
296
|
+
* @param params.inputSourceList {TRTCLocalMediaTranscodingSource} - 【字段含义】指定转码流中的每一路输入媒体源配置的信息。
|
|
297
|
+
* -【推荐取值】该字段是一个 TRTCLocalMediaTranscodingSource 类型的数组,数组中的每一个元素都用来代表每一路输入媒体源的信息。
|
|
298
|
+
* -【特别说明】媒体源信息不支持留空,否则 TRTCLocalMediaoTranscodingCallback.onTranscodingStarted 会报错。
|
|
299
|
+
* @param params.videoEncoderParams {TRTCVideoEncParam} -【字段含义】转码流的视频编码参数
|
|
300
|
+
* @param params.canvasColor {Number} - 【字段含义】指定混合画面的底色。
|
|
301
|
+
* -【推荐取值】默认值:0x000000 代表黑色。格式为十六进制数字,比如:“0x61B9F1” 代表 RGB 分别为(97、158、241)。
|
|
302
|
+
*/
|
|
303
|
+
startTranscoding(streamType: TRTCVideoStreamType, params: TRTCLocalMediaTranscodingParams): void;
|
|
304
|
+
/**
|
|
305
|
+
* 更新本地混流转码参数
|
|
306
|
+
*
|
|
307
|
+
* @param params {TRTCLocalMediaTranscodingParams} - 指定本地混流转码的参数
|
|
308
|
+
*/
|
|
309
|
+
updateTranscodingParams(params: TRTCLocalMediaTranscodingParams): void;
|
|
310
|
+
/**
|
|
311
|
+
* 停止本地混流转码
|
|
312
|
+
*/
|
|
313
|
+
stopTranscoding(): void;
|
|
314
|
+
/**
|
|
315
|
+
* 启动摄像头采集
|
|
316
|
+
*
|
|
317
|
+
* @param deviceId {String} - 摄像头设备 Id
|
|
318
|
+
* @param transcodeParams {TRTCCameraCaptureParams} - 指定摄像头采集分辨率和帧率
|
|
319
|
+
* @param renderParams {TRTCRenderParams} - 指定摄像头数据源是否旋转、镜像和填充模式
|
|
320
|
+
*/
|
|
321
|
+
startCameraSource(deviceId: string, transcodeParams: TRTCCameraCaptureParams, renderParams: TRTCRenderParams): void;
|
|
322
|
+
/**
|
|
323
|
+
* 停止摄像头采集
|
|
324
|
+
* @param deviceId {String} - 摄像头设备 Id
|
|
325
|
+
*/
|
|
326
|
+
stopCameraSource(deviceId: string): void;
|
|
327
|
+
/**
|
|
328
|
+
* 启动屏幕/窗口采集
|
|
329
|
+
*
|
|
330
|
+
* @param source {TRTCScreenCaptureSourceInfo} - 屏幕/窗口采集的详细参数
|
|
331
|
+
* @param rect {Rect} - 指定捕获的区域
|
|
332
|
+
*/
|
|
333
|
+
startScreenSource(source: TRTCScreenCaptureSourceInfo, rect: Rect): void;
|
|
334
|
+
/**
|
|
335
|
+
* 停止屏幕/窗口采集
|
|
336
|
+
* @param sourceId {String} - 屏幕/窗口的 Id
|
|
337
|
+
*/
|
|
338
|
+
stopScreenSource(sourceId: string): void;
|
|
339
|
+
/**
|
|
340
|
+
* 启动图片采集
|
|
341
|
+
* @param path {String} - 图片路径 ,目前只支持 BMP、JPG、PNG、GIF 四种格式
|
|
342
|
+
* @param fps {Number} - 采集输出帧率,可以不设置由 SDK 做最佳决策
|
|
343
|
+
*/
|
|
344
|
+
addImageSource(path: string, fps: number): void;
|
|
345
|
+
/**
|
|
346
|
+
* 停止图片采集
|
|
347
|
+
* @param path {String} - 图片路径
|
|
348
|
+
*/
|
|
349
|
+
removeImageSource(path: string): void;
|
|
350
|
+
/**
|
|
351
|
+
* 设置本地混流转码视频预览节点
|
|
352
|
+
* @param el {HTMLElement} - 必须是 HTML 块元素
|
|
353
|
+
*/
|
|
354
|
+
setMixedVideoRenderView(el: HTMLElement): void;
|
|
355
|
+
private setMixedVideoFrameRenderCallback;
|
|
356
|
+
private setEventCallback;
|
|
357
|
+
private renderMixedVideoFrame;
|
|
358
|
+
}
|
|
359
|
+
export default TRTCLocalMediaTranscoder;
|