fix(player): 修复返回首页黑屏并恢复预热

This commit is contained in:
Zhou Weidong committed 2026-10-26 16:45:00 +08:00
1 parent 6667330ce0
commit 54eb5a60a8
9 files changed
+56 -101

No files matched your search

-27
View File
@@ -32,33 +32,6 @@ void main() {
await session.close();
});
test('should_keep_only_current_player_when_neighbor_warmup_disabled', () async {
final factory = FakeFactory();
final session = PlaybackSession(
episodes: episodes,
factory: factory.create,
canPlay: (episode) => episode.isFree,
warmNeighborsEnabled: false,
);
await session.select(0, preloadIndex: 1);
await session.preloadSettled;
expect(factory.created, hasLength(1));
expect(factory.live, 1);
expect(session.preloadedIndex, isNull);
final first = factory.created.single;
await session.select(1, preloadIndex: 2, previousIndex: 0);
await session.preloadSettled;
expect(first.disposed, isTrue);
expect(factory.created, hasLength(2));
expect(factory.live, 1);
expect(session.livePlayerCount, 1);
expect(session.active, same(factory.created.last));
await session.close();
});
test('should_release_previous_player_immediately_when_selecting_locked', () async {
final lockedEpisodes = [
Episode(