Hi Abhi,
Here is the code for video player, I dont know how to do it with
mediaplayer, but i guess following code will fulfill your
requirements.
package org.example.tryaudio;
import java.net.URI;
import android.app.Activity;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Bundle;
import android.widget.MediaController;
import android.widget.VideoView;
public class TryAudio extends Activity {
VideoView video;
MediaController mcontrol;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
video = (VideoView)findViewById(R.id.VideoView01);
Uri videouri = Uri.parse("/data/samplevideo.3gp");
mcontrol = new MediaController(this);
mcontrol.setAnchorView(video);
video.setMediaController(mcontrol);
video.setVideoURI(videouri);
video.start();
}
}
Best Wishes
Rahul Garg
On Jun 4, 12:59 am, Abhi <[email protected]> wrote:
> Hello,
>
> I am using MediaPlayer to build a Video player for playing local video
> files. However, I don't know how to enable MediaController for my
> player. I want the media control buttons that pop up when you touch
> the video surface.
>
> Can anyone help me out please?
>
> Thanks,
>
> Abhi
--
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en