Procházet zdrojové kódy

Make it a nice little package

Brian Egan před 8 roky
rodič
revize
30b78fda48

+ 10 - 0
CHANGELOG.md

@@ -0,0 +1,10 @@
+# Changelog
+
+## 0.1.0
+
+Initial version of Chewie, the video player with a heart of gold.
+
+  * Hand a VideoPlayerController to Chewie, and let it do the rest.
+  * Includes Material Player Controls
+  * Includes Cupertino Player Controls
+  * Spike version: Focus on good looking UI. Internal code is sloppy, needs a refactor and tests

+ 76 - 4
README.md

@@ -1,8 +1,80 @@
 # chewie
 
-A new Flutter project.
+The video player for Flutter with a heart of gold. 
 
-## Getting Started
+The `video_player` plugin provides low-level access to video playback. Chewie uses the `video_player` under the hood, and wraps it in a friendly Material or Cupertino UI so you don't have to! 
 
-For help getting started with Flutter, view our online
-[documentation](http://flutter.io/).
+## Demo
+
+![Demo](assets/chewie_demo.gif)
+
+## Installation
+
+In your `pubspec.yaml` file within your Flutter Project: 
+
+```yaml
+dependencies:
+  chewie: ^0.1.0
+```
+
+## Use it
+
+```dart
+import 'package:chewie/chewie.dart';
+
+final playerWidget = new Chewie(
+  'https://flutter.github.io/assets-for-api-docs/videos/butterfly.mp4',
+  aspectRatio: 3 / 2,
+  autoPlay: true,
+  looping: true,
+);
+```
+
+## Example
+
+Please run the app in the `example/` folder to start playing!
+
+```
+000000000000000KKKKKKKKKKKKXXXXXXXXXXXXXKKKKKKKKKKKKKKKKKKKKKKKKKKK00
+000000000000000KKKKKKKKKKKKKXXXXXXXXXXKKKKKKKKKKKKKKKKKKKKKKKKKKKKK00
+000000000000000KKKKKKKKKKKKKXXXXXXK0xdoddoclodxOKKKKKKKKKKKKKKKKKKK00
+00000000000000KKKKKKKKKKKKKKKK0xoc:;;,;,,,,''';cldxO0KKKKKKKKKKKKK000
+00000000000000KKKKKKKKKKKKKKx:'',,,'.,'...;,'''',;:clk0KKKKKKKKKKK000
+00000000000000KKKKKKKKKKKKd;'',,,;;;'.,..,c;;,;;;;;:;;d0KKKKKKKKKK000
+00000000000000KKKKKKKKKKx,',;:ccl;,c;';,,ol::coolc:;;,,x0KKKKKKKKK000
+00000000000000KKKKKKKKOl;:;:clllll;;o;;;cooclddclllllc::kKKKKKKKKK000
+00000000000000KKKKKK0o;:ccclccccooo:ooc:ddoddloddolc;;;:c0KKKKKKK0000
+00000000000000KKKKKOccodolccclllooddddddxdxddxkkkkxxo;'';d0KKKKKK0000
+00000000000000KKKKkcoddolllllclloodxxxxdddxdddxxxddool:'.;O0KKKKK0000
+00000000000000000xloollcccc:cclclodkkxxxdddxxxkkxdlllolc,,x0KKKKK0000
+0000000000000000xccllccccc:;,'',;:dxkxxddddxkkkxdollcc:cc;d0KKKKKK000
+000000000000000kcc:::cllol:'......odxxdoccldxxxdollllc:;;:d0KKKKK0000
+00000000000000klc;;;clcc::;'...';;;:cll..',cdddolccccccc;:x0KKKKK0000
+0000000000000kdl;:cclllclllc::;,;.'.''o;,,'.;ccoooollllc:;x0KKKKK0000
+000000000000kol;:;::coolcc:::,.....,..cd,....':lolclolllc;x0KKKK00000
+00000000000Odl;:'cllol;''',;;;;::''.',:doc;,',::looc:lcol:x0K00000000
+0000000000Oxl:c,:lolc,..',:clllollodoc;cllolccloolllcclollO0K00000000
+0000000000xllc,:lool:'.,...o.;llxdo:loc;;ccodlolodldllolld00K0K000000
+000000000Ooc::coooc,,.',;:lx,,...':;o;l;':o:oolccocdoldloO0000KK00000
+00000000kol:clllc;;,.;::;:clllllolxc;.:c':ocldlccl;clldox000000000000
+000000Odll:cccc;:;,';cllooodoollcloll;c:.:d:ooo;cl;oloddkO00000000000
+0000OOddOdll;c,;;,,;;:cldodddoxdoodlcc:.,ox:o:lllocdlodx00O0000000000
+000Oxdl:::ll,:,:;,';c,:oloddolkxddxolc.'coccocolcccoooc;oxO00KOOOO000
+dc;,'...';c,,:c:::'c:';cldoo;:odolxoc:.,o:oldlxol;lddl,.,lkO0KdlcckKO
+'.......,:''';cll:cc,,;:l:c,,;:oc;cdc,.;::dldoxd:ldol;,'..,:lo,,,,kOk
+.......';'.',:clcll,,;:l:;'..''c:,;cl'.';dxoooxlddl;',''..,,;'...,ool
+.......,,.'';;:cld;.;,do:..;:,':c',:c''';xxdldocol'..';,.......',;;,;
+.......'..'',,coxc'';:do'.clc:lco',o;',;cOxdol:cc:.....'..oxd;','.'..
+'.......''..,:cxl;';;cx:''cll:clc'cl',:l:ko:c..;c:..';...,KNNl;:;ll:'
+.......''...;,ooc,,,:od'.':cccdd,,l''cl:co;;,..;;'..','..;d0O,;;:XXXK
+............'cll;',,lo'.'.::codl,c..:c;doc.,:.',....'...'......'l0XKk
+'............c;;,':lc.'',.;ccol;:,.:c.:o,;'.;'......,...',,.'...'.,;;
+.............',;;,cc..;,'';:lc':;..c'.c:;.,......,'..'...'',:,,;;,...
+..............',,;:'.';,',:c;.;;..';..,;,.........''..'...'kko.,,....
+...............;,:'..;''';:,..;''.''..''............'...'.lK0c';;c;'.
+...............,,'...,.',;''...''....,......'............'dOx',;:dd,'
+..............',.....'.,;..'..',..........'..............';:;',,ldo.'
+.............'''.'.....,'..',','..'...''..'............'.......,dx'.'
+.......................,...';,'..'.....,.'.............''.'......'..'
+...........'......'...',..'';,'..'.....................',';,..'....'.
+```

binární
assets/chewie_demo.gif


+ 25 - 20
example/lib/main.dart

@@ -1,13 +1,9 @@
-import 'package:chewie_example/chewie_player.dart';
+import 'package:chewie/chewie.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:flutter/material.dart';
-import 'package:video_player/video_player.dart';
 
 void main() => runApp(new ChewieDemo());
 
-const String butterflyUri =
-    'https://flutter.github.io/assets-for-api-docs/videos/butterfly.mp4';
-
 class ChewieDemo extends StatefulWidget {
   final String title;
 
@@ -20,9 +16,6 @@ class ChewieDemo extends StatefulWidget {
 }
 
 class _ChewieDemoState extends State<ChewieDemo> {
-  final controller = new VideoPlayerController(
-    butterflyUri,
-  );
   TargetPlatform _platform;
 
   @override
@@ -40,11 +33,22 @@ class _ChewieDemoState extends State<ChewieDemo> {
           children: <Widget>[
             new Expanded(
               child: new Center(
-                child: new ChewiePlayer(
-                  controller: controller,
+                child: new Chewie(
+                  'https://flutter.github.io/assets-for-api-docs/videos/butterfly.mp4',
                   aspectRatio: 3 / 2,
-                  looping: true,
                   autoPlay: true,
+                  looping: true,
+                  // Try playing around with some of these other options:
+                  // progressColors: new VideoProgressColors(
+                  //   playedColor: Colors.red,
+                  //   handleColor: Colors.blue,
+                  //   disabledColor: Colors.grey,
+                  //   bufferedColor: Colors.lightGreen,
+                  // ),
+                  // placeholder: new Container(
+                  //   color: Colors.grey,
+                  // ),
+                  // autoInitialize: true,
                 ),
               ),
             ),
@@ -64,15 +68,16 @@ class _ChewieDemoState extends State<ChewieDemo> {
                 )),
                 new Expanded(
                   child: new FlatButton(
-                      onPressed: () {
-                        setState(() {
-                          _platform = TargetPlatform.iOS;
-                        });
-                      },
-                      child: new Padding(
-                        padding: new EdgeInsets.symmetric(vertical: 16.0),
-                        child: new Text("iOS controls"),
-                      )),
+                    onPressed: () {
+                      setState(() {
+                        _platform = TargetPlatform.iOS;
+                      });
+                    },
+                    child: new Padding(
+                      padding: new EdgeInsets.symmetric(vertical: 16.0),
+                      child: new Text("iOS controls"),
+                    ),
+                  ),
                 )
               ],
             )

+ 0 - 25
example/test/widget_test.dart

@@ -1,25 +0,0 @@
-// This is a basic Flutter widget test.
-// To perform an interaction with a widget in your test, use the WidgetTester utility that Flutter
-// provides. For example, you can send tap and scroll gestures. You can also use WidgetTester to
-// find child widgets in the widget tree, read text, and verify that the values of widget properties
-// are correct.
-
-void main() {
-//  testWidgets('Counter increments smoke test', (WidgetTester tester) async {
-//    // Build our app and trigger a frame.
-//    await tester.pumpWidget(new MyApp());
-//
-//    // Verify that our counter starts at 0.
-//    expect(find.text('0'), findsOneWidget);
-//    expect(find.text('1'), findsNothing);
-//
-//    // Tap the '+' icon and trigger a frame.
-//    await tester.tap(find.byIcon(Icons.add));
-
-//    await tester.pump();
-//
-//    // Verify that our counter has incremented.
-//    expect(find.text('0'), findsNothing);
-//    expect(find.text('1'), findsOneWidget);
-//  });
-}

+ 1 - 0
lib/chewie.dart

@@ -1,2 +1,3 @@
 library chewie;
 
+export 'src/chewie_player.dart';

+ 54 - 18
example/lib/chewie_player.dart → lib/src/chewie_player.dart

@@ -1,25 +1,55 @@
-import 'package:flutter/foundation.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/services.dart';
 import 'package:flutter/widgets.dart';
-import 'package:chewie_example/player_with_controls.dart';
+import 'package:chewie/src/player_with_controls.dart';
 import 'dart:async';
 import 'package:video_player/video_player.dart';
 
-class ChewiePlayer extends StatefulWidget {
-  final VideoPlayerController controller;
+/// A Video Player with Material and Cupertino skins.
+///
+/// `video_player` is pretty low level. Chewie wraps it in a friendly skin to
+/// make it easy to use!
+class Chewie extends StatefulWidget {
+  /// Initialize the Video on Startup. This will prep the video for playback.
+  final bool autoInitialize;
+
+  /// Play the video as soon as it's displayed
   final bool autoPlay;
+
+  /// Whether or not the video should loop
   final bool looping;
+
+  /// The Aspect Ratio of the Video. Important to get the correct size of the
+  /// video!
+  ///
+  /// Will fallback to fitting within the space allowed.
   final double aspectRatio;
 
-  ChewiePlayer({
+  /// The colors to use for the Progress Bar. By default, the Material player
+  /// uses the colors from your Theme. The Cupertino player uses colors taken
+  /// from iOS designs.
+  final VideoProgressColors progressColors;
+
+  /// The placeholder is displayed underneath the Video before it is initialized
+  /// or played.
+  final Widget placeholder;
+
+  // THe internal controller created from the URI.
+  final VideoPlayerController _controller;
+
+  Chewie(
+    String uri, {
     Key key,
-    @required this.controller,
     this.aspectRatio,
+    this.autoInitialize = false,
     this.autoPlay = false,
     this.looping = false,
+    this.progressColors,
+    this.placeholder,
   })
-      : super(key: key);
+      : assert(uri != null, 'You must provide a URI to a video'),
+        this._controller = new VideoPlayerController(uri),
+        super(key: key);
 
   @override
   State<StatefulWidget> createState() {
@@ -27,15 +57,19 @@ class ChewiePlayer extends StatefulWidget {
   }
 }
 
-class _ChewiePlayerState extends State<ChewiePlayer> {
+class _ChewiePlayerState extends State<Chewie> {
   @override
   Widget build(BuildContext context) {
     return new PlayerWithControls(
-        controller: widget.controller,
-        onExpandCollapse: () {
-          return _pushFullScreenWidget(context);
-        },
-        aspectRatio: widget.aspectRatio ?? _calculateAspectRatio(context));
+      controller: widget._controller,
+      onExpandCollapse: () {
+        return _pushFullScreenWidget(context);
+      },
+      aspectRatio: widget.aspectRatio ?? _calculateAspectRatio(context),
+      progressColors: widget.progressColors,
+      placeholder: widget.placeholder,
+      autoPlay: widget.autoPlay,
+    );
   }
 
   @override
@@ -51,7 +85,7 @@ class _ChewiePlayerState extends State<ChewiePlayer> {
       body: new Container(
         color: Colors.black,
         child: new PlayerWithControls(
-          controller: widget.controller,
+          controller: widget._controller,
           onExpandCollapse: () => new Future.value(Navigator.of(context).pop()),
           aspectRatio: widget.aspectRatio,
           fullScreen: true,
@@ -74,11 +108,14 @@ class _ChewiePlayerState extends State<ChewiePlayer> {
   }
 
   Future _initialize() async {
-    await widget.controller.setLooping(widget.looping);
-    await widget.controller.initialize();
+    await widget._controller.setLooping(widget.looping);
+
+    if (widget.autoInitialize || widget.autoPlay) {
+      await widget._controller.initialize();
+    }
 
     if (widget.autoPlay) {
-      await widget.controller.play();
+      await widget._controller.play();
     }
   }
 
@@ -101,6 +138,5 @@ class _ChewiePlayerState extends State<ChewiePlayer> {
     final height = size.height;
 
     return width > height ? width / height : height / width;
-
   }
 }

+ 49 - 31
example/lib/cupertino_controls.dart → lib/src/cupertino_controls.dart

@@ -2,8 +2,8 @@ import 'dart:async';
 import 'dart:math' as math;
 import 'dart:ui';
 
-import 'package:chewie_example/cupertino_progress_bar.dart';
-import 'package:chewie_example/utils.dart';
+import 'package:chewie/src/cupertino_progress_bar.dart';
+import 'package:chewie/src/utils.dart';
 import 'package:flutter/material.dart';
 import 'package:meta/meta.dart';
 import 'package:open_iconic_flutter/open_iconic_flutter.dart';
@@ -15,6 +15,8 @@ class CupertinoControls extends StatefulWidget {
   final VideoPlayerController controller;
   final Future<dynamic> Function() onExpandCollapse;
   final bool fullScreen;
+  final VideoProgressColors progressColors;
+  final bool autoPlay;
 
   CupertinoControls({
     @required this.backgroundColor,
@@ -22,6 +24,8 @@ class CupertinoControls extends StatefulWidget {
     @required this.controller,
     @required this.onExpandCollapse,
     @required this.fullScreen,
+    @required this.progressColors,
+    @required this.autoPlay,
   });
 
   @override
@@ -372,7 +376,11 @@ class _CupertinoControlsState extends State<CupertinoControls> {
 
     _updateState();
 
-    _startHideTimer();
+    if ((widget.controller.value != null &&
+            widget.controller.value.isPlaying) ||
+        widget.autoPlay) {
+      _startHideTimer();
+    }
 
     new Timer(new Duration(milliseconds: 200), () {
       setState(() {
@@ -409,38 +417,39 @@ class _CupertinoControlsState extends State<CupertinoControls> {
           onDragEnd: () {
             _startHideTimer();
           },
-          colors: new VideoProgressColors(
-            playedColor: new Color.fromARGB(
-              120,
-              255,
-              255,
-              255,
-            ),
-            handleColor: new Color.fromARGB(
-              255,
-              255,
-              255,
-              255,
-            ),
-            bufferedColor: new Color.fromARGB(
-              60,
-              255,
-              255,
-              255,
-            ),
-            disabledColor: new Color.fromARGB(
-              20,
-              255,
-              255,
-              255,
-            ),
-          ),
+          colors: widget.progressColors ??
+              new VideoProgressColors(
+                playedColor: new Color.fromARGB(
+                  120,
+                  255,
+                  255,
+                  255,
+                ),
+                handleColor: new Color.fromARGB(
+                  255,
+                  255,
+                  255,
+                  255,
+                ),
+                bufferedColor: new Color.fromARGB(
+                  60,
+                  255,
+                  255,
+                  255,
+                ),
+                disabledColor: new Color.fromARGB(
+                  20,
+                  255,
+                  255,
+                  255,
+                ),
+              ),
         ),
       ),
     );
   }
 
-  void _playPause() {
+  _playPause() {
     setState(() {
       if (widget.controller.value.isPlaying) {
         _hideStuff = false;
@@ -448,12 +457,20 @@ class _CupertinoControlsState extends State<CupertinoControls> {
         widget.controller.pause();
       } else {
         _cancelAndRestartTimer();
-        widget.controller.play();
+
+        if (!widget.controller.value.initialized) {
+          widget.controller.initialize().then((_) {
+            widget.controller.play();
+          });
+        } else {
+          widget.controller.play();
+        }
       }
     });
   }
 
   void _skipBack() {
+    _cancelAndRestartTimer();
     final beginning = new Duration(seconds: 0).inMicroseconds;
     final skip =
         (_latestValue.position - new Duration(seconds: 15)).inMicroseconds;
@@ -462,6 +479,7 @@ class _CupertinoControlsState extends State<CupertinoControls> {
   }
 
   void _skipForward() {
+    _cancelAndRestartTimer();
     final end = _latestValue.duration.inMicroseconds;
     final skip =
         (_latestValue.position + new Duration(seconds: 15)).inMicroseconds;

+ 14 - 21
example/lib/cupertino_progress_bar.dart → lib/src/cupertino_progress_bar.dart

@@ -9,7 +9,8 @@ class CupertinoVideoProgressBar extends StatefulWidget {
   final Function() onDragEnd;
   final Function() onDragUpdate;
 
-  CupertinoVideoProgressBar(this.controller, {
+  CupertinoVideoProgressBar(
+    this.controller, {
     VideoProgressColors colors,
     this.onDragEnd,
     this.onDragStart,
@@ -62,24 +63,18 @@ class _VideoProgressBarState extends State<CupertinoVideoProgressBar> {
       child: (controller.value.isErroneous)
           ? new Text(controller.value.errorDescription)
           : new Center(
-        child: new Container(
-          height: MediaQuery
-              .of(context)
-              .size
-              .height,
-          width: MediaQuery
-              .of(context)
-              .size
-              .width,
-          color: Colors.transparent,
-          child: new CustomPaint(
-            painter: new _ProgressBarPainter(
-              controller.value,
-              widget.colors,
+              child: new Container(
+                height: MediaQuery.of(context).size.height,
+                width: MediaQuery.of(context).size.width,
+                color: Colors.transparent,
+                child: new CustomPaint(
+                  painter: new _ProgressBarPainter(
+                    controller.value,
+                    widget.colors,
+                  ),
+                ),
+              ),
             ),
-          ),
-        ),
-      ),
       onHorizontalDragStart: (DragStartDetails details) {
         if (!controller.value.initialized) {
           return;
@@ -99,7 +94,6 @@ class _VideoProgressBarState extends State<CupertinoVideoProgressBar> {
         }
         seekToRelativePosition(details.globalPosition);
 
-
         if (widget.onDragUpdate != null) {
           widget.onDragUpdate();
         }
@@ -184,8 +178,7 @@ class _ProgressBarPainter extends CustomPainter {
     final shadowPath = new Path()
       ..addOval(new Rect.fromCircle(
           center: new Offset(playedPart, baseOffset + barHeight / 2),
-          radius: handleHeight
-      ));
+          radius: handleHeight));
 
     canvas.drawShadow(shadowPath, Colors.black, 0.2, false);
     canvas.drawCircle(

+ 26 - 10
example/lib/material_controls.dart → lib/src/material_controls.dart

@@ -1,8 +1,8 @@
 import 'dart:async';
 import 'dart:ui';
 
-import 'package:chewie_example/material_progress_bar.dart';
-import 'package:chewie_example/utils.dart';
+import 'package:chewie/src/material_progress_bar.dart';
+import 'package:chewie/src/utils.dart';
 import 'package:flutter/material.dart';
 import 'package:meta/meta.dart';
 import 'package:video_player/video_player.dart';
@@ -11,11 +11,15 @@ class MaterialControls extends StatefulWidget {
   final VideoPlayerController controller;
   final bool fullScreen;
   final Future<dynamic> Function() onExpandCollapse;
+  final VideoProgressColors progressColors;
+  final bool autoPlay;
 
   MaterialControls({
     @required this.controller,
     @required this.fullScreen,
     @required this.onExpandCollapse,
+    @required this.progressColors,
+    @required this.autoPlay,
   });
 
   @override
@@ -115,7 +119,7 @@ class _MaterialControlsState extends State<MaterialControls> {
         onTap: _latestValue != null && _latestValue.isPlaying
             ? _cancelAndRestartTimer
             : () {
-                widget.controller.play();
+                _playPause();
 
                 setState(() {
                   _hideStuff = true;
@@ -238,7 +242,11 @@ class _MaterialControlsState extends State<MaterialControls> {
 
     _updateState();
 
-    _startHideTimer();
+    if ((widget.controller.value != null &&
+            widget.controller.value.isPlaying) ||
+        widget.autoPlay) {
+      _startHideTimer();
+    }
 
     new Timer(new Duration(milliseconds: 200), () {
       setState(() {
@@ -271,7 +279,14 @@ class _MaterialControlsState extends State<MaterialControls> {
         widget.controller.pause();
       } else {
         _cancelAndRestartTimer();
-        widget.controller.play();
+
+        if (!widget.controller.value.initialized) {
+          widget.controller.initialize().then((_) {
+            widget.controller.play();
+          });
+        } else {
+          widget.controller.play();
+        }
       }
     });
   }
@@ -312,11 +327,12 @@ class _MaterialControlsState extends State<MaterialControls> {
 
             _startHideTimer();
           },
-          colors: new VideoProgressColors(
-              playedColor: Theme.of(context).accentColor,
-              handleColor: Theme.of(context).accentColor,
-              bufferedColor: Theme.of(context).backgroundColor,
-              disabledColor: Theme.of(context).disabledColor),
+          colors: widget.progressColors ??
+              new VideoProgressColors(
+                  playedColor: Theme.of(context).accentColor,
+                  handleColor: Theme.of(context).accentColor,
+                  bufferedColor: Theme.of(context).backgroundColor,
+                  disabledColor: Theme.of(context).disabledColor),
         ),
       ),
     );

+ 0 - 1
example/lib/material_progress_bar.dart → lib/src/material_progress_bar.dart

@@ -94,7 +94,6 @@ class _VideoProgressBarState extends State<MaterialVideoProgressBar> {
         }
         seekToRelativePosition(details.globalPosition);
 
-
         if (widget.onDragUpdate != null) {
           widget.onDragUpdate();
         }

+ 19 - 8
example/lib/player_with_controls.dart → lib/src/player_with_controls.dart

@@ -5,21 +5,27 @@ import 'package:video_player/video_player.dart';
 import 'dart:async';
 
 import 'dart:ui';
-import 'package:chewie_example/material_controls.dart';
-import 'package:chewie_example/cupertino_controls.dart';
+import 'package:chewie/src/material_controls.dart';
+import 'package:chewie/src/cupertino_controls.dart';
 
 class PlayerWithControls extends StatefulWidget {
   final VideoPlayerController controller;
   final Future<dynamic> Function() onExpandCollapse;
   final bool fullScreen;
-
+  final VideoProgressColors progressColors;
+  final Widget placeholder;
   final double aspectRatio;
+  final bool autoPlay;
 
-  PlayerWithControls(
-      {@required this.controller,
-      @required this.onExpandCollapse,
-      @required this.aspectRatio,
-      this.fullScreen = false});
+  PlayerWithControls({
+    @required this.controller,
+    @required this.onExpandCollapse,
+    @required this.aspectRatio,
+    this.fullScreen = false,
+    this.progressColors,
+    this.placeholder,
+    this.autoPlay,
+  });
 
   @override
   State createState() {
@@ -40,6 +46,7 @@ class _VideoPlayerWithControlsState extends State<PlayerWithControls> {
           child: new Container(
             child: new Stack(
               children: <Widget>[
+                widget.placeholder ?? new Container(),
                 new Hero(
                   tag: controller,
                   child: new Center(
@@ -53,6 +60,8 @@ class _VideoPlayerWithControlsState extends State<PlayerWithControls> {
                         controller: controller,
                         onExpandCollapse: widget.onExpandCollapse,
                         fullScreen: widget.fullScreen,
+                        progressColors: widget.progressColors,
+                        autoPlay: widget.autoPlay,
                       )
                     : new CupertinoControls(
                         backgroundColor: new Color.fromRGBO(41, 41, 41, 0.7),
@@ -60,6 +69,8 @@ class _VideoPlayerWithControlsState extends State<PlayerWithControls> {
                         controller: controller,
                         onExpandCollapse: widget.onExpandCollapse,
                         fullScreen: widget.fullScreen,
+                        progressColors: widget.progressColors,
+                        autoPlay: widget.autoPlay,
                       ),
               ],
             ),

+ 0 - 0
example/lib/utils.dart → lib/src/utils.dart


+ 4 - 4
pubspec.yaml

@@ -1,20 +1,20 @@
 name: chewie
-description: iOS and Android playback controls for the video_player plugin
+description: The video player for Flutter with a heart of gold
+version: 0.1.0
+homepage: https://github.com/brianegan/chewie
+author: Brian Egan <brian@brianegan.com>
 
 dependencies:
   open_iconic_flutter: ^0.2.0
-  font_awesome_flutter:
   connectivity: ^0.1.1
   video_player: ^0.0.6
   flutter:
     sdk: flutter
-  cupertino_icons: ^0.1.0
 
 dev_dependencies:
   flutter_test:
     sdk: flutter
 
-
 # For information on the generic Dart part of this file, see the
 # following page: https://www.dartlang.org/tools/pub/pubspec
 

+ 0 - 24
test/widget_test.dart

@@ -1,24 +0,0 @@
-// This is a basic Flutter widget test.
-// To perform an interaction with a widget in your test, use the WidgetTester utility that Flutter
-// provides. For example, you can send tap and scroll gestures. You can also use WidgetTester to
-// find child widgets in the widget tree, read text, and verify that the values of widget properties
-// are correct.
-
-void main() {
-//  testWidgets('Counter increments smoke test', (WidgetTester tester) async {
-//    // Build our app and trigger a frame.
-//    await tester.pumpWidget(new MyApp());
-//
-//    // Verify that our counter starts at 0.
-//    expect(find.text('0'), findsOneWidget);
-//    expect(find.text('1'), findsNothing);
-//
-//    // Tap the '+' icon and trigger a frame.
-//    await tester.tap(find.byIcon(Icons.add));
-//    await tester.pump();
-//
-//    // Verify that our counter has incremented.
-//    expect(find.text('0'), findsNothing);
-//    expect(find.text('1'), findsOneWidget);
-//  });
-}