I have to play a video in one of my screens of Android and I am using Video View intent for the same. The video gets played but there is no thumbnail appearing on the launch of the screen.
My code is like this
@OnClick(R.id.icon_play)
protected void playVideo(){
String videoUrl="https://someUrl/Video/v07.mp4";
if(!videoUrl.isEmpty()) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(videoUrl));
intent.setDataAndType(Uri.parse(videoUrl), "video/mp4");
startActivity(intent);
}
}
By thumbnail, I mean that when the screen is launched each video should have an image of its own. (something like YouTube)
I tried seekTo()
for attaching the thumbnail, but it didn't work.
Please Help. Thanks.