To get the URI of sample_video
in raw folder :
Uri videoUri = Uri.parse("android.resource://" + getPackageName() + "/"
+ R.raw.sample_video); //do not add any extension
To play the video :
videocontainer.setVideoURI(Uri.parse(videoUri));
videocontainer.start();
where videocontainer
of type videoview
.