소스 검색

Add overlay option

Ben Hagen 6 년 전
부모
커밋
8d67a22dee
3개의 변경된 파일13개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      CHANGELOG.md
  2. 8 0
      lib/src/chewie_player.dart
  3. 1 0
      lib/src/player_with_controls.dart

+ 4 - 0
CHANGELOG.md

@@ -1,5 +1,9 @@
 # Changelog
 
+## 0.9.4
+
+  * Add overlay option to place a widget between the video and the controls
+
 ## 0.9.3
 
   * Absorb pointer when controls are hidden

+ 8 - 0
lib/src/chewie_player.dart

@@ -154,6 +154,8 @@ class ChewieController extends ChangeNotifier {
     this.cupertinoProgressColors,
     this.materialProgressColors,
     this.placeholder,
+    this.overlay,
+    this.fit = BoxFit.contain,
     this.showControls = true,
     this.customControls,
     this.allowedScreenSleep = true,
@@ -212,6 +214,12 @@ class ChewieController extends ChangeNotifier {
   /// or played.
   final Widget placeholder;
 
+  /// A widget which is placed between the video and the controls
+  final Widget overlay;
+
+  /// How to fit
+  final BoxFit fit;
+
   /// Defines if the player will start in fullscreen when play is pressed
   final bool fullScreenByDefault;
 

+ 1 - 0
lib/src/player_with_controls.dart

@@ -42,6 +42,7 @@ class PlayerWithControls extends StatelessWidget {
               ),
             ),
           ),
+          chewieController.overlay ?? Container(),
           _buildControls(context, chewieController),
         ],
       ),