fix(flutter): feed 清屏保留顶栏并寻址恢复播放
This commit is contained in:
1 parent
9b99d96a07
commit
c87798fb16
5 files changed
+83
-28
No files matched your search
@@ -578,7 +578,11 @@ class PlayerLogic extends ChangeNotifier {
|
||||
await session.playbackSettled;
|
||||
if (scrubbingPlayer != player || session.active != player) return;
|
||||
await player.controller.seekTo(position);
|
||||
if (session.active == player) await saveCurrentProgress();
|
||||
if (session.active == player) {
|
||||
// 暂停时拖动进度后直接恢复播放,避免画面停在旧位置。
|
||||
resumeAfterSeek();
|
||||
await saveCurrentProgress();
|
||||
}
|
||||
} catch (_) {
|
||||
if (context.mounted && session.active == player) {
|
||||
final l10n = AppLocalizations.of(context)!;
|
||||
@@ -591,6 +595,12 @@ class PlayerLogic extends ChangeNotifier {
|
||||
}
|
||||
}
|
||||
|
||||
/// 拖动进度落点后恢复播放;暂停态拖动不应停留在暂停。
|
||||
@visibleForTesting
|
||||
void resumeAfterSeek() {
|
||||
if (!session.userWantsPlay) session.setUserWantsPlay(true);
|
||||
}
|
||||
|
||||
Future<void> leave(BuildContext context) async {
|
||||
await saveCurrentProgress();
|
||||
if (context.mounted) Navigator.of(context).pop();
|
||||
|
||||
Reference in new issue
Block a user