3

I am using this piece of code in order to play a video:

string videoUriString = "android.resource://" +  this.PackageName + "/" + Resource.Raw.video;
Android.Net.Uri videoURI = Android.Net.Uri.Parse(videoUriString);
video.SetVideoURI(videoURI);
video.Start();

But I am really frustrated because I don't understand how attach a callback for handle the end of the video, I have to use Monodroid, then C#

pedr0
  • 2,941
  • 6
  • 32
  • 46

3 Answers3

10
 myVideoView.setOnCompletionListener(new OnCompletionListener() {

        @Override
        public void onCompletion(MediaPlayer mp) {
            // TODO Auto-generated method stub

           //write your code after complete video play  
        }
    });
Dheerendra Mitm
  • 182
  • 1
  • 9
2

Attach the callback by

video.setOnCompletionListener(new OnCompletionListener() { ... });
david
  • 2,529
  • 1
  • 34
  • 50
Vesu
  • 29
  • 1
1

In Xamarin.Android :

video.Completion += delegate {
    Finish();
};
jackw11111
  • 1,457
  • 1
  • 17
  • 34