NERtcVideoView.withExternalRenderer constructor

const NERtcVideoView.withExternalRenderer({
  1. Key? key,
  2. int? uid,
  3. bool subStream = false,
  4. bool autoAttach = true,
  5. ValueListenable<bool>? mirrorListenable,
  6. required NERtcVideoRenderer renderer,
  7. NERtcVideoRendererEventListener? rendererEventLister,
  8. NERtcVideoViewFitType fitType = NERtcVideoViewFitType.cover,
  9. WidgetBuilder? placeholderBuilder,
  10. Color backgroundColor = const Color(0xFF292933),
})

创建用户视频渲染组件。

该模式需要开发者手动创建并传入画布对象 renderer,并手动管理 renderer 的生命周期以避免内存泄漏。

Implementation

const NERtcVideoView.withExternalRenderer({
  Key? key,
  this.uid,
  this.subStream = false,
  this.autoAttach = true,
  this.mirrorListenable,
  required NERtcVideoRenderer renderer,
  this.rendererEventLister,
  this.fitType = NERtcVideoViewFitType.cover,
  this.placeholderBuilder,
  this.backgroundColor = const Color(0xFF292933),
})  : this.renderer = renderer,
      super(key: key);