Repository: flutter
Issue: [video_player] black (first?) frame on iOS
Labels: platform-ios,p: video_player,package,has reproducible steps,P2,found in release: 2.2,team-ios,triaged-ios

<!-- 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 our the template below. Please read
     our guide to filing a bug first: https://flutter.dev/docs/resources/bug-reports
-->
The `video_player` plugin has difficulty ~looping~ loading video without artifact on iOS but works fine on Android. On iOS the first frame of video is black, and it shows black again on loop. Its as yet unclear if it's overwriting the first frame, or if some frames of black are inserted.

Devices used to validate: Pixel 2 (Android 9/10), iPhone 7 (iOS 12.x, 13), iPad Pro 2018 (iOS 12.x).

## Steps to Reproduce

MCVE: Fix the pub.dev [example code](https://pub.dev/packages/video_player#example) to use a working video URL (bigbuckbunny is down). I used https://res.cloudinary.com/demo/video/upload/f_mp4/dog.mp4. Load the app. The first frame will load as a solid black image on iOS, but will show the first frame of the video on Android.

To see the black frame flash on loop on iOS, simply modify the [example code](https://pub.dev/packages/video_player#example) to include a `setLooping(true)` in `initState()`. Note that this works fine on Android.

```dart
import 'package:video_player/video_player.dart';
import 'package:flutter/material.dart';

void main() => runApp(VideoApp());

class VideoApp extends StatefulWidget {
  @override
  _VideoAppState createState() => _VideoAppState();
}

class _VideoAppState extends State<VideoApp> {
  VideoPlayerController _controller;

  @override
  void initState() {
    super.initState();
    _controller = VideoPlayerController.network(
        'https://res.cloudinary.com/demo/video/upload/f_mp4/dog.mp4')
      ..initialize().then((_) {
        // Ensure the first frame is shown after the video is initialized, even before the play button has been pressed.
        setState(() {});
      });
    _controller.setLooping(true);
    _controller.setVolume(0.0);
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Video Demo',
      home: Scaffold(
        body: Center(
          child: _controller.value.initialized
              ? AspectRatio(
                  aspectRatio: _controller.value.aspectRatio,
                  child: VideoPlayer(_controller),
                )
              : Container(),
        ),
        floatingActionButton: FloatingActionButton(
          onPressed: () {
            setState(() {
              _controller.value.isPlaying
                  ? _controller.pause()
                  : _controller.play();
            });
          },
          child: Icon(
            _controller.value.isPlaying ? Icons.pause : Icons.play_arrow,
          ),
        ),
      ),
    );
  }

  @override
  void dispose() {
    super.dispose();
    _controller.dispose();
  }
}
```

## Logs

<!--
      Run your application with `flutter run --verbose` and attach all the
      log output below between the lines with the backticks. If there is an
      exception, please see if the error message includes enough information
      to explain how to solve the issue.
-->

```
No exceptions present.
```

<!--
     Run `flutter analyze` and attach any output of that command below.
     If there are any analysis errors, try resolving them before filing this issue.
-->

```
⋊> ~/D/video_player_test flutter analyze                                                                                                                                  20:04:33
Analyzing video_player_test...                                          
No issues found! (ran in 2.7s)
```

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
⋊> ~/D/video_player_test flutter doctor -v                                                                                                                                20:04:41
[✓] Flutter (Channel stable, v1.9.1+hotfix.2, on Mac OS X 10.14.6 18G95, locale en-US)
    • Flutter version 1.9.1+hotfix.2 at /Users/deg/Development/flutter
    • Framework revision 2d2a1ffec9 (2 weeks ago), 2019-09-06 18:39:49 -0700
    • Engine revision b863200c37
    • Dart version 2.5.0

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /Users/deg/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.2
    • Java binary at: /Users/deg/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.0, Build version 11A420a
    • CocoaPods version 1.7.5

[✓] Android Studio (version 3.5)
    • Android Studio at /Users/deg/Applications/Android Studio.app/Contents
    • Flutter plugin version 39.0.3
    • Dart plugin version 191.8423
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] VS Code
    • VS Code at /Users/deg/Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.4.1

[✓] Connected device (1 available)
    • bigbubble • 00008027-001A51A036EB002E • ios • iOS 12.4.1

• No issues found!
```

Thanks for considering!