Repository: flutter
Issue: [video_player] video render a green bar and wrong size
Labels: platform-android,engine,a: video,a: quality,p: video_player,package,P2,team-android,triaged-android

First of all.Forgive my poor english.  
I found that video_player render a green bar and wrong size when i play the high resolution video especially 1920*1080.  
The video resolution is 16:9,Containers width is 800 and height is 600.As u can see,The first video render a huge green bar and fill the container.The second video just covered the border and rendered a wrong size.
![IMG_8243](https://user-images.githubusercontent.com/27856388/79634522-77eb9d80-819d-11ea-929a-f74ac09ab03b.JPG)
![IMG_8244](https://user-images.githubusercontent.com/27856388/79634582-d57fea00-819d-11ea-8ca7-2fc484f76490.JPG)

It confused me that video play error on some device but correct on others.It shows also on the plugin [ijkPlayer]( https://github.com/befovy/ijkplayer).  
I think it may be caught by the systems or hardware the system is the Android 7.1.I can not find any way to solve the problem.Waiting for u replay.Thx.
There is my code
```dart
class VideoSourceWidget extends StatefulWidget {
  Source source;
  Function endFun;
  Function errFun;

  VideoSourceWidget({Key key, this.source, this.endFun, this.errFun})
      : super(key: key);

  @override
  _VideoSourceWidgetState createState() => _VideoSourceWidgetState();
}

class _VideoSourceWidgetState extends State<VideoSourceWidget> {
  VideoPlayerController _controller;
  var listener;

  bool isErr = false;
  String errMsg = "";

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    _controller = VideoPlayerController.file(File(widget.source.res))
      ..initialize().then((_) {
        if (widget.source.voice == 1)
          _controller.setVolume(1.0);
        else
          _controller.setVolume(0.0);
        _controller.play();
        setState(() {});
      });
    listener = () {
      if (_controller.value.hasError) {
        setState(() {
          isErr = true;
          errMsg = _controller.value.errorDescription;
        });

//        if (widget.endFun != null) {
//          _controller.removeListener(listener);
//          widget.errFun();
//        }
      }
      var _duration = _controller.value.duration ?? Duration(hours: 1);
      var _remaining = _duration - _controller.value.position;

      if (_remaining.inMilliseconds == 0) {
        if (widget.endFun != null) {
          _controller.removeListener(listener);
          widget.endFun();
        }
      }
    };

    _controller.addListener(listener);
  }

  @override
  void dispose() {
    // TODO: implement dispose
    super.dispose();
    if (_controller.value.isPlaying) {
      if (_controller.hasListeners) _controller.removeListener(listener);
      _controller.pause();
    }
    _controller.dispose();
    _controller = null;
    // player.release();
  }

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return isErr
        ? Container(
            child: Text(errMsg),
          )
        : _controller.value.initialized
            ? Container(
                child: Center(
                  child: AspectRatio(
                    aspectRatio: _controller.value.aspectRatio,
                    child: VideoPlayer(_controller,),
                  ),
                ),
                 decoration: BoxDecoration(border: Border.all(width:1.0, color:Colors.red))
              )
            // ? FittedBox(fit: BoxFit.fitWidth, child: VideoPlayer(_controller))
            : Container();
  }
}
```
flutter doctor returns  
```
[✓] Flutter (Channel unknown, v1.14.6, on Mac OS X 10.14.4 18E226, locale
    zh-Hans-CN)
    • Flutter version 1.14.6 at /Users/qitianle/Desktop/flutter
    • Framework revision fabeb2a16f (3 months ago), 2020-01-28 07:56:51 -0800
    • Engine revision c4229bfbba
    • Dart version 2.8.0 (build 2.8.0-dev.5.0 fc3af737c7)

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /Users/qitianle/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling
      support)
    • Platform android-29, build-tools 29.0.3
    • ANDROID_HOME = /Users/qitianle/Library/Android/sdk
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_212-release-1586-b4-5784211)
    • All Android licenses accepted.

[!] Xcode - develop for iOS and macOS (Xcode 10.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.2.1, Build version 10E1001
    ✗ CocoaPods installed but not initialized.
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin
        code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To initialize CocoaPods, run:
        pod setup
      once to finalize CocoaPods' installation.

[✓] Android Studio (version 3.6)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 45.1.1
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build
      1.8.0_212-release-1586-b4-5784211)

[✓] VS Code (version 1.44.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.9.1

[✓] Connected device (2 available)
    • ASK AL00x    • BGR6R20403000901 • android-arm64 • Android 9 (API 28)
    • mooncell mid • M662DZBS4T       • android-arm64 • Android 7.1.2 (API 25)
```
and there is my pubsec.yaml
```yamlname: guardian
description: A new Flutter application.

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 2.0.20

environment:
  sdk: ">=2.1.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^0.1.2
  video_player: ^0.10.6
  flutter_redux: ^0.5.3
  event_bus: ^1.1.1
  intl: ^0.15.8
  native_pdf_view: ^2.2.0
  flutter_sequence_animation: ^3.0.1
  http: ^0.12.0+2
  # fijkplayer: ^0.7.1

dev_dependencies:
  flutter_test:
    sdk: flutter


# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter.
flutter:

  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true

  # To add assets to your application, add an assets section, like this:
  assets:
    - assets/logo.png
    - assets/

  # An image asset can refer to one or more resolution-specific "variants", see
  # https://flutter.dev/assets-and-images/#resolution-aware.

  # For details regarding adding assets from package dependencies, see
  # https://flutter.dev/assets-and-images/#from-packages

  # To add custom fonts to your application, add a fonts section here,
  # in this "flutter" section. Each entry in this list should have a
  # "family" key with the font family name, and a "fonts" key with a
  # list giving the asset and other descriptors for the font. For
  # example:
  # fonts:
  #   - family: Schyler
  #     fonts:
  #       - asset: fonts/Schyler-Regular.ttf
  #       - asset: fonts/Schyler-Italic.ttf
  #         style: italic
  #   - family: Trajan Pro
  #     fonts:
  #       - asset: fonts/TrajanPro.ttf
  #       - asset: fonts/TrajanPro_Bold.ttf
  #         weight: 700
  #
  # For details regarding fonts from package dependencies,
  # see https://flutter.dev/custom-fonts/#from-packages
```