Repository: flutter
Issue: [video_player_avfoundation] Flickering on macOS 
Labels: platform-mac,p: video_player,package,a: desktop,P2,team-macos,triaged-macos

### Is there an existing issue for this?

- [X] I have searched the [existing issues](https://github.com/flutter/flutter/issues)
- [X] I have read the [guide to filing a bug](https://flutter.dev/docs/resources/bug-reports)

### Steps to reproduce

Run the example in `video_player_avfoundation` on macOS


### Expected results

No flickering

### Actual results

Background flickering through the video at random times and always at the end of the video [Edit: as of [PR 5078](https://github.com/flutter/packages/pull/5078) landing the "always at the end of video" part of this should no longer be true]. Most likely due to returning `NULL` here:

https://github.com/flutter/packages/blob/c070b0a7a80a54d5fad254fecdfd98ffe764bd4e/packages/video_player/video_player_avfoundation/darwin/Classes/FVPVideoPlayerPlugin.m#L560-L567

While on iOS the last frame would be repeated, on macOS the underlying widget will be visible which results in the flashing effect.

### Code sample

<details><summary>Code sample</summary>

Use the example in `video_player_avfoundation` on macOS

</details>


### Screenshots or Video

<details>
<summary>Screenshots / Video demonstration</summary>

https://github.com/flutter/flutter/assets/814785/61ab8a44-0450-4169-971b-ffb27c0ed559

</details>


### Logs

_No response_

### Flutter Doctor output

<details><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.13.6, on macOS 14.0 23A344 darwin-arm64, locale en-US)
    • Flutter version 3.13.6 on channel stable at /Users/ben/development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ead455963c (8 days ago), 2023-09-26 18:28:17 -0700
    • Engine revision a794cf2681
    • Dart version 3.1.3
    • DevTools version 2.25.0

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/ben/Library/Android/sdk
    • Platform android-33, build-tools 31.0.0
    • Java binary at: /Users/ben/Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15A240d
    • CocoaPods version 1.13.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.3)
    • Android Studio at /Users/ben/Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)

[✓] IntelliJ IDEA Ultimate Edition (version 2023.2.2)
    • IntelliJ at /Users/ben/Applications/IntelliJ IDEA Ultimate.app
    • Flutter plugin version 75.1.4
    • Dart plugin version 232.9559.10

[✓] VS Code (version 1.82.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.70.0

[✓] Connected device (4 available)
[redacted]

[✓] Network resources
    • All expected network resources are available.
```

</details>