NERtcVideoView constructor

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

创建用户视频渲染组件。

renderer 为视频渲染所需的画布对象,可空。

  • 如果不为空,组件不会自动销毁 renderer,需要开发者在合适的时机调用 renderer.dispose() 销毁,否则可能会造成内存泄漏。
  • 如果为空,组件内部会自动创建并销毁 renderer,不会造成内存泄漏。推荐使用该模式创建视频渲染组件。

Implementation

@Deprecated('use NERtcVideoView.withInternalRenderer instead')
const NERtcVideoView({
  Key? key,
  this.channelTag,
  this.uid,
  this.subStream = false,
  this.autoAttach = true,
  this.mirrorListenable,
  this.renderer,
  this.rendererEventLister,
  this.fitType = NERtcVideoViewFitType.cover,
  this.placeholderBuilder,
  this.backgroundColor = const Color(0xFF292933),
  this.streamId,
})  : assert(renderer != null || autoAttach),
      super(key: key);