mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 11:08:03 +08:00
@@ -49,10 +49,11 @@ import 'package:PiliPlus/plugin/pl_player/widgets/forward_seek.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/widgets/mpv_convert_webp.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/widgets/play_pause_btn.dart';
|
||||
import 'package:PiliPlus/utils/duration_utils.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:PiliPlus/utils/extension/theme_ext.dart';
|
||||
import 'package:PiliPlus/utils/id_utils.dart';
|
||||
import 'package:PiliPlus/utils/image_utils.dart';
|
||||
import 'package:PiliPlus/utils/path_utils.dart';
|
||||
import 'package:PiliPlus/utils/platform_utils.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:PiliPlus/utils/storage_key.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
@@ -185,7 +186,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
);
|
||||
videoController = plPlayerController.videoController!;
|
||||
|
||||
if (Utils.isMobile) {
|
||||
if (PlatformUtils.isMobile) {
|
||||
Future.microtask(() async {
|
||||
try {
|
||||
FlutterVolumeController.updateShowSystemUI(true);
|
||||
@@ -312,7 +313,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
_listener?.cancel();
|
||||
_controlsListener?.cancel();
|
||||
animationController.dispose();
|
||||
if (Utils.isMobile) {
|
||||
if (PlatformUtils.isMobile) {
|
||||
FlutterVolumeController.removeListener();
|
||||
}
|
||||
transformationController.dispose();
|
||||
@@ -505,7 +506,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
videoDetailController.showVP.value =
|
||||
!videoDetailController.showVP.value;
|
||||
},
|
||||
onSecondaryTap: Utils.isMobile
|
||||
onSecondaryTap: PlatformUtils.isMobile
|
||||
? null
|
||||
: () => videoDetailController.showVP.value =
|
||||
!videoDetailController.showVP.value,
|
||||
@@ -981,7 +982,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
final double tapPosition = details.localFocalPoint.dx;
|
||||
final double sectionWidth = maxWidth / 3;
|
||||
if (tapPosition < sectionWidth) {
|
||||
if (Utils.isDesktop ||
|
||||
if (PlatformUtils.isDesktop ||
|
||||
!plPlayerController.enableSlideVolumeBrightness) {
|
||||
return;
|
||||
}
|
||||
@@ -1182,7 +1183,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
|
||||
void _onTapUp(TapUpDetails details) {
|
||||
switch (details.kind) {
|
||||
case ui.PointerDeviceKind.mouse when Utils.isDesktop:
|
||||
case ui.PointerDeviceKind.mouse when PlatformUtils.isDesktop:
|
||||
onTapDesktop();
|
||||
break;
|
||||
default:
|
||||
@@ -1218,7 +1219,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
|
||||
void _onDoubleTapDown(TapDownDetails details) {
|
||||
switch (details.kind) {
|
||||
case ui.PointerDeviceKind.mouse when Utils.isDesktop:
|
||||
case ui.PointerDeviceKind.mouse when PlatformUtils.isDesktop:
|
||||
onDoubleTapDesktop();
|
||||
break;
|
||||
default:
|
||||
@@ -1244,7 +1245,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
StreamSubscription<bool>? _danmakuListener;
|
||||
|
||||
void _onPointerDown(PointerDownEvent event) {
|
||||
if (Utils.isDesktop) {
|
||||
if (PlatformUtils.isDesktop) {
|
||||
final buttons = event.buttons;
|
||||
final isSecondaryBtn = buttons == kSecondaryMouseButton;
|
||||
if (isSecondaryBtn || buttons == kMiddleMouseButton) {
|
||||
@@ -1827,7 +1828,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
),
|
||||
),
|
||||
),
|
||||
if (Utils.isMobile)
|
||||
if (PlatformUtils.isMobile)
|
||||
buildViewPointWidget(
|
||||
videoDetailController,
|
||||
plPlayerController,
|
||||
@@ -2049,7 +2050,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
}),
|
||||
],
|
||||
);
|
||||
if (Utils.isDesktop) {
|
||||
if (PlatformUtils.isDesktop) {
|
||||
return Obx(
|
||||
() => MouseRegion(
|
||||
cursor: !plPlayerController.showControls.value && isFullScreen
|
||||
@@ -2554,7 +2555,7 @@ Widget buildSeekPreviewWidget(
|
||||
|
||||
final double scale =
|
||||
plPlayerController.isFullScreen.value &&
|
||||
(Utils.isDesktop || !plPlayerController.isVertical)
|
||||
(PlatformUtils.isDesktop || !plPlayerController.isVertical)
|
||||
? 4
|
||||
: 3;
|
||||
double height = 27 * scale;
|
||||
|
||||
Reference in New Issue
Block a user