stormyBrain
stormyBrain

Reputation: 33

Packaging Videos Within An App

I am in the process of developing a fitness app. I want the user to have the option to view a demonstration video of each exercise (of which there are ten). I am currently accessing YouTube videos for the demonstrations. I filmed people at my gym doing the movements today and I am curious what would be the best way to package these videos within my application. I'm assuming I can include them in my drawables and access them from there. Also, what type of files should I make them? The videos will each be less than 30 seconds so I don't think they will take up too much space in the application, but I could be wrong. Anyway, any advice would be welcome. Thanks in advance.

Upvotes: 0

Views: 93

Answers (1)

M. Bongini
M. Bongini

Reputation: 122

You can put them into the raw folder (/res/raw). Create it if needed. Supported formats are 3gp and mp4.

To play them you can use:

 VideoView view = (VideoView)findViewById(R.id.videoView);
    String path = "android.resource://" + getPackageName() + "/" + R.raw.video_file;
    view.setVideoURI(Uri.parse(path));
    view.start();

Upvotes: 1

Related Questions