fix(recommend): 修正进度拖动与底栏联动
This commit is contained in:
1 parent
afe7a49ef0
commit
2765343340
9 files changed
+79
-107
No files matched your search
@@ -70,7 +70,6 @@ class PlayerPage extends StatefulWidget {
|
||||
this.showHomeFeedHeader = true,
|
||||
this.onDramaChanged,
|
||||
this.onImmersiveChanged,
|
||||
this.onScrubVisibilityChanged,
|
||||
this.onOpenFullPlayer,
|
||||
this.onRefreshFeed,
|
||||
this.onLoadMore,
|
||||
@@ -97,7 +96,6 @@ class PlayerPage extends StatefulWidget {
|
||||
final bool showHomeFeedHeader;
|
||||
final ValueChanged<Drama>? onDramaChanged;
|
||||
final ValueChanged<bool>? onImmersiveChanged;
|
||||
final ValueChanged<bool>? onScrubVisibilityChanged;
|
||||
final Future<void> Function(Drama drama, Episode episode)? onOpenFullPlayer;
|
||||
final Future<bool> Function()? onRefreshFeed;
|
||||
final Future<void> Function()? onLoadMore;
|
||||
@@ -273,7 +271,6 @@ class _PlayerPageState extends State<PlayerPage>
|
||||
void _hideChrome() {
|
||||
if (!_chromeVisible) return;
|
||||
setState(() => _chromeVisible = false);
|
||||
widget.onScrubVisibilityChanged?.call(true);
|
||||
}
|
||||
|
||||
/// 长按两侧:切 2 倍速并清屏,记下进入前的状态用于松手恢复。
|
||||
@@ -288,7 +285,6 @@ class _PlayerPageState extends State<PlayerPage>
|
||||
_playbackSpeed = _boostPlaybackSpeed;
|
||||
_chromeVisible = false;
|
||||
});
|
||||
widget.onScrubVisibilityChanged?.call(true);
|
||||
unawaited(logic.setPlaybackSpeed(_boostPlaybackSpeed));
|
||||
}
|
||||
|
||||
@@ -304,14 +300,12 @@ class _PlayerPageState extends State<PlayerPage>
|
||||
_playbackSpeed = speed;
|
||||
_chromeVisible = chrome;
|
||||
});
|
||||
widget.onScrubVisibilityChanged?.call(!chrome);
|
||||
unawaited(logic.setPlaybackSpeed(speed));
|
||||
}
|
||||
|
||||
void _setScrubbing(bool value) {
|
||||
if (_scrubbing == value) return;
|
||||
setState(() => _scrubbing = value);
|
||||
widget.onScrubVisibilityChanged?.call(value);
|
||||
}
|
||||
|
||||
void _finishFeedScrub(bool wasVisible) {
|
||||
@@ -319,7 +313,6 @@ class _PlayerPageState extends State<PlayerPage>
|
||||
_scrubbing = false;
|
||||
_chromeVisible = wasVisible;
|
||||
});
|
||||
widget.onScrubVisibilityChanged?.call(!wasVisible);
|
||||
}
|
||||
|
||||
void _cancelFeedScrub() {
|
||||
@@ -333,7 +326,6 @@ class _PlayerPageState extends State<PlayerPage>
|
||||
_scrubbing = false;
|
||||
_chromeVisible = true;
|
||||
});
|
||||
widget.onScrubVisibilityChanged?.call(false);
|
||||
}
|
||||
|
||||
void _handleFeedSurfaceTap() {
|
||||
@@ -676,7 +668,7 @@ class _PlayerPageState extends State<PlayerPage>
|
||||
onScrubVisibilityChanged: _setScrubbing,
|
||||
cancelScrubRequest: widget.scrubCancelRequest,
|
||||
onSeek: ready
|
||||
? (position) => logic.seekTo(context, videoPort!, position)
|
||||
? (position) => logic.endScrub(context, videoPort!, position)
|
||||
: null,
|
||||
thumbnailService: _thumbnailService,
|
||||
spriteAxisService: _spriteAxisService,
|
||||
|
||||
Reference in new issue
Block a user