Reputation: 10589
I have a quite complex android app and for several functions i want to provide some tutorial videos inside the application.
I want to provide a ListView with a thumbnail of the video, a title and a small description. after the user clicks on an item of the listview i want the selected video to be played.
Upvotes: 0
Views: 470
Reputation: 2155
If you will have lots of videos, you probably don't want to put it inside apk, because apk size is limited + not every user wants to download and store on device app which is more than 50 mb. I recommend you to upload your videos to youtube ( just create you channel and upload as more videos as you need). Than you will be able to use youtube android api to show your videos inside app.
If you don't have lots of videos (overall < 50 mb), I recommend you to create folder row
inside res
folder and store all your videos there. Then you will be able to access it with built in VideoView. It supports next formats: Supported Media Formats. Example of usage VideoView:
VideoView videoView = (VideoView) findViewById(R.id.video_view);
MediaController mediaController = new MediaController(this);
mediaController.setAnchorView(videoView);
videoView.setMediaController(mediaController);
videoView.setVideoURI(Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.filename));
videoView.start();
Upvotes: 2
Reputation: 1730
Add a folder 'raw' to your res folder and store videos in them . And for formats see : http://developer.android.com/guide/appendix/media-formats.html
And see this : https://stackoverflow.com/a/11348850/4465685
Upvotes: 0