Repository: flutter
Issue: [video_player] [android] Width from VideoPlayerValue.size is wrong
Labels: platform-android,p: video_player,package,has reproducible steps,P2,found in release: 2.5,found in release: 2.6,team-android,triaged-android

<!-- Thank you for using Flutter!

     If you are looking for support, please check out our documentation
     or consider asking a question on Stack Overflow:
      * https://flutter.dev/
      * https://api.flutter.dev/
      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent

     If you have found a bug or if our documentation doesn't have an answer
     to what you're looking for, then fill out the template below. Please read
     our guide to filing a bug first: https://flutter.dev/docs/resources/bug-reports
-->

## Steps to Reproduce

<!-- Please include full steps to reproduce so that we can reproduce the problem. -->
1. flutter create `bug`
2. add the video_player plugin
3. Run the code sample

**Expected results:** <!-- what did you want to see? -->
the same size on `iOS` and `android`

**Actual results:** <!-- what did you see? -->
height is correct  but width is wrong

`iOS`

```console
flutter: ======== Size(782.8, 1080.0)
```

`android`

```console 
[+1825 ms] I/flutter ( 5846): ======== Size(1696.0, 1080.0)
```

<details>
<summary>Code sample</summary>

<!--
      Please create a minimal reproducible sample that shows the problem
      and attach it below between the lines with the backticks.

      To create it you can use `flutter create bug` command and update the `main.dart` file.

      Alternatively, you can use https://dartpad.dev/
      which is capable of creating and running small Flutter apps.

      Without this we will unlikely be able to progress on the issue, and because of that
      we regretfully will have to close it.
-->

```dart
import 'package:flutter/material.dart';
import 'package:video_player/video_player.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        // This is the theme of your application.
        //
        // Try running your application with "flutter run". You'll see the
        // application has a blue toolbar. Then, without quitting the app, try
        // changing the primarySwatch below to Colors.green and then invoke
        // "hot reload" (press "r" in the console where you ran "flutter run",
        // or simply save your changes to "hot reload" in a Flutter IDE).
        // Notice that the counter didn't reset back to zero; the application
        // is not restarted.
        primarySwatch: Colors.blue,
      ),
      home: const PlayAnimation(),
    );
  }
}

class PlayAnimation extends StatefulWidget {
  const PlayAnimation({Key? key}) : super(key: key);

  @override
  _PlayAnimationState createState() => _PlayAnimationState();
}

class _PlayAnimationState extends State<PlayAnimation> {
  late VideoPlayerController _controller;

  @override
  void initState() {
    super.initState();

    _controller = VideoPlayerController.network(
      'https://user-images.githubusercontent.com/18373253/144225439-90bb67fe-69f0-43c8-bad6-cfd066844eb6.mp4',

      /// real size: 782 x 1080
    );
    _controller.setLooping(true);
    _controller.initialize().then((_) {
      debugPrint("======== ${_controller.value.size}");

      ///  output: ======== Size(1696.0, 1080.0)
      setState(() {
        _controller.play();
      });
    });
  }

  _getVideoBackground() {
    return _controller.value.isInitialized
        ? AspectRatio(
            aspectRatio: 391 / 540,
            child: VideoPlayer(_controller),
          )
        : Container();
  }

  @override
  Widget build(BuildContext context) {
    return Center(
      child: _getVideoBackground(),
    );
  }

  @override
  void dispose() {
    super.dispose();
    _controller.dispose();
  }
}

```

</details>

<details>
  <summary>Logs</summary>

<!-- Finally, paste the output of running `flutter doctor -v` here. -->
![image](https://user-images.githubusercontent.com/18373253/143549018-ad87be23-3a70-44f7-b690-ffbea7ff443e.png)


</details>


<!--
      Consider also attaching screenshots and/or videos to better
      illustrate the issue.

      You can upload them directly on GitHub.
      Beware that video file size is limited to 10MB.
-->