Copy it to external storage (temporarily)
I ran into the same problem as you, and resorted to simply temporarily copying the file to external storage before playing it, and then deleting the temporary file.
Here is an example of the code I used for this:
try { // Copy file to temporary file in order to view it. temporaryFile = generateTemporaryFile(file.getName()); FileUtils.copyFile(file, temporaryFile); previewVideo(temporaryFile, videoView); } catch (IOException e) { e.printStackTrace(); } # Helpers protected File generateTemporaryFile(String filename) throws IOException { String tempFileName = "20130318_010530_"; File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES); File tempFile = File.createTempFile( tempFileName, /* prefix "20130318_010530" */ filename, /* filename "video.3gp" */ storageDir /* directory "/data/sdcard/..." */ ); return tempFile; } protected void previewVideo(File file, VideoView videoView) { videoView.setVideoPath(file.getAbsolutePath()); MediaController mediaController = new MediaController(this); videoView.setMediaController(mediaController); mediaController.setMediaPlayer(videoView); videoView.setVisibility(View.VISIBLE); videoView.start(); }
source share