fix(player): 预热直出并与视频统一封面布局
This commit is contained in:
1 parent
a3a79f7068
commit
48b4e67d34
9 files changed
+119
-104
No files matched your search
@@ -260,6 +260,7 @@ class PlaybackSession extends ChangeNotifier {
|
||||
_usableWarm(this, warmNext, index) ??
|
||||
_usableWarm(this, warmPrevious, index);
|
||||
if (warm != null) {
|
||||
warm.reusedWarm = true;
|
||||
target = _active = warm;
|
||||
_loading = !warm.prepared;
|
||||
_notify();
|
||||
@@ -470,5 +471,6 @@ class _PlayerSlot {
|
||||
bool activated = false;
|
||||
bool playing = false;
|
||||
bool retiring = false;
|
||||
bool reusedWarm = false;
|
||||
Object? failure;
|
||||
}
|
||||
@@ -19,6 +19,16 @@ extension PlaybackSessionControls on PlaybackSession {
|
||||
return slot.player;
|
||||
}
|
||||
|
||||
/// 当前索引是否复用了已预热的播放器槽。
|
||||
bool reusedWarmAt(int index) {
|
||||
for (final slot in [_active, _next, _previous]) {
|
||||
if (slot != null && !slot.retiring && slot.index == index) {
|
||||
return slot.reusedWarm;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// 同步应用前台状态并恢复或暂停当前集。
|
||||
void setAppResumed(bool value) {
|
||||
_appResumed = value;
|
||||
|
||||
Reference in new issue
Block a user