Browse Source

添加旋转

i2edu 4 years ago
parent
commit
2c1de15ecb
4 changed files with 14 additions and 12 deletions
  1. 0 1
      example/.flutter-plugins-dependencies
  2. 12 6
      example/lib/auto_rotate.dart
  3. 1 1
      example/pubspec.yaml
  4. 1 4
      pubspec.yaml

File diff suppressed because it is too large
+ 0 - 1
example/.flutter-plugins-dependencies


+ 12 - 6
example/lib/auto_rotate.dart

@@ -1,3 +1,5 @@
+import 'dart:io';
+
 import 'package:auto_orientation/auto_orientation.dart';
 import 'package:chewie/chewie.dart';
 import 'package:chewie/src/chewie_player.dart';
@@ -204,11 +206,15 @@ class VideoScaffold extends StatefulWidget {
 class _VideoScaffoldState extends State<VideoScaffold> {
   @override
   void initState() {
-    SystemChrome.setPreferredOrientations([
-      DeviceOrientation.landscapeRight,
-      DeviceOrientation.landscapeLeft,
-    ]);
-    AutoOrientation.landscapeMode();
+    if(Platform.isIOS){
+      AutoOrientation.landscapeLeftMode();
+
+    }else{
+      SystemChrome.setPreferredOrientations([
+        DeviceOrientation.landscapeRight,
+        DeviceOrientation.landscapeLeft,
+      ]);
+    }
     super.initState();
   }
 
@@ -218,7 +224,7 @@ class _VideoScaffoldState extends State<VideoScaffold> {
       DeviceOrientation.portraitUp,
       DeviceOrientation.portraitDown,
     ]);
-    AutoOrientation.portraitMode();
+    AutoOrientation.portraitUpMode();
     super.dispose();
   }
 

+ 1 - 1
example/pubspec.yaml

@@ -8,7 +8,7 @@ dependencies:
     #    path: ../plugins/chewie/
 #    git:
 #      url: https://git.i2erp.cn/plugins/video_chewie.git
-  video_player: ^0.10.1
+  video_player: ^1.0.1
   flutter:
     sdk: flutter
 

+ 1 - 4
pubspec.yaml

@@ -11,7 +11,7 @@ environment:
 
 dependencies:
   open_iconic_flutter: ">=0.3.0 <0.4.0"
-  video_player: ">=0.7.0 <0.11.0"
+  video_player: ^1.0.1
   wakelock: ">=0.1.2 <0.2.0"
   screen:
     git:
@@ -19,9 +19,6 @@ dependencies:
   sys_volume:
     git:
       url: https://github.com/hwh97/flutter_volume.git
-  event_bus:
-    git:
-      url: https://git.i2erp.cn/plugins/event_bus.git
   auto_orientation: ^1.0.6
   flutter:
     sdk: flutter

Some files were not shown because too many files changed in this diff