diff --git a/lib/pages/player/player_controller.dart b/lib/pages/player/player_controller.dart index 059ed06..7e62b3d 100644 --- a/lib/pages/player/player_controller.dart +++ b/lib/pages/player/player_controller.dart @@ -7,7 +7,6 @@ import 'package:oneanime/utils/constans.dart'; import 'package:flutter/services.dart'; import 'package:flutter/foundation.dart'; import 'package:device_info_plus/device_info_plus.dart'; -import 'package:auto_orientation/auto_orientation.dart'; import 'package:window_manager/window_manager.dart'; import 'package:oneanime/utils/storage.dart'; import 'package:hive/hive.dart'; @@ -127,9 +126,17 @@ abstract class _PlayerController with Store { if (kIsWeb) { await document.documentElement?.requestFullscreen(); } else if (Platform.isAndroid || Platform.isIOS) { - await AutoOrientation.landscapeAutoMode(forceSensor: true); - } else if (Platform.isMacOS || Platform.isWindows || Platform.isLinux) { - await windowManager.setFullScreen(true); + // await SystemChrome.setEnabledSystemUIMode( + // SystemUiMode.immersiveSticky, + // overlays: [], + // ); + await SystemChrome.setPreferredOrientations( + [ + DeviceOrientation.landscapeLeft, + DeviceOrientation.landscapeRight, + ], + ); + // await AutoOrientation.landscapeAutoMode(forceSensor: true); } } catch (exception, stacktrace) { debugPrint(exception.toString()); @@ -162,7 +169,7 @@ abstract class _PlayerController with Store { Duration get buffer { if (mediaPlayer.value.buffered.isEmpty) { - return Duration.zero; + return Duration.zero; } Duration maxDuration = mediaPlayer.value.buffered[0].end; diff --git a/pubspec.lock b/pubspec.lock index b8a8059..52e71fd 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -65,14 +65,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.4" - auto_orientation: - dependency: "direct main" - description: - name: auto_orientation - sha256: cd56bb59b36fa54cc28ee254bc600524f022a4862f31d5ab20abd7bb1c54e678 - url: "https://pub.dev" - source: hosted - version: "2.3.1" boolean_selector: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index ae03a7b..d13682a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -66,7 +66,6 @@ dependencies: canvas_danmaku: ^0.1.6 - auto_orientation: ^2.3.1 flutter_volume_controller: ^1.3.1 screen_brightness: ^0.2.2+1 screen_pixel: ^0.0.3