sendCustomVideoFrame method

Future<V2TXLiveCode> sendCustomVideoFrame(
  1. V2TXLiveVideoFrame videoFrame
)

在自定义视频采集模式下,将采集的视频数据发送到SDK。

在自定义视频采集模式下,SDK不再采集摄像头数据,仅保留编码和发送功能。

@param videoFrame 向 SDK 发送的 视频帧数据 {@link V2TXLiveDef.V2TXLiveVideoFrame} @return 返回值 {@link V2TXLiveCode}

  • V2TXLIVE_OK: 成功
  • V2TXLIVE_ERROR_INVALID_PARAMETER: 发送失败,视频帧数据不合法
  • V2TXLIVE_ERROR_REFUSED: 发送失败,您必须先调用 enableCustomVideoCapture 开启自定义视频采集。 @note 需要在 {@link V2TXLivePusher#startPush(String)} 之前调用 {@link V2TXLivePusher#enableCustomVideoCapture(boolean)} 开启自定义采集。

Implementation

Future<V2TXLiveCode> sendCustomVideoFrame(V2TXLiveVideoFrame videoFrame) async {
  var result = await _channel.invokeMethod("V2TXLiveAudioFrame", videoFrame.toJson());
  return _liveCodeWithResult(result);
}