NERtcVideoView.withExternalRenderer constructor

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

创建用户视频渲染组件。

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

Implementation

const NERtcVideoView.withExternalRenderer({
  Key? key,
  this.channelTag,
  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.streamId,
})  : this.renderer = renderer,
      super(key: key);