NERtcVideoView.withExternalRenderer constructor
const
NERtcVideoView.withExternalRenderer({
- Key? key,
- int? uid,
- bool subStream = false,
- bool autoAttach = true,
- ValueListenable<
bool> ? mirrorListenable, - required NERtcVideoRenderer renderer,
- NERtcVideoRendererEventListener? rendererEventLister,
- NERtcVideoViewFitType fitType = NERtcVideoViewFitType.cover,
- WidgetBuilder? placeholderBuilder,
- 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);