FirstFrameStrategy class

首帧耗时统计策略

监听 prepare/prepared/rendered 事件,统计关键节点耗时:

  • prepare → prepared:数据源准备耗时,通过 onPrepared 回调
  • prepare → rendered:首帧渲染总耗时,通过 onFirstFrame 回调

First frame timing strategy.

Monitors prepare/prepared/rendered events to measure key timing:

  • prepare → prepared: data source preparation cost, via onPrepared
  • prepare → rendered: total first frame cost, via onFirstFrame
Inheritance

Constructors

FirstFrameStrategy({void onPrepared(Duration cost)?, void onFirstFrame(Duration cost)?})
创建首帧耗时统计策略

Properties

hashCode int
The hash code for this object.
no setterinherited
isActive bool
策略是否处于活跃状态(onStart 之后、onStop 之前)
getter/setter pairinherited
name String
策略唯一标识,用于注册/注销和调试日志
no setteroverride
onFirstFrame → void Function(Duration cost)?
首帧渲染完成回调
final
onPrepared → void Function(Duration cost)?
数据源准备完成回调
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

listen<T>(ValueListenable<T> listenable, void onChanged(T value)) → void
便捷方法:监听指定 ValueListenable,自动管理生命周期
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notify<T>(void callback(T)?, T value) → void
安全触发外部回调(仅在策略活跃时执行)
inherited
onReset() → void
视频切换时重置内部状态(保持策略活跃)
override
onStart(AliPlayerWidgetController controller) → void
策略启动,订阅感兴趣的状态变化
override
onStop() → void
策略停止,释放资源并取消所有订阅
inherited
toString() String
A string representation of this object.
inherited

Operators

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