StutterDetectStrategy class

卡顿检测策略

协调监听播放状态和加载状态,统计有效播放时长、卡顿次数和卡顿时长。 当检测到卡顿时,通过 onStutterDetected 回调通知外部。

Stutter detection strategy.

Coordinates play state and loading state monitoring to track effective playback duration, stutter count, and stutter duration.

Inheritance

Constructors

StutterDetectStrategy({Duration stutterThreshold = _defaultStutterThreshold, void onStutterDetected(StutterInfo info)?})
创建卡顿检测策略

Properties

hashCode int
The hash code for this object.
no setterinherited
isActive bool
策略是否处于活跃状态(onStart 之后、onStop 之前)
getter/setter pairinherited
name String
策略唯一标识,用于注册/注销和调试日志
no setteroverride
onStutterDetected → void Function(StutterInfo info)?
卡顿检测回调
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stutterThreshold Duration
卡顿阈值,低于此时长的 loading 不计入卡顿
final

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