ソースを参照

Merge remote-tracking branch 'i2erp/master'

# Conflicts:
#	lib/src/chewie_player.dart
hwh97 4 年 前
コミット
2e6dc8f2ad

ファイルの差分が大きいため隠しています
+ 0 - 1
example/.flutter-plugins-dependencies


+ 10 - 5
example/ios/Flutter/flutter_export_environment.sh

@@ -1,10 +1,15 @@
 #!/bin/sh
 # This is a generated file; do not edit or check into version control.
-export "FLUTTER_ROOT=C:\flutter\flutter"
-export "FLUTTER_APPLICATION_PATH=C:\Users\Administrator\Desktop\flutter\plugins\chewie\example"
-export "FLUTTER_TARGET=lib\main.dart"
+export "FLUTTER_ROOT=/Users/i2edu/Documents/flutter_sdk/flutter"
+export "FLUTTER_APPLICATION_PATH=/Users/i2edu/Documents/workspace/plugins/video_chewie/example"
+export "FLUTTER_TARGET=lib/main.dart"
 export "FLUTTER_BUILD_DIR=build"
-export "SYMROOT=${SOURCE_ROOT}/../build\ios"
-export "FLUTTER_FRAMEWORK_DIR=C:\flutter\flutter\bin\cache\artifacts\engine\ios"
+export "SYMROOT=${SOURCE_ROOT}/../build/ios"
+export "OTHER_LDFLAGS=$(inherited) -framework Flutter"
+export "FLUTTER_FRAMEWORK_DIR=/Users/i2edu/Documents/flutter_sdk/flutter/bin/cache/artifacts/engine/ios"
 export "FLUTTER_BUILD_NAME=1.0.0"
 export "FLUTTER_BUILD_NUMBER=1"
+export "DART_OBFUSCATION=false"
+export "TRACK_WIDGET_CREATION=false"
+export "TREE_SHAKE_ICONS=false"
+export "PACKAGE_CONFIG=.packages"

+ 0 - 1
example/pubspec.yaml

@@ -9,7 +9,6 @@ dependencies:
 #    git:
 #      url: https://git.i2erp.cn/plugins/video_chewie.git
   video_player: ^0.10.1
-  auto_orientation: ^0.0.2
   flutter:
     sdk: flutter
 

+ 15 - 36
lib/src/chewie_player.dart

@@ -1,6 +1,6 @@
 import 'dart:async';
-import 'dart:io';
 
+import 'package:auto_orientation/auto_orientation.dart';
 import 'package:chewie/src/chewie_progress_colors.dart';
 import 'package:chewie/src/player_with_controls.dart';
 import 'package:flutter/material.dart';
@@ -41,12 +41,6 @@ class ChewieState extends State<Chewie> {
   @override
   void initState() {
     super.initState();
-    if (widget.controller.fullScreenByDefault) {
-      Future.delayed(Duration.zero).then((_){
-        _isFullScreen = true;
-        _pushFullScreenWidget(context);
-      });
-    }
     widget.controller.addListener(listener);
   }
 
@@ -69,9 +63,7 @@ class ChewieState extends State<Chewie> {
       _isFullScreen = true;
       await _pushFullScreenWidget(context);
     } else if (_isFullScreen) {
-      if (!widget.controller.forceFullScreen) {
-        Navigator.of(context, rootNavigator: true).pop();
-      }
+      Navigator.of(context, rootNavigator: true).pop();
       _isFullScreen = false;
     }
   }
@@ -88,23 +80,16 @@ class ChewieState extends State<Chewie> {
       BuildContext context,
       Animation<double> animation,
       _ChewieControllerProvider controllerProvider) {
-    return WillPopScope(
-        child: Scaffold(
-          resizeToAvoidBottomInset: false,
-          body: Container(
-            alignment: Alignment.center,
-            color: Colors.black,
-            child: controllerProvider,
-          ),
-        ),
-        onWillPop: _onPop,
+    return Scaffold(
+      resizeToAvoidBottomInset: false,
+      body: Container(
+        alignment: Alignment.center,
+        color: Colors.black,
+        child: controllerProvider,
+      ),
     );
   }
 
-  Future<bool> _onPop() async {
-    return true;
-  }
-
   AnimatedWidget _defaultRoutePageBuilder(
       BuildContext context,
       Animation<double> animation,
@@ -141,29 +126,27 @@ class ChewieState extends State<Chewie> {
     final TransitionRoute<Null> route = PageRouteBuilder<Null>(
       settings: RouteSettings(),
       pageBuilder: _fullScreenRoutePageBuilder,
+      fullscreenDialog: true
     );
 
     SystemChrome.setEnabledSystemUIOverlays([]);
-    /// ?????????????????????????????????????
+    if(isAndroid){
       SystemChrome.setPreferredOrientations([
         DeviceOrientation.landscapeLeft,
         DeviceOrientation.landscapeRight,
       ]);
+    }else{
+      AutoOrientation.landscapeRightMode();
+    }
 
     if (!widget.controller.allowedScreenSleep) {
       Wakelock.enable();
     }
 
-    /// not work yet
-//    if (widget.controller.forceFullScreen) {
-//      await Navigator.pushAndRemoveUntil(context, route, (Route route) => route == null);
-//    } else {
-      await Navigator.of(context, rootNavigator: true).push(route);
-//    }
+    await Navigator.of(context, rootNavigator: true).push(route);
     _isFullScreen = false;
     widget.controller.exitFullScreen();
 
-
     // The wakelock plugins checks whether it needs to perform an action internally,
     // so we do not need to check Wakelock.isEnabled.
     Wakelock.disable();
@@ -206,7 +189,6 @@ class ChewieController extends ChangeNotifier {
     this.isLive = false,
     this.allowFullScreen = true,
     this.allowMuting = true,
-    this.forceFullScreen = false,
     this.systemOverlaysAfterFullScreen = SystemUiOverlay.values,
     this.deviceOrientationsAfterFullScreen = const [
       DeviceOrientation.portraitUp,
@@ -285,9 +267,6 @@ class ChewieController extends ChangeNotifier {
   /// Defines if the mute control should be shown
   final bool allowMuting;
 
-  /// Defines if force full screen
-  final bool forceFullScreen;
-
   /// Defines the system overlays visible after exiting fullscreen
   final List<SystemUiOverlay> systemOverlaysAfterFullScreen;
 

+ 12 - 8
lib/src/player_with_controls.dart

@@ -14,15 +14,20 @@ class PlayerWithControls extends StatelessWidget {
   Widget build(BuildContext context) {
     final ChewieController chewieController = ChewieController.of(context);
 
-    return Center(
-      child: Container(
-        width: MediaQuery.of(context).size.width,
-        child: AspectRatio(
-          aspectRatio:
+    return Stack(
+      children: [
+        Center(
+          child: Container(
+            width: MediaQuery.of(context).size.width,
+            child: AspectRatio(
+              aspectRatio:
               chewieController.aspectRatio ?? _calculateAspectRatio(context),
-          child: _buildPlayerWithControls(chewieController, context),
+              child: _buildPlayerWithControls(chewieController, context),
+            ),
+          ),
         ),
-      ),
+        _buildControls(context, chewieController),
+      ],
     );
   }
 
@@ -40,7 +45,6 @@ class PlayerWithControls extends StatelessWidget {
             ),
           ),
           chewieController.overlay ?? Container(),
-          _buildControls(context, chewieController),
         ],
       ),
     );

+ 4 - 4
pubspec.yaml

@@ -19,10 +19,10 @@ dependencies:
   sys_volume:
     git:
       url: https://github.com/hwh97/flutter_volume.git
-  event_bus:
-    git:
-      url: https://git.i2erp.cn/plugins/event_bus.git
-
+#  event_bus:
+#    git:
+#      url: https://git.i2edu.net/plugins/event_bus.git
+  auto_orientation: ^1.0.6
   flutter:
     sdk: flutter
 

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません