I'm trying to run my Flutter application on iOS Simulator and I have found that video player throws the following exception on init:
[VERBOSE-2:ui_dart_state.cc(209)] Unhandled Exception: PlatformException(VideoError, Failed to load video: The operation could not be completed, null, null)
After some googling, I found that there could be several fixes for that:
- Upgrading flutter
- Downgrading vide_player to 2.2.3
- Configuring web server to support Range header
I am running the latest flutter version, also downgrading plugin didn't do pretty much anything. I made sure that web server does support Range header by playing video in a browser.
I have also checked network requests in flutter DevTools and it seems that network request is never made (looking at other API requests working fine).
Another note is that this problem does not happen on Android emulator/real device and video plays just fine.
What could cause this issue? Is there any possible way to enable more verbose logging to see what exactly causes the issue, or is there something I missing? Thanks for the help.
Additional information:
- Flutter
2.6.0-12.0.pre.899
on master branch - Xcode 13 from AppStore
- iOS 15 running on Simulator
Doctor summary:
[✓] Flutter (Channel master, 2.6.0-12.0.pre.899, on macOS 12.0.1 21A559
darwin-arm, locale en-RU)
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from:
https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK
components.
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup
for detailed instructions).
If the Android SDK has been installed to a custom location, please use
`flutter config --android-sdk` to update to that location.
[✓] Xcode - develop for iOS and macOS (Xcode 13.1)
[✓] Chrome - develop for the web
[!] Android Studio (not installed)
[✓] VS Code (version 1.62.3)
[✓] Connected device (2 available)