I have a video that I save to .../Movies/MyApp/abcde.mp4
. So I know where it is. When I load it through my app using an implicit intent to ACTION_GET_CONTENT
, the path is returned as content:/media/external/video/media/82
when I do
data.getData().toString()
The problem with that path is that it works when I try to access it with MediaRecorder as
mVideoView.setVideoURI(Uri.parse(mVideoStringPath))
However if I try to convert it to a path in another thread (for a job queue), the file is not found
new File(mVideoStringPath)
when I use the technique (copy and paste) described at How to get file path in onActivityResult in Android 4.4, still get the error
java.lang.RuntimeException: Invalid image file
Also per my logging, the new technique shows the path to the video as
video path: /storage/emulated/0/Movies/MyApp/abc de.mp4
notice the space in abc de.mp4
. that indeed is the name of the file. And the phone's camera app has no trouble playing