From 90314f89ed0cc203b44fcc87d46fbc8962846a05 Mon Sep 17 00:00:00 2001 From: guozhigq Date: Sat, 14 Oct 2023 17:18:00 +0800 Subject: [PATCH] =?UTF-8?q?mod:=20=E8=BF=98=E5=8E=9F=E5=85=A8=E5=B1=8F?= =?UTF-8?q?=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/plugin/pl_player/utils/fullscreen.dart | 24 +++++++++++----------- pubspec.lock | 8 ++++++++ pubspec.yaml | 2 +- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/lib/plugin/pl_player/utils/fullscreen.dart b/lib/plugin/pl_player/utils/fullscreen.dart index 395745a9..06ae2d60 100644 --- a/lib/plugin/pl_player/utils/fullscreen.dart +++ b/lib/plugin/pl_player/utils/fullscreen.dart @@ -1,7 +1,7 @@ import 'dart:io'; import 'package:device_info_plus/device_info_plus.dart'; -// import 'package:auto_orientation/auto_orientation.dart'; +import 'package:auto_orientation/auto_orientation.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; @@ -12,17 +12,17 @@ Future landScape() async { if (kIsWeb) { await document.documentElement?.requestFullscreen(); } else if (Platform.isAndroid || Platform.isIOS) { - await SystemChrome.setEnabledSystemUIMode( - SystemUiMode.immersiveSticky, - overlays: [], - ); - await SystemChrome.setPreferredOrientations( - [ - DeviceOrientation.landscapeLeft, - DeviceOrientation.landscapeRight, - ], - ); - // await AutoOrientation.landscapeAutoMode(forceSensor: true); + // await SystemChrome.setEnabledSystemUIMode( + // SystemUiMode.immersiveSticky, + // overlays: [], + // ); + // await SystemChrome.setPreferredOrientations( + // [ + // DeviceOrientation.landscapeLeft, + // DeviceOrientation.landscapeRight, + // ], + // ); + await AutoOrientation.landscapeAutoMode(forceSensor: true); } else if (Platform.isMacOS || Platform.isWindows || Platform.isLinux) { await const MethodChannel('com.alexmercerind/media_kit_video') .invokeMethod( diff --git a/pubspec.lock b/pubspec.lock index 8d83afb9..834bb054 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -65,6 +65,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.1" + 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 2b605bd1..2672cf63 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -94,7 +94,7 @@ dependencies: universal_platform: ^1.0.0+1 # 进度条 audio_video_progress_bar: ^1.0.1 - # auto_orientation: ^2.3.1 + auto_orientation: ^2.3.1 protobuf: ^3.0.0 animations: ^2.0.7