我正在使用这段代码来播放视频:
string videoUriString = "android.resource://" + this.PackageName + "/" + Resource.Raw.video;
Android.Net.Uri videoURI = Android.Net.Uri.Parse(videoUriString);
video.SetVideoURI(videoURI);
video.Start();
但我真的很沮丧,因为我不明白如何附加一个回调来处理视频的结尾,我必须使用Monodroid,然后是C#
答案 0 :(得分:10)
myVideoView.setOnCompletionListener(new OnCompletionListener() {
@Override
public void onCompletion(MediaPlayer mp) {
// TODO Auto-generated method stub
//write your code after complete video play
}
});
答案 1 :(得分:2)
通过
附加回调video.setOnCompletionListener(new OnCompletionListener() { ... });
答案 2 :(得分:1)
在Xamarin.Android中:
video.Completion += delegate {
Finish();
};