Im trying to play video from internal storage, but videoview cant play it. Is there a way to do this and not by temporarily copying to sdcard and playing it? The video was recorded开发者_运维知识库 with mediarecorder.
Use this code in your activity
VideoView videoView = (VideoView) findViewById(R.id.video_view);
MediaController mediaController = new MediaController(this);
mediaController.setAnchorView(videoView);
videoView.setMediaController(mediaController);
videoView.setVideoPath(getFilesDir().getAbsolutePath()+"/file_name.mp4");
ideoView.start();
The file_name.mp4 must be created with Context.MODE_WORLD_READABLE
Holp this helps
精彩评论