I'd like to show a video (mp4) with the flutter package video_player. On iOS everything is working fine, but on android the file is not found. I can find the file in the apk at the right place, but the app is not finding it. Other asset files like images or pdfs are working.
_videoController = VideoPlayerController.asset("/assets/videos/$fileName");
com.google.android.exoplayer2.upstream.AssetDataSource$AssetDataSourceException: java.io.FileNotFoundException: flutter_assets//assets/videos/bcm.mp4
...
Caused by: java.io.FileNotFoundException: flutter_assets//assets/videos/bcm.mp4
at android.content.res.AssetManager.nativeOpenAsset(Native Method)
...
Am I missing something for android? Maybe in build.gradle? Thanks!
I also get this note, but I don't think that it is the problem:
Note: /.../development/flutter/.pub-cache/hosted/pub.dartlang.org/video_player-0.10.11+2/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerPlugin.java uses or overrides a deprecated API.
with -Xlint:deprecation:
/.../.pub-cache/hosted/pub.dartlang.org/video_player-0.10.11+2/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerPlugin.java:61: warning: [deprecation] getFlutterEngine() in FlutterPluginBinding has been deprecated
binding.getFlutterEngine().getRenderer());