Android IDE (AIDE) Support Forum

How to read video file located in phone internal storage

Please everyone,I need your help on how to read video file from phone internal storage and set it to VideoView, I have try all my possible best on this and it not working.

I used Environment.getExternalStorageDirecyory.getpath()+ “media/next.mp4”
It also not working.

I want to reach video in phone internal storage.

Please help me out!!!

Send screenshot bros

This can not work because of new Android APIs, use MediaFace and work with URIs instead of the old Java File API

If you use druidscript The director structure in Android shall be
If you use in code" sdcard/videofile name"
from start go to sub directory
Android/data/com.smartphoneremote.androidscriptfree/files/druidscript/put your videofile here

hi. i use flowing code ofcourse you should use permission to access internal storage
note:after android 11 you can read just from public storage directory and can not access to android dat directory
part 1__
Uri videouri = Uri.parse(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)
.getAbsolutePath()+"/b.mp4");
MediaController m1=new MediaController(getActivity());
video1.setMediaController(m1);
video1.setVideoURI(videouri);
video1.start();
_part2

1 Like