MediaKitPlayerComponent class
基于 media_kit (libmpv/ffmpeg) 的视频播放组件,用于回放中共享屏幕等 MediaCodec 兼容性较差的场景。 底层使用软解 fallback,避免 Android 部分设备硬件解码器崩溃。
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- MediaKitPlayerComponent
Constructors
- MediaKitPlayerComponent({Key? key, required String url, bool offlineMode = false, bool muted = false, void onPlayerReady(Player player)?, VoidCallback? onPlayerDispose, VoidCallback? onEnded, void onError(String message)?})
-
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- muted → bool
-
final
- offlineMode → bool
-
final
- onEnded → VoidCallback?
-
播放结束
final
- onError → void Function(String message)?
-
加载/播放错误
final
- onPlayerDispose → VoidCallback?
-
Player 即将被 dispose 时回调,外部应停止使用该引用
final
- onPlayerReady → void Function(Player player)?
-
Player 就绪(已 open 且可播放)时回调,供外部持有并控制(如 seek、暂停等)
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- url → String
-
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< MediaKitPlayerComponent> -
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