PlayerComponent class

Inheritance

Constructors

PlayerComponent({Key? key, required String url, void onProgress(double positionSec)?, void onControllerReady(VideoPlayerController controller)?, VoidCallback? onFirstFrameReady, void onControllerDispose()?, Future<void> awaitBeforeControllerDispose(VideoPlayerController controller)?, void onControllerReleased(VideoPlayerController controller)?, bool isControllerDisposedExternally()?, bool isControllerDisposedExternallyForController(VideoPlayerController controller)?, VoidCallback? onSwapTap, VoidCallback? onEnded, void onError(String message)?, bool controlsEnabled = true, bool offlineMode = false, bool muted = false, bool showSkeletonCenterPlaceholder = true, VideoViewType? viewType})
const

Properties

awaitBeforeControllerDispose Future<void> Function(VideoPlayerController controller)?
final
controlsEnabled bool
final
hashCode int
The hash code for this object.
no setterinherited
isControllerDisposedExternally bool Function()?
若返回 true 表示 controller 已由外部 dispose,内部不再重复 dispose
final
isControllerDisposedExternallyForController bool Function(VideoPlayerController controller)?
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
muted bool
final
offlineMode bool
final
onControllerDispose → void Function()?
播放器 controller 即将被 dispose 时回调
final
onControllerReady → void Function(VideoPlayerController controller)?
播放器 controller 就绪时回调
final
onControllerReleased → void Function(VideoPlayerController controller)?
final
onEnded → void Function()?
播放结束(回放时通知 Native)
final
onError → void Function(String message)?
加载/播放错误(回放时通知 Native)
final
onFirstFrameReady → void Function()?
视频首帧可用时回调;当前以 controller 首次 initialized 作为首帧可显示信号。
final
onProgress → void Function(double positionSec)?
播放进度回调,秒(含小数,与 VideoPlayer.position 一致),用于主时间轴与进度条
final
onSwapTap → void Function()?
交换白板/老师视频位置(仅回放竖屏有效)
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showSkeletonCenterPlaceholder bool
final
url String
final
viewType → VideoViewType?
视频渲染方式。为 null 时使用平台默认值(Android: platformView, iOS: textureView)。 当多个播放器存在几何重叠时,指定 textureView 可避免 Android PlatformView z-order 冲突。
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<PlayerComponent>
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