1. Download our Official Android App: Forums for Android!

Apps Help with video / audio

Discussion in 'Android Development' started by daveofgv, Nov 20, 2010.

  1. daveofgv

    daveofgv Lurker
    Thread Starter
    5

    Nov 20, 2010
    1
    0
    5
    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.
     

    Advertisement

  2. miXer

    miXer Android Enthusiast
    53

    Aug 12, 2010
    313
    51
    53
    Norway
    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();
     
  3. JMultimediadesign

    16

    Nov 28, 2010
    12
    1
    16
    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.
     

Share This Page

Loading...