BasePlayerStrategy class abstract
策略基类,自动管理 ValueNotifier 监听的订阅与清理
继承此类后,只需在 onStart 中调用 listen 订阅 notifier, 框架会在 onStop 时自动取消所有订阅,防止内存泄漏。
Base class for strategies with automatic listener lifecycle management.
Subclasses call listen in onStart to subscribe to notifiers. All subscriptions are automatically cleaned up in onStop.
- Inheritance
-
- Object
- PlayerStrategy
- BasePlayerStrategy
- Implementers
Constructors
Properties
Methods
-
listen<
T> (ValueListenable< T> listenable, void onChanged(T value)) → void - 便捷方法:监听指定 ValueListenable,自动管理生命周期
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notify<
T> (void callback(T)?, T value) → void - 安全触发外部回调(仅在策略活跃时执行)
-
onReset(
) → void -
视频切换时重置内部状态(保持策略活跃)
override
-
onStart(
AliPlayerWidgetController controller) → void -
策略启动,订阅感兴趣的状态变化
inherited
-
onStop(
) → void -
策略停止,释放资源并取消所有订阅
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited