ScreenSharePlayerHolder class
屏幕共享专用的常驻播放器持有者。
整个回放会话只创建一个 media_kit Player + VideoController,多个屏幕共享时段
切换时仅在同一播放器上 open() 新文件,而不再销毁/重建播放器与平台纹理。
避免每次切换屏共时段都重新初始化 libmpv 实例和纹理导致的黑屏闪烁与加载开销。
Constructors
Properties
- controller → VideoController
-
no setter
- currentUrl → String?
-
no setter
- hasError → bool
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isReady → bool
-
no setter
- onEnded ↔ VoidCallback?
-
播放结束回调
getter/setter pair
- onError ↔ void Function(String message, String url)?
-
致命错误回调(已过滤非致命音频设备错误)
getter/setter pair
- onReady ↔ void Function(Player player, String url)?
-
当前已 open 的媒体首帧可渲染时回调(携带对应 url,供调用方校验是否仍是当前段)
getter/setter pair
- player → Player
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
dispose(
) → void -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
open(
String url, {required bool offlineMode, required bool muted}) → Future< void> - 在同一个 Player 上打开新文件;url 未变且无错误则跳过,避免段内 seek/重建触发重复加载。
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited