VideoNativeView class

内嵌原生小视频视图

通过 PlatformView 将原生小视频播放器内嵌到 Flutter 中, 自动处理 Android 和 iOS 平台的差异,提供统一的接口。

使用前请确保:

  1. 已成功调用 PangrowthContent.initializePangrowthContent.start
  2. GroMore(gromore_ads) SDK 完成初始化(如果需要广告)。
Inheritance

Constructors

VideoNativeView({Key? key, int channelType = 1, int contentType = 1, int style = 2, bool hideChannelName = false, bool autoPlay = true, VideoController? controller, VideoListener? listener, String? videoId, Map<String, dynamic>? extra, Set<Factory<OneSequenceGestureRecognizer>> gestureRecognizers = const <Factory<OneSequenceGestureRecognizer>>{}})
const

Properties

autoPlay bool
是否自动播放
final
channelType int
频道类型:1-推荐,2-关注,3-推荐+关注
final
contentType int
内容类型:1-小视频,2-直播,3-小视频+直播
final
controller VideoController?
视频控制器(可选) 如果提供控制器,将自动初始化和管理视频ID
final
extra Map<String, dynamic>?
传递给原生层的额外参数
final
gestureRecognizers Set<Factory<OneSequenceGestureRecognizer>>
自定义手势识别器
final
hashCode int
The hash code for this object.
no setterinherited
hideChannelName bool
是否隐藏频道名称(顶部切换栏)
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
listener VideoListener?
视频事件监听器
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
style int
样式类型:2-全屏沉浸式,3-宫格,4-瀑布流
final
videoId String?
自定义视频标识(用于事件过滤),默认自动生成 如果使用 controller,此参数会被忽略
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<VideoNativeView>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited