fix(player): 优化封面过渡与换集起播

This commit is contained in:
Zhou Weidong committed 2026-10-26 14:01:42 +08:00
1 parent 516593499c
commit 04f034817c
6 files changed
+65 -19

No files matched your search

+6 -3
View File
@@ -174,7 +174,7 @@ void main() {
await session.close();
});
test('should_keep_manual_pause_when_returning_to_same_episode', () async {
test('should_auto_play_previous_after_switching_from_paused_episode', () async {
final factory = _Factory();
final session = PlaybackSession(
episodes: episodes,
@@ -195,13 +195,16 @@ void main() {
factory.players.firstWhere((player) => player.id == 'ep-2').playing,
isTrue,
);
session.setUserWantsPlay(false);
await session.playbackSettled;
expect(session.userWantsPlay, isFalse);
await session.select(1, preloadIndex: 2, previousIndex: 0);
await session.preloadSettled;
expect(session.userWantsPlay, isFalse);
expect(session.userWantsPlay, isTrue);
expect(
factory.players.firstWhere((player) => player.id == 'ep-1').playing,
isFalse,
isTrue,
);
await session.close();
});