YUPlayerLog class

生命周期日志,用来排查"播放器到底有没有被释放"。

排查时看三条线:

  1. [创建] 与 [销毁] 是否成对:只有创建没有销毁就是泄漏;
  2. 行尾 xxx存活 是否回到 0;
  3. 原生侧同一时刻的「视图存活」/「播放项存活」有没有一起归零。

Dart 这边的「控制器存活」归零而原生「视图存活」不归零,说明 controller 已经 dispose 但 PlatformView 被引擎留着(原生泄漏); 反过来「控制器存活」不归零,说明业务层漏了 controller.dispose()。

关掉:YUPlayerLog.enabled = false。

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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

Static Properties

enabled ↔ bool
总开关,默认开
getter/setter pair

Static Methods

alive(int sinceMicros) → String
存活时长,形如 存活=4.32s
birth(String kind, int id, String detail) → void
创建打点:[创建] 控制器#1 vid=xx 控制器存活=1
count(String kind, int delta) → int
当前存活数量
death(String kind, int id, String detail) → void
销毁打点:[销毁] 控制器#1 存活=4.32s ... 控制器存活=0
log(String message) → void
nextId() → int
每创建一个对象取一个号,销毁时用同一个号打印,方便配对