I've looked for existing potential solutions with other formats
and those still responds with mentioned error.
Finally, recorded the video with the same device and used it as a resource for this app and it still doesn't work.
Devices: SGS2
, lenovo a820
Video type: MPEG-4 video (video/mp4)
videoView = (VideoView)findViewById(R.id.videoView);
videoView.setVideoPath("android.resource://raw/sample.mp4");
videoView.start();
I tried everything mentioned before but it turns out that internet permission is needed to play a mp4 file.
try following code..
Be sure that the decoder (target sdk) supports the video format you are using. You can use VLC Player to convert video format to the desired one. In my case, I converted the MP4 to WebM file and load it in the VideoView.
Here is how you get the file path and play your video.
Source: Video format and codec support https://developer.android.com/guide/topics/media/media-formats.html
For Lenovo a820 ,below is need :
make sure that ur video fits in above codec format.
just see my below code it works...problem in pathe declaration..
Thats it...