• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Help with video / audio

daveofgv

Lurker
I hope this is the correct place to post this. If not, please let me know.

I am creating a small andriod app that plays one video with some audio. I am very very very new to java / android.

I am using Eclipse. If I add one button to the app how would I call the video.

This is not for any projects or for any type of school. I am making this for my HTC evo. I am not going to sell it or anything.

If someone could help me I would really appreciate it.

I know how to get an image but need help with video/audio

Thanks in advanced.
 
Audio:

For audio you need to import this one: android.media.MediaPlayer

And to start a audio file, call this:
MediaPlayer mp = MediaPlayer.create(this, resId);
mp.start();

Video:

For video you need to import this one: android.widget.VideoView

And to start a video, you need a videoview:
VideoView video = (VideoView) findViewById(R.id.video);

And to start the video, call this:
video.setVideoPath("pathtothevideofile");
video.start();
 
What about getting a video from youtube to play in the video viewer? I want put a video I made that is on youtube into an app that plays the video when the app is opened.
 
Back
Top Bottom