mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-03 08:39:46 +08:00
Compare commits
1 Commits
2.0.3.2
...
a2ff54af70
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a2ff54af70 |
@@ -38,7 +38,6 @@ import 'package:PiliPlus/pages/video/post_panel/view.dart';
|
||||
import 'package:PiliPlus/pages/video/widgets/header_control.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/controller.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/models/bottom_control_type.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/models/bottom_progress_behavior.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/models/data_status.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/models/double_tap_type.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/models/fullscreen_mode.dart';
|
||||
@@ -976,7 +975,6 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
final dy = cumulativeDelta.dy.abs();
|
||||
if (dx > 3 * dy) {
|
||||
_gestureType = GestureType.horizontal;
|
||||
_showControlsIfNeeded();
|
||||
} else if (dy > 3 * dx) {
|
||||
if (!plPlayerController.enableSlideVolumeBrightness &&
|
||||
!plPlayerController.enableSlideFS) {
|
||||
@@ -1274,19 +1272,6 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
}
|
||||
}
|
||||
|
||||
void _showControlsIfNeeded() {
|
||||
if (plPlayerController.isLive) return;
|
||||
late final isFullScreen = this.isFullScreen;
|
||||
final progressType = plPlayerController.progressType;
|
||||
if (progressType == BtmProgressBehavior.alwaysHide ||
|
||||
(isFullScreen &&
|
||||
progressType == BtmProgressBehavior.onlyHideFullScreen) ||
|
||||
(!isFullScreen &&
|
||||
progressType == BtmProgressBehavior.onlyShowFullScreen)) {
|
||||
plPlayerController.controls = true;
|
||||
}
|
||||
}
|
||||
|
||||
void _onPointerPanZoomUpdate(PointerPanZoomUpdateEvent event) {
|
||||
if (plPlayerController.controlsLock.value) return;
|
||||
if (_gestureType == null) {
|
||||
@@ -1296,7 +1281,6 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
final dy = pan.dy.abs();
|
||||
if (dx > 3 * dy) {
|
||||
_gestureType = GestureType.horizontal;
|
||||
_showControlsIfNeeded();
|
||||
} else if (dy > 3 * dx) {
|
||||
_gestureType = GestureType.right;
|
||||
}
|
||||
@@ -1728,8 +1712,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
),
|
||||
|
||||
/// 进度条 live模式下禁用
|
||||
if (!isLive &&
|
||||
plPlayerController.progressType != BtmProgressBehavior.alwaysHide)
|
||||
if (!isLive)
|
||||
Positioned(
|
||||
bottom: -2.2,
|
||||
left: 0,
|
||||
@@ -1737,13 +1720,26 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
child: Obx(
|
||||
() {
|
||||
final showControls = plPlayerController.showControls.value;
|
||||
final offstage = switch (plPlayerController.progressType) {
|
||||
BtmProgressBehavior.onlyShowFullScreen =>
|
||||
showControls || !isFullScreen,
|
||||
BtmProgressBehavior.onlyHideFullScreen =>
|
||||
showControls || isFullScreen,
|
||||
_ => showControls,
|
||||
};
|
||||
final bool offstage;
|
||||
switch (plPlayerController.progressType) {
|
||||
case .alwaysShow:
|
||||
offstage = showControls;
|
||||
case .alwaysHide:
|
||||
if (!plPlayerController.isSliderMoving.value) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
offstage = showControls;
|
||||
case .onlyShowFullScreen:
|
||||
offstage =
|
||||
showControls ||
|
||||
(!isFullScreen &&
|
||||
!plPlayerController.isSliderMoving.value);
|
||||
case .onlyHideFullScreen:
|
||||
offstage =
|
||||
showControls ||
|
||||
(isFullScreen &&
|
||||
!plPlayerController.isSliderMoving.value);
|
||||
}
|
||||
return Offstage(
|
||||
offstage: offstage,
|
||||
child: Stack(
|
||||
|
||||
Reference in New Issue
Block a user