You can use the onCompletion to restart the Video also if you use a
VideoView and the MediaController (if you only want to replay the
video)
The method
public void onCompletion(MediaPlayer arg0) {
Log.d(TAG, "onCompletion called");
arg0.start(); // can be also executed in a loop till you are
tired of watching y video ....
}
--
Roman Baumgaertner
Sr. SW Engineer-OSDC
·T· · ·Mobile· stick together
The views, opinions and statements in this email are those of the
author solely in their individual capacity, and do not necessarily
represent those of T-Mobile USA, Inc.
On Oct 17, 1:23 am, Clave Yard <[email protected]> wrote:
> All,
>
> I am playing my video file from sdcard using the following code.
>
> private VideoView myVideo;
> private MediaController mc;
>
> myVideo=(VideoView)findViewById(R.id.VideoView01);
> myVideo.setVideoPath(filename);
> mc=new MediaController(this);
> mc.setMediaPlayer(myVideo);
> myVideo.setMediaController(mc);
> myVideo.requestFocus();
> myVideo.start();
>
> It works fine. I would like to restart the video on completion of the video..
> I saw that there is a function called 'void onCompletion(MediaPlayer mp)',
> but that is only if i use MediaPlayer, not for the MediaController and
> VideoView combination of playing video. But i want to get notified when the
> completion of my video play, so that i can restart my video again. Basically
> i want to continuously play my video.
>
> Could some one please suggest how do i approach it to achieve this?
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---