Procházet zdrojové kódy

Update to Video player 0.2.0 (#7)

* Update to work with `video_player: ">=0.2.0 <0.3.0`
* Add `showControls` option. You can use this to show / hide the controls
* Move from `VideoProgressColors` to `ChewieProgressColors` for customization of the Chewie progress controls
* Remove `progressColors` in favor of platform-specific customizations: `cupertinoProgressColors` and `materialProgressColors` to control 
* Add analysis options
Brian Egan před 7 roky
rodič
revize
f56386f03c

+ 2 - 0
.gitignore

@@ -7,3 +7,5 @@ build/
 ios/.generated/
 packages
 pubspec.lock
+.iml
+Podfile.lock

+ 8 - 0
CHANGELOG.md

@@ -1,5 +1,13 @@
 # Changelog
 
+## 0.3.0
+
+  * Update to work with `video_player: ">=0.2.0 <0.3.0`
+  * Add `showControls` option. You can use this to show / hide the controls
+  * Move from `VideoProgressColors` to `ChewieProgressColors` for customization of the Chewie progress controls
+  * Remove `progressColors` in favor of platform-specific customizations: `cupertinoProgressColors` and `materialProgressColors` to control 
+  * Add analysis options
+
 ## 0.2.0
 
   * Take a `controller` instead of a `String uri`. Allows for better control of playback outside the player if need be.

+ 2 - 2
README.md

@@ -2,7 +2,7 @@
 
 The video player for Flutter with a heart of gold. 
 
-The [`video_player`](https://pub.dartlang.org/packages/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! 
+The [`video_player`](https://pub.dartlang.org/packages/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! 
 
 ## Demo
 
@@ -14,7 +14,7 @@ In your `pubspec.yaml` file within your Flutter Project:
 
 ```yaml
 dependencies:
-  chewie: ^0.2.0
+  chewie: ^0.3.0
 ```
 
 ## Use it

+ 15 - 0
analysis_options.yaml

@@ -0,0 +1,15 @@
+analyzer:
+  strong-mode:
+    implicit-casts: false
+    implicit-dynamic: false
+
+linter:
+  rules:
+    - cancel_subscriptions
+    - close_sinks
+    - hash_and_equals
+    - iterable_contains_unrelated_type
+    - list_remove_unrelated_type
+    - test_types_in_equals
+    - unrelated_type_equality_checks
+    - valid_regexps

+ 4 - 0
chewie.iml

@@ -8,8 +8,12 @@
       <excludeFolder url="file://$MODULE_DIR$/.idea" />
       <excludeFolder url="file://$MODULE_DIR$/.pub" />
       <excludeFolder url="file://$MODULE_DIR$/build" />
+      <excludeFolder url="file://$MODULE_DIR$/chewie_example/.pub" />
+      <excludeFolder url="file://$MODULE_DIR$/chewie_example/build" />
       <excludeFolder url="file://$MODULE_DIR$/example/.pub" />
       <excludeFolder url="file://$MODULE_DIR$/example/build" />
+      <excludeFolder url="file://$MODULE_DIR$/example_new/.pub" />
+      <excludeFolder url="file://$MODULE_DIR$/example_new/build" />
     </content>
     <orderEntry type="sourceFolder" forTests="false" />
     <orderEntry type="library" name="Dart SDK" level="project" />

+ 1 - 0
example/.gitignore

@@ -1,6 +1,7 @@
 .DS_Store
 .atom/
 .idea
+.vscode/
 .packages
 .pub/
 build/

+ 2 - 2
example/.metadata

@@ -4,5 +4,5 @@
 # This file should be version controlled and should not be manually edited.
 
 version:
-  revision: d957c8f040902aa3fd44b367150bde56b64cec83
-  channel: alpha
+  revision: ab4506cad2a860e1cb6186c0957eeb86024a7c6b
+  channel: dev

+ 1 - 0
example/android/.gitignore

@@ -1,4 +1,5 @@
 *.iml
+*.class
 .gradle
 /local.properties
 /.idea/workspace.xml

+ 8 - 9
example/android/app/build.gradle

@@ -1,8 +1,8 @@
 def localProperties = new Properties()
 def localPropertiesFile = rootProject.file('local.properties')
 if (localPropertiesFile.exists()) {
-    localPropertiesFile.withInputStream { stream ->
-        localProperties.load(stream)
+    localPropertiesFile.withReader('UTF-8') { reader ->
+        localProperties.load(reader)
     }
 }
 
@@ -15,8 +15,7 @@ apply plugin: 'com.android.application'
 apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
 
 android {
-    compileSdkVersion 25
-    buildToolsVersion '25.0.3'
+    compileSdkVersion 27
 
     lintOptions {
         disable 'InvalidPackage'
@@ -24,9 +23,9 @@ android {
 
     defaultConfig {
         // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
-        applicationId "com.yourcompany.chewie"
+        applicationId "com.example.chewieexample"
         minSdkVersion 16
-        targetSdkVersion 25
+        targetSdkVersion 27
         versionCode 1
         versionName "1.0"
         testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
@@ -46,7 +45,7 @@ flutter {
 }
 
 dependencies {
-    androidTestCompile 'com.android.support:support-annotations:25.4.0'
-    androidTestCompile 'com.android.support.test:runner:0.5'
-    androidTestCompile 'com.android.support.test:rules:0.5'
+    testImplementation 'junit:junit:4.12'
+    androidTestImplementation 'com.android.support.test:runner:1.0.1'
+    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
 }

+ 2 - 2
example/android/app/src/main/AndroidManifest.xml

@@ -1,5 +1,5 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.yourcompany.chewie">
+    package="com.example.chewieexample">
 
     <!-- The INTERNET permission is required for development. Specifically,
          flutter needs it to communicate with the running application
@@ -14,7 +14,7 @@
          FlutterApplication and put your custom class here. -->
     <application
         android:name="io.flutter.app.FlutterApplication"
-        android:label="chewie"
+        android:label="chewie_example"
         android:icon="@mipmap/ic_launcher">
         <activity
             android:name=".MainActivity"

+ 1 - 1
example/android/app/src/main/java/com/yourcompany/chewie/MainActivity.java → example/android/app/src/main/java/com/example/chewieexample/MainActivity.java

@@ -1,4 +1,4 @@
-package com.yourcompany.chewie;
+package com.example.chewieexample;
 
 import android.os.Bundle;
 

+ 5 - 7
example/android/build.gradle

@@ -1,28 +1,26 @@
 buildscript {
     repositories {
+        google()
         jcenter()
-        maven {
-            url "https://maven.google.com"
-        }
     }
 
     dependencies {
-        classpath 'com.android.tools.build:gradle:2.3.3'
+        classpath 'com.android.tools.build:gradle:3.0.1'
     }
 }
 
 allprojects {
     repositories {
+        google()
         jcenter()
-        maven {
-            url "https://maven.google.com"
-        }
     }
 }
 
 rootProject.buildDir = '../build'
 subprojects {
     project.buildDir = "${rootProject.buildDir}/${project.name}"
+}
+subprojects {
     project.evaluationDependsOn(':app')
 }
 

+ 1 - 1
example/android/gradle/wrapper/gradle-wrapper.properties

@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip

+ 1 - 1
example/android/settings.gradle

@@ -5,7 +5,7 @@ def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
 def plugins = new Properties()
 def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
 if (pluginsFile.exists()) {
-    pluginsFile.withInputStream { stream -> plugins.load(stream) }
+    pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
 }
 
 plugins.each { name, path ->

+ 1 - 0
example/ios/.gitignore

@@ -33,6 +33,7 @@ Icon?
 
 /Flutter/app.flx
 /Flutter/app.zip
+/Flutter/flutter_assets/
 /Flutter/App.framework
 /Flutter/Flutter.framework
 /Flutter/Generated.xcconfig

+ 36 - 18
example/ios/Podfile

@@ -1,30 +1,48 @@
 # Uncomment this line to define a global platform for your project
 # platform :ios, '9.0'
 
-if ENV['FLUTTER_FRAMEWORK_DIR'] == nil
-  abort('Please set FLUTTER_FRAMEWORK_DIR to the directory containing Flutter.framework')
-end
-
-target 'Runner' do
-  # Pods for Runner
+# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
+ENV['COCOAPODS_DISABLE_STATS'] = 'true'
 
-  # Flutter Pods
-  pod 'Flutter', :path => ENV['FLUTTER_FRAMEWORK_DIR']
-
-  if File.exists? '../.flutter-plugins'
-    flutter_root = File.expand_path('..')
-    File.foreach('../.flutter-plugins') { |line|
-      plugin = line.split(pattern='=')
+def parse_KV_file(file,seperator='=')
+  file_abs_path = File.expand_path(file)
+  if !File.exists? file_abs_path
+    return [];
+  end
+  pods_ary = []
+  skip_line_start_symbols = ["#", "/"]
+  File.foreach(file_abs_path) { |line|
+      next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
+      plugin = line.split(pattern=seperator)
       if plugin.length == 2
-        name = plugin[0].strip()
+        podname = plugin[0].strip()
         path = plugin[1].strip()
-        resolved_path = File.expand_path("#{path}/ios", flutter_root)
-        pod name, :path => resolved_path
+        podpath = File.expand_path("#{path}", file_abs_path)
+        pods_ary.push({:name => podname,:path=>podpath});
       else
         puts "Invalid plugin specification: #{line}"
       end
-    }
+  }
+  return pods_ary
+end
+
+target 'Runner' do
+  # Flutter Pods
+  generated_xcode_build_settings = parse_KV_file("./Flutter/Generated.xcconfig")
+  if generated_xcode_build_settings.empty?
+    puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter build or flutter run is executed once first."
   end
+  generated_xcode_build_settings.map{ |p|
+    if p[:name]=='FLUTTER_FRAMEWORK_DIR'
+      pod 'Flutter', :path => p[:path]
+    end
+  }
+
+  # Plugin Pods
+  plugin_pods = parse_KV_file("../.flutter-plugins")
+  plugin_pods.map{ |p|
+    pod p[:name], :path => File.expand_path("ios",p[:path])
+  }
 end
 
 post_install do |installer|
@@ -33,4 +51,4 @@ post_install do |installer|
       config.build_settings['ENABLE_BITCODE'] = 'NO'
     end
   end
-end
+end

+ 37 - 37
example/ios/Runner.xcodeproj/project.pbxproj

@@ -7,7 +7,9 @@
 	objects = {
 
 /* Begin PBXBuildFile section */
+		0ABD858FAEF33B8F44F581F0 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 891E43F580F30980509C464D /* libPods-Runner.a */; };
 		1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
+		2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378251FAA1A9400D5DBA9 /* flutter_assets */; };
 		3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
 		3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
 		3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
@@ -15,13 +17,11 @@
 		9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
 		9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; };
-		9740EEBB1CF902C7004384FC /* app.flx in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB71CF902C7004384FC /* app.flx */; };
 		978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
 		97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };
 		97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
 		97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
 		97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
-		C1028F25EBDDF65DE14D9820 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D99FC41D070BE0C58FF7B3E8 /* libPods-Runner.a */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXCopyFilesBuildPhase section */
@@ -42,14 +42,15 @@
 /* Begin PBXFileReference section */
 		1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
 		1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
+		2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; };
 		3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
 		3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
 		7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
 		7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
 		7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
+		891E43F580F30980509C464D /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; };
 		9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
 		9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
-		9740EEB71CF902C7004384FC /* app.flx */ = {isa = PBXFileReference; lastKnownFileType = file; name = app.flx; path = Flutter/app.flx; sourceTree = "<group>"; };
 		9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = "<group>"; };
 		97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
 		97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
@@ -57,7 +58,6 @@
 		97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
 		97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
 		97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
-		D99FC41D070BE0C58FF7B3E8 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -67,24 +67,17 @@
 			files = (
 				9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
 				3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
-				C1028F25EBDDF65DE14D9820 /* libPods-Runner.a in Frameworks */,
+				0ABD858FAEF33B8F44F581F0 /* libPods-Runner.a in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 /* End PBXFrameworksBuildPhase section */
 
 /* Begin PBXGroup section */
-		4159C4AD1DA1D9810FAAE20D /* Pods */ = {
+		345CF767F333A6932C0BBB1C /* Frameworks */ = {
 			isa = PBXGroup;
 			children = (
-			);
-			name = Pods;
-			sourceTree = "<group>";
-		};
-		87F8ADE2B230EC9299591C3B /* Frameworks */ = {
-			isa = PBXGroup;
-			children = (
-				D99FC41D070BE0C58FF7B3E8 /* libPods-Runner.a */,
+				891E43F580F30980509C464D /* libPods-Runner.a */,
 			);
 			name = Frameworks;
 			sourceTree = "<group>";
@@ -92,7 +85,7 @@
 		9740EEB11CF90186004384FC /* Flutter */ = {
 			isa = PBXGroup;
 			children = (
-				9740EEB71CF902C7004384FC /* app.flx */,
+				2D5378251FAA1A9400D5DBA9 /* flutter_assets */,
 				3B80C3931E831B6300D905FE /* App.framework */,
 				3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
 				9740EEBA1CF902C7004384FC /* Flutter.framework */,
@@ -109,8 +102,8 @@
 				9740EEB11CF90186004384FC /* Flutter */,
 				97C146F01CF9000F007C117D /* Runner */,
 				97C146EF1CF9000F007C117D /* Products */,
-				4159C4AD1DA1D9810FAAE20D /* Pods */,
-				87F8ADE2B230EC9299591C3B /* Frameworks */,
+				E60E3BF33DDF10E510884550 /* Pods */,
+				345CF767F333A6932C0BBB1C /* Frameworks */,
 			);
 			sourceTree = "<group>";
 		};
@@ -146,6 +139,13 @@
 			name = "Supporting Files";
 			sourceTree = "<group>";
 		};
+		E60E3BF33DDF10E510884550 /* Pods */ = {
+			isa = PBXGroup;
+			children = (
+			);
+			name = Pods;
+			sourceTree = "<group>";
+		};
 /* End PBXGroup section */
 
 /* Begin PBXNativeTarget section */
@@ -153,15 +153,15 @@
 			isa = PBXNativeTarget;
 			buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
 			buildPhases = (
-				F068A0ECD180E97D531B9AF4 /* [CP] Check Pods Manifest.lock */,
+				8C591DA2CC232657C8302C0F /* [CP] Check Pods Manifest.lock */,
 				9740EEB61CF901F6004384FC /* Run Script */,
 				97C146EA1CF9000F007C117D /* Sources */,
 				97C146EB1CF9000F007C117D /* Frameworks */,
 				97C146EC1CF9000F007C117D /* Resources */,
 				9705A1C41CF9048500538489 /* Embed Frameworks */,
 				3B06AD1E1E4923F5004D2608 /* Thin Binary */,
-				1CE79212F95ADCB77DC1EC7D /* [CP] Embed Pods Frameworks */,
-				0FC340615B28B3D9808C2E39 /* [CP] Copy Pods Resources */,
+				8882ECDD31D097CE5A94142C /* [CP] Embed Pods Frameworks */,
+				EB1ED22BA050462AEFF08BFA /* [CP] Copy Pods Resources */,
 			);
 			buildRules = (
 			);
@@ -209,12 +209,12 @@
 			isa = PBXResourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				9740EEBB1CF902C7004384FC /* app.flx in Resources */,
 				97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
 				9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */,
 				3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
 				9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */,
 				97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
+				2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */,
 				97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
@@ -222,22 +222,21 @@
 /* End PBXResourcesBuildPhase section */
 
 /* Begin PBXShellScriptBuildPhase section */
-		0FC340615B28B3D9808C2E39 /* [CP] Copy Pods Resources */ = {
+		3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
 			);
 			inputPaths = (
 			);
-			name = "[CP] Copy Pods Resources";
+			name = "Thin Binary";
 			outputPaths = (
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
-			showEnvVarsInLog = 0;
+			shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
 		};
-		1CE79212F95ADCB77DC1EC7D /* [CP] Embed Pods Frameworks */ = {
+		8882ECDD31D097CE5A94142C /* [CP] Embed Pods Frameworks */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
@@ -255,19 +254,23 @@
 			shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
 			showEnvVarsInLog = 0;
 		};
-		3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
+		8C591DA2CC232657C8302C0F /* [CP] Check Pods Manifest.lock */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
 			);
 			inputPaths = (
+				"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
+				"${PODS_ROOT}/Manifest.lock",
 			);
-			name = "Thin Binary";
+			name = "[CP] Check Pods Manifest.lock";
 			outputPaths = (
+				"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
+			shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n    # print error to STDERR\n    echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n    exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
+			showEnvVarsInLog = 0;
 		};
 		9740EEB61CF901F6004384FC /* Run Script */ = {
 			isa = PBXShellScriptBuildPhase;
@@ -283,22 +286,19 @@
 			shellPath = /bin/sh;
 			shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
 		};
-		F068A0ECD180E97D531B9AF4 /* [CP] Check Pods Manifest.lock */ = {
+		EB1ED22BA050462AEFF08BFA /* [CP] Copy Pods Resources */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
 			);
 			inputPaths = (
-				"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
-				"${PODS_ROOT}/Manifest.lock",
 			);
-			name = "[CP] Check Pods Manifest.lock";
+			name = "[CP] Copy Pods Resources";
 			outputPaths = (
-				"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n    # print error to STDERR\n    echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n    exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
+			shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
 			showEnvVarsInLog = 0;
 		};
 /* End PBXShellScriptBuildPhase section */
@@ -455,7 +455,7 @@
 					"$(inherited)",
 					"$(PROJECT_DIR)/Flutter",
 				);
-				PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.chewie;
+				PRODUCT_BUNDLE_IDENTIFIER = com.example.chewieExample;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 			};
 			name = Debug;
@@ -477,7 +477,7 @@
 					"$(inherited)",
 					"$(PROJECT_DIR)/Flutter",
 				);
-				PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.chewie;
+				PRODUCT_BUNDLE_IDENTIFIER = com.example.chewieExample;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 			};
 			name = Release;

+ 6 - 0
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json

@@ -107,6 +107,12 @@
       "idiom" : "ipad",
       "filename" : "Icon-App-83.5x83.5@2x.png",
       "scale" : "2x"
+    },
+    {
+      "size" : "1024x1024",
+      "idiom" : "ios-marketing",
+      "filename" : "Icon-App-1024x1024@1x.png",
+      "scale" : "1x"
     }
   ],
   "info" : {

binární
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png


+ 5 - 0
example/ios/Runner/Info.plist

@@ -45,5 +45,10 @@
 	</array>
 	<key>UIViewControllerBasedStatusBarAppearance</key>
 	<false/>
+	<key>NSAppTransportSecurity</key>
+    <dict>
+      <key>NSAllowsArbitraryLoads</key>
+      <true/>
+    </dict>
 </dict>
 </plist>

+ 28 - 25
example/lib/main.dart

@@ -3,12 +3,21 @@ import 'package:flutter/cupertino.dart';
 import 'package:flutter/material.dart';
 import 'package:video_player/video_player.dart';
 
-void main() => runApp(new ChewieDemo());
+void main() {
+  runApp(
+    new ChewieDemo(
+      controller: new VideoPlayerController(
+        'https://flutter.github.io/assets-for-api-docs/videos/butterfly.mp4',
+      ),
+    ),
+  );
+}
 
 class ChewieDemo extends StatefulWidget {
   final String title;
+  final VideoPlayerController controller;
 
-  ChewieDemo({this.title = 'Chewie Demo'});
+  ChewieDemo({this.title = 'Chewie Demo', this.controller});
 
   @override
   State<StatefulWidget> createState() {
@@ -18,7 +27,6 @@ class ChewieDemo extends StatefulWidget {
 
 class _ChewieDemoState extends State<ChewieDemo> {
   TargetPlatform _platform;
-  VideoPlayerController controller;
 
   @override
   Widget build(BuildContext context) {
@@ -36,15 +44,18 @@ class _ChewieDemoState extends State<ChewieDemo> {
             new Expanded(
               child: new Center(
                 child: new Chewie(
-                  controller,
+                  widget.controller,
                   aspectRatio: 3 / 2,
                   autoPlay: true,
                   looping: true,
+
                   // Try playing around with some of these other options:
-                  // progressColors: new VideoProgressColors(
+
+                  // showControls: false,
+                  // materialProgressColors: new ChewieProgressColors(
                   //   playedColor: Colors.red,
                   //   handleColor: Colors.blue,
-                  //   disabledColor: Colors.grey,
+                  //   backgroundColor: Colors.grey,
                   //   bufferedColor: Colors.lightGreen,
                   // ),
                   // placeholder: new Container(
@@ -57,17 +68,18 @@ class _ChewieDemoState extends State<ChewieDemo> {
             new Row(
               children: <Widget>[
                 new Expanded(
-                    child: new FlatButton(
-                  onPressed: () {
-                    setState(() {
-                      _platform = TargetPlatform.android;
-                    });
-                  },
-                  child: new Padding(
-                    child: new Text("Android controls"),
-                    padding: new EdgeInsets.symmetric(vertical: 16.0),
+                  child: new FlatButton(
+                    onPressed: () {
+                      setState(() {
+                        _platform = TargetPlatform.android;
+                      });
+                    },
+                    child: new Padding(
+                      child: new Text("Android controls"),
+                      padding: new EdgeInsets.symmetric(vertical: 16.0),
+                    ),
                   ),
-                )),
+                ),
                 new Expanded(
                   child: new FlatButton(
                     onPressed: () {
@@ -88,13 +100,4 @@ class _ChewieDemoState extends State<ChewieDemo> {
       ),
     );
   }
-
-  @override
-  void initState() {
-    controller = new VideoPlayerController(
-      'https://flutter.github.io/assets-for-api-docs/videos/butterfly.mp4',
-    );
-
-    super.initState();
-  }
 }

+ 1 - 0
lib/chewie.dart

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

+ 32 - 16
lib/src/chewie_player.dart

@@ -1,3 +1,4 @@
+import 'package:chewie/src/chewie_progress_colors.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/services.dart';
 import 'package:flutter/widgets.dart';
@@ -22,16 +23,22 @@ class Chewie extends StatefulWidget {
   /// Whether or not the video should loop
   final bool looping;
 
+  /// Whether or not to show the controls
+  final bool showControls;
+
   /// 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;
 
-  /// 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 colors to use for controls on iOS. By default, the iOS player uses
+  /// colors sampled from the original iOS 11 designs.
+  final ChewieProgressColors cupertinoProgressColors;
+
+  /// The colors to use for the Material Progress Bar. By default, the Material
+  /// player uses the colors from your Theme.
+  final ChewieProgressColors materialProgressColors;
 
   /// The placeholder is displayed underneath the Video before it is initialized
   /// or played.
@@ -44,10 +51,13 @@ class Chewie extends StatefulWidget {
     this.autoInitialize = false,
     this.autoPlay = false,
     this.looping = false,
-    this.progressColors,
+    this.cupertinoProgressColors,
+    this.materialProgressColors,
     this.placeholder,
+    this.showControls = true,
   })
-      : assert(controller != null, 'You must provide a controller to play a video'),
+      : assert(controller != null,
+            'You must provide a controller to play a video'),
         super(key: key);
 
   @override
@@ -57,37 +67,43 @@ class Chewie extends StatefulWidget {
 }
 
 class _ChewiePlayerState extends State<Chewie> {
+  bool initialized = false;
+  VoidCallback listener;
+
   @override
   Widget build(BuildContext context) {
     return new PlayerWithControls(
       controller: widget.controller,
-      onExpandCollapse: () {
-        return _pushFullScreenWidget(context);
-      },
+      onExpandCollapse: () => _pushFullScreenWidget(context),
       aspectRatio: widget.aspectRatio ?? _calculateAspectRatio(context),
-      progressColors: widget.progressColors,
+      cupertinoProgressColors: widget.cupertinoProgressColors,
+      materialProgressColors: widget.materialProgressColors,
       placeholder: widget.placeholder,
       autoPlay: widget.autoPlay,
+      showControls: widget.showControls,
     );
   }
 
   @override
   void initState() {
-    _initialize();
-
     super.initState();
+    _initialize();
   }
 
-  _buildFullScreenVideo(BuildContext context, Animation<double> animation) {
+  Widget _buildFullScreenVideo(
+      BuildContext context, Animation<double> animation) {
     return new Scaffold(
       resizeToAvoidBottomPadding: false,
       body: new Container(
         color: Colors.black,
         child: new PlayerWithControls(
           controller: widget.controller,
-          onExpandCollapse: () => new Future.value(Navigator.of(context).pop()),
-          aspectRatio: widget.aspectRatio,
+          onExpandCollapse: () =>
+              new Future<dynamic>.value(Navigator.of(context).pop()),
+          aspectRatio: widget.aspectRatio ?? _calculateAspectRatio(context),
           fullScreen: true,
+          cupertinoProgressColors: widget.cupertinoProgressColors,
+          materialProgressColors: widget.materialProgressColors,
         ),
       ),
     );
@@ -126,7 +142,7 @@ class _ChewiePlayerState extends State<Chewie> {
 
     SystemChrome.setEnabledSystemUIOverlays([]);
 
-    return Navigator.of(context).push(route).then((_) {
+    return Navigator.of(context).push(route).then<Null>((_) {
       SystemChrome.setEnabledSystemUIOverlays(SystemUiOverlay.values);
     });
   }

+ 19 - 0
lib/src/chewie_progress_colors.dart

@@ -0,0 +1,19 @@
+import 'package:flutter/rendering.dart';
+
+class ChewieProgressColors {
+  final Paint playedPaint;
+  final Paint bufferedPaint;
+  final Paint handlePaint;
+  final Paint backgroundPaint;
+
+  ChewieProgressColors({
+    Color playedColor: const Color.fromRGBO(255, 0, 0, 0.7),
+    Color bufferedColor: const Color.fromRGBO(30, 30, 200, 0.2),
+    Color handleColor: const Color.fromRGBO(200, 200, 200, 1.0),
+    Color backgroundColor: const Color.fromRGBO(200, 200, 200, 0.5),
+  })
+      : playedPaint = new Paint()..color = playedColor,
+        bufferedPaint = new Paint()..color = bufferedColor,
+        handlePaint = new Paint()..color = handleColor,
+        backgroundPaint = new Paint()..color = backgroundColor;
+}

+ 8 - 7
lib/src/cupertino_controls.dart

@@ -1,7 +1,8 @@
 import 'dart:async';
 import 'dart:math' as math;
-import 'dart:ui';
+import 'dart:ui' as ui;
 
+import 'package:chewie/src/chewie_progress_colors.dart';
 import 'package:chewie/src/cupertino_progress_bar.dart';
 import 'package:chewie/src/utils.dart';
 import 'package:flutter/foundation.dart';
@@ -15,7 +16,7 @@ class CupertinoControls extends StatefulWidget {
   final VideoPlayerController controller;
   final Future<dynamic> Function() onExpandCollapse;
   final bool fullScreen;
-  final VideoProgressColors progressColors;
+  final ChewieProgressColors progressColors;
   final bool autoPlay;
 
   CupertinoControls({
@@ -90,7 +91,7 @@ class _CupertinoControlsState extends State<CupertinoControls> {
         margin: new EdgeInsets.all(marginSize),
         child: new ClipRect(
           child: new BackdropFilter(
-            filter: new ImageFilter.blur(
+            filter: new ui.ImageFilter.blur(
               sigmaX: 10.0,
               sigmaY: 10.0,
             ),
@@ -132,7 +133,7 @@ class _CupertinoControlsState extends State<CupertinoControls> {
         duration: new Duration(milliseconds: 300),
         child: new ClipRect(
           child: new BackdropFilter(
-            filter: new ImageFilter.blur(sigmaX: 10.0),
+            filter: new ui.ImageFilter.blur(sigmaX: 10.0),
             child: new Container(
               height: barHeight,
               padding: new EdgeInsets.only(
@@ -203,7 +204,7 @@ class _CupertinoControlsState extends State<CupertinoControls> {
         duration: new Duration(milliseconds: 300),
         child: new ClipRect(
           child: new BackdropFilter(
-            filter: new ImageFilter.blur(sigmaX: 10.0),
+            filter: new ui.ImageFilter.blur(sigmaX: 10.0),
             child: new Container(
               decoration: new BoxDecoration(
                 color: backgroundColor,
@@ -418,7 +419,7 @@ class _CupertinoControlsState extends State<CupertinoControls> {
             _startHideTimer();
           },
           colors: widget.progressColors ??
-              new VideoProgressColors(
+              new ChewieProgressColors(
                 playedColor: new Color.fromARGB(
                   120,
                   255,
@@ -437,7 +438,7 @@ class _CupertinoControlsState extends State<CupertinoControls> {
                   255,
                   255,
                 ),
-                disabledColor: new Color.fromARGB(
+                backgroundColor: new Color.fromARGB(
                   20,
                   255,
                   255,

+ 7 - 6
lib/src/cupertino_progress_bar.dart

@@ -1,22 +1,23 @@
+import 'package:chewie/src/chewie_progress_colors.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/widgets.dart';
 import 'package:video_player/video_player.dart';
 
 class CupertinoVideoProgressBar extends StatefulWidget {
   final VideoPlayerController controller;
-  final VideoProgressColors colors;
+  final ChewieProgressColors colors;
   final Function() onDragStart;
   final Function() onDragEnd;
   final Function() onDragUpdate;
 
   CupertinoVideoProgressBar(
     this.controller, {
-    VideoProgressColors colors,
+    ChewieProgressColors colors,
     this.onDragEnd,
     this.onDragStart,
     this.onDragUpdate,
   })
-      : colors = colors ?? new VideoProgressColors();
+      : colors = colors ?? new ChewieProgressColors();
 
   @override
   _VideoProgressBarState createState() {
@@ -60,7 +61,7 @@ class _VideoProgressBarState extends State<CupertinoVideoProgressBar> {
     }
 
     return new GestureDetector(
-      child: (controller.value.isErroneous)
+      child: (controller.value.hasError)
           ? new Text(controller.value.errorDescription)
           : new Center(
               child: new Container(
@@ -119,7 +120,7 @@ class _VideoProgressBarState extends State<CupertinoVideoProgressBar> {
 
 class _ProgressBarPainter extends CustomPainter {
   VideoPlayerValue value;
-  VideoProgressColors colors;
+  ChewieProgressColors colors;
 
   _ProgressBarPainter(this.value, this.colors);
 
@@ -142,7 +143,7 @@ class _ProgressBarPainter extends CustomPainter {
         ),
         new Radius.circular(4.0),
       ),
-      colors.disabledPaint,
+      colors.backgroundPaint,
     );
     if (!value.initialized) {
       return;

+ 4 - 4
lib/src/material_controls.dart

@@ -1,6 +1,6 @@
 import 'dart:async';
-import 'dart:ui';
 
+import 'package:chewie/src/chewie_progress_colors.dart';
 import 'package:chewie/src/material_progress_bar.dart';
 import 'package:chewie/src/utils.dart';
 import 'package:flutter/foundation.dart';
@@ -11,7 +11,7 @@ class MaterialControls extends StatefulWidget {
   final VideoPlayerController controller;
   final bool fullScreen;
   final Future<dynamic> Function() onExpandCollapse;
-  final VideoProgressColors progressColors;
+  final ChewieProgressColors progressColors;
   final bool autoPlay;
 
   MaterialControls({
@@ -328,11 +328,11 @@ class _MaterialControlsState extends State<MaterialControls> {
             _startHideTimer();
           },
           colors: widget.progressColors ??
-              new VideoProgressColors(
+              new ChewieProgressColors(
                   playedColor: Theme.of(context).accentColor,
                   handleColor: Theme.of(context).accentColor,
                   bufferedColor: Theme.of(context).backgroundColor,
-                  disabledColor: Theme.of(context).disabledColor),
+                  backgroundColor: Theme.of(context).disabledColor),
         ),
       ),
     );

+ 7 - 6
lib/src/material_progress_bar.dart

@@ -1,22 +1,23 @@
+import 'package:chewie/src/chewie_progress_colors.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/widgets.dart';
 import 'package:video_player/video_player.dart';
 
 class MaterialVideoProgressBar extends StatefulWidget {
   final VideoPlayerController controller;
-  final VideoProgressColors colors;
+  final ChewieProgressColors colors;
   final Function() onDragStart;
   final Function() onDragEnd;
   final Function() onDragUpdate;
 
   MaterialVideoProgressBar(
     this.controller, {
-    VideoProgressColors colors,
+    ChewieProgressColors colors,
     this.onDragEnd,
     this.onDragStart,
     this.onDragUpdate,
   })
-      : colors = colors ?? new VideoProgressColors();
+      : colors = colors ?? new ChewieProgressColors();
 
   @override
   _VideoProgressBarState createState() {
@@ -60,7 +61,7 @@ class _VideoProgressBarState extends State<MaterialVideoProgressBar> {
     }
 
     return new GestureDetector(
-      child: (controller.value.isErroneous)
+      child: (controller.value.hasError)
           ? new Text(controller.value.errorDescription)
           : new Center(
               child: new Container(
@@ -119,7 +120,7 @@ class _VideoProgressBarState extends State<MaterialVideoProgressBar> {
 
 class _ProgressBarPainter extends CustomPainter {
   VideoPlayerValue value;
-  VideoProgressColors colors;
+  ChewieProgressColors colors;
 
   _ProgressBarPainter(this.value, this.colors);
 
@@ -140,7 +141,7 @@ class _ProgressBarPainter extends CustomPainter {
         ),
         new Radius.circular(4.0),
       ),
-      colors.disabledPaint,
+      colors.backgroundPaint,
     );
     if (!value.initialized) {
       return;

+ 39 - 24
lib/src/player_with_controls.dart

@@ -1,3 +1,4 @@
+import 'package:chewie/src/chewie_progress_colors.dart';
 import 'package:flutter/foundation.dart';
 import 'package:flutter/material.dart';
 import 'package:video_player/video_player.dart';
@@ -12,20 +13,26 @@ class PlayerWithControls extends StatefulWidget {
   final VideoPlayerController controller;
   final Future<dynamic> Function() onExpandCollapse;
   final bool fullScreen;
-  final VideoProgressColors progressColors;
+  final ChewieProgressColors cupertinoProgressColors;
+  final ChewieProgressColors materialProgressColors;
   final Widget placeholder;
   final double aspectRatio;
   final bool autoPlay;
+  final bool showControls;
 
   PlayerWithControls({
+    Key key,
     @required this.controller,
     @required this.onExpandCollapse,
     @required this.aspectRatio,
     this.fullScreen = false,
-    this.progressColors,
+    this.showControls = true,
+    this.cupertinoProgressColors,
+    this.materialProgressColors,
     this.placeholder,
     this.autoPlay,
-  });
+  })
+      : super(key: key);
 
   @override
   State createState() {
@@ -49,29 +56,12 @@ class _VideoPlayerWithControlsState extends State<PlayerWithControls> {
                 widget.placeholder ?? new Container(),
                 new Hero(
                   tag: controller,
-                  child: new Center(
-                    child: new AspectRatio(
-                        aspectRatio: widget.aspectRatio,
-                        child: new VideoPlayer(controller)),
+                  child: new AspectRatio(
+                    aspectRatio: widget.aspectRatio,
+                    child: new VideoPlayer(controller),
                   ),
                 ),
-                Theme.of(context).platform == TargetPlatform.android
-                    ? new MaterialControls(
-                        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),
-                        iconColor: new Color.fromARGB(255, 200, 200, 200),
-                        controller: controller,
-                        onExpandCollapse: widget.onExpandCollapse,
-                        fullScreen: widget.fullScreen,
-                        progressColors: widget.progressColors,
-                        autoPlay: widget.autoPlay,
-                      ),
+                _buildControls(context, controller),
               ],
             ),
           ),
@@ -80,6 +70,31 @@ class _VideoPlayerWithControlsState extends State<PlayerWithControls> {
     );
   }
 
+  Widget _buildControls(
+    BuildContext context,
+    VideoPlayerController controller,
+  ) {
+    return widget.showControls
+        ? Theme.of(context).platform == TargetPlatform.android
+            ? new MaterialControls(
+                controller: controller,
+                onExpandCollapse: widget.onExpandCollapse,
+                fullScreen: widget.fullScreen,
+                progressColors: widget.materialProgressColors,
+                autoPlay: widget.autoPlay,
+              )
+            : new CupertinoControls(
+                backgroundColor: new Color.fromRGBO(41, 41, 41, 0.7),
+                iconColor: new Color.fromARGB(255, 200, 200, 200),
+                controller: controller,
+                onExpandCollapse: widget.onExpandCollapse,
+                fullScreen: widget.fullScreen,
+                progressColors: widget.cupertinoProgressColors,
+                autoPlay: widget.autoPlay,
+              )
+        : new Container();
+  }
+
   @override
   void initState() {
     // Hack to show the video when it starts playing. Should be fixed by the

+ 2 - 2
pubspec.yaml

@@ -1,13 +1,13 @@
 name: chewie
 description: The video player for Flutter with a heart of gold
-version: 0.2.0
+version: 0.3.0
 homepage: https://github.com/brianegan/chewie
 author: Brian Egan <brian@brianegan.com>
 
 dependencies:
   open_iconic_flutter: ">=0.2.0 <0.3.0"
   connectivity: ">=0.1.1 <0.2.0"
-  video_player: ">=0.0.6 <0.1.0"
+  video_player: ">=0.2.0 <0.3.0"
   flutter:
     sdk: flutter