Sorry, I asked this question a few days ago on a wrong topic and have now deleted it there. So again:
Is there a reason why the ExoPlayer can only play files from the assets or via URI and not from /storage/emulated/0/Music or an app-specific folder: /storage/emulated/0/Andoid/data/packageName/files/? For the last one no READ/WRITE_EXTERNAL_STORAGE permissions are requested.
I tried it before. ExoPlayer does not play a file outside the assets.
This directory /storage/emulated/0/Andoid/data/packageName/files/ is specifically recommended by Google to access data without READ / WRITE_EXTERNAL_STORAGE permissions. Manifest.permission  | Android Developers
I use this app-specific folder in many of my apps without any issues. Unfortunately, Kodular (as well as AI2, Thunkable) requires read / write permissions at runtime (API> 22) for many components (in particular for the Player and File component). AppyBuilder does not (but unfortunately AppyBuilder does not have ExoPlayer). Could not you leave out this permission request from the ExoPlayer. Then you can make this request yourself if necessary.
Of course, I do not mean to remove the “android.permission.READ/WRITE_EXTERNAL_STORAGE” from the manifest, just the runtime request.
I know what the directory does and I know too that it does not require the permission check
But its a lot of work to add some extra code everywhere where it CAN but must not posible.
I’ll take a look for that.
But I can not say anything else.
If you want to help me with this then you can add here in this topic a list with all components which needs this check.
Thanks again for your response. Only the Player and ExoPlayer component. Everything else can be done with extensions. Most important is ExoPlayer. The only drawback with ExoPlayer is that it does not have an ExoPlayer.Completed event. But I have a solution for that.
Our default “Player” will be replaced complete by “ExoPlayer” in the future since “ExoPlayer” is much faster and better.
Means… If I add the check then only for the “ExoPlayer” component.
Great! Also without write permission?
(I need to download files (zip-file and unzip it) first to the app-specific dir, so I need also write perm.)
Thanks, I know that I have to set minSdkVersion=19
If all of this is available in the next release, that would be really fantastic and would greatly simplify app creation. I will then switch from AI2 to Kodular with all my apps .
Finally, a small overview to the write permisssion and it’s declaration in the Manifest.
Regarding the (runtime) READ / WRITE_EXTERNAL_STORAGE permissions and the Player component, I’ve done intensive testing on more than 10 devices (API>22). These are my results:
As I said earlier the WRITE permission have nothing to do with Player or ExoPlayer component.
Because the players can ONLY read files.
But you are talking about the FILE component which can READ/WRITE files.
That’s why I asked you earlier which components I should edit to allow read/write without permission to app specifc directory.
Means, if you want I can look if I can do it for the file component.