fix(player): 仅在暂停时显示播放按钮
This commit is contained in:
1 parent
60ec19f08d
commit
0eabb0a763
2 files changed
+53
-10
No files matched your search
@@ -208,6 +208,28 @@ class _PlayerPageState extends State<PlayerPage> with WidgetsBindingObserver {
|
||||
),
|
||||
),
|
||||
),
|
||||
if (widget.homeMode && _feedChromeVisible && !logic.chromeHidden)
|
||||
Positioned.fill(
|
||||
child: GestureDetector(
|
||||
key: const Key('home-feed-video-toggle'),
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () => logic.session.setUserWantsPlay(
|
||||
!logic.session.userWantsPlay,
|
||||
),
|
||||
),
|
||||
),
|
||||
if (widget.homeMode &&
|
||||
_feedChromeVisible &&
|
||||
!logic.chromeHidden &&
|
||||
selected &&
|
||||
!logic.session.userWantsPlay)
|
||||
Center(
|
||||
child: PlayerCenterToggle(
|
||||
key: const Key('home-feed-center-play'),
|
||||
playing: false,
|
||||
onTap: () => logic.session.setUserWantsPlay(true),
|
||||
),
|
||||
),
|
||||
// 票据三态之一:起播前正在向后端要签名地址
|
||||
if (selected && logic.ticketLoading)
|
||||
const Center(
|
||||
@@ -605,7 +627,7 @@ class _PlaybackOverlayState extends State<_PlaybackOverlay> {
|
||||
void _onVideoTap() {
|
||||
if (!_controlsVisible) {
|
||||
setState(() => _controlsVisible = true);
|
||||
} else if (!widget.playing) {
|
||||
} else {
|
||||
widget.onTogglePlay();
|
||||
}
|
||||
}
|
||||
@@ -632,11 +654,11 @@ class _PlaybackOverlayState extends State<_PlaybackOverlay> {
|
||||
Expanded(
|
||||
child: Stack(
|
||||
children: [
|
||||
if (widget.playing)
|
||||
if (!widget.playing)
|
||||
Center(
|
||||
child: PlayerCenterToggle(
|
||||
key: const Key('player-play-toggle'),
|
||||
playing: true,
|
||||
playing: false,
|
||||
onTap: widget.onTogglePlay,
|
||||
),
|
||||
),
|
||||
|
||||
Reference in new issue
Block a user