enableObserveVideoFrame method

Future<V2TXLiveCode> enableObserveVideoFrame(
  1. bool enable,
  2. int pixelFormat,
  3. int bufferType
)

开启/关闭对视频帧的监听回调。

SDK 在您开启次此开关后将不再渲染视频画面,您可以通过 V2TXLivePlayerObserver 获得视频帧,并执行自定义的渲染逻辑。

enable 是否开启自定义渲染。【默认值】:false pixelFormat 自定义渲染回调的视频像素格式 {@link V2TXLiveDef.V2TXLivePixelFormat}。 bufferType 自定义渲染回调的视频数据格式 {@link V2TXLiveDef.V2TXLiveBufferType}。

@return 返回值 {@link V2TXLiveCode}

  • V2TXLIVE_OK: 成功
  • V2TXLIVE_ERROR_NOT_SUPPORTED: 像素格式或者数据格式不支持

Implementation

Future<V2TXLiveCode> enableObserveVideoFrame(
    bool enable, int pixelFormat, int bufferType) async {
  var result = await _channel.invokeMethod('enableObserveVideoFrame', {
    "enable": enable,
    "pixelFormat": pixelFormat,
    "bufferType": bufferType
  });
  return _liveCodeWithResult(result);
}