获取MediaPlayer:错误(1,-2147483648)
MediaController mediacontroller = new MediaController(getActivity());
mediacontroller.setAnchorView(videoView);
videoView.setVideoPath("https://example.com");
videoView.start();
类级变量
VideoView videoView
我把它放在OnCreate中
SetContentView(Resource.Layout.Main);
videoView = FindViewById<VideoView>(Resource.Id.video);
ImageButton button = FindViewById<ImageButton>(Resource.Id.two_btn);
MediaController mController = new
Android.Widget.MediaController(this);
mController.SetAnchorView(videoView);
videoView.SetMediaController(mController);
uriPath = "https://example.com";
Android.Net.Uri uri = Android.Net.Uri.Parse(uriPath);
videoView.RequestFocus();
videoView.SetVideoURI(uri);
videoView.Start();
我的按钮点击事件,所以我可以用一个按钮开始视频