- put your mp4 file into folder res/raw (you need to create folder raw under folder res)
For example d:\workspace\Test\res\raw
Application Name: Test
mp4 file name: gayatrimantra.mp4full path filename: d:\workspace\Test\res\raw\gayatrimantra.mp4 - to start your Video, write this code
public void ClickDeh(View view)
{
VideoView videoview = (VideoView) findViewById(R.id.videoView1);
Uri uri = Uri.parse("android.resource://"+getPackageName()+"/"+R.raw.gayatrimantra);
videoview.setVideoURI(uri);
videoview.start();
}
Note: File name must be unique
Source: http://www.androidsnippets.com/play-video-file-from-resources
No comments:
Post a Comment