protected override void OnCreate (Bundle icicle) { //base.OnCreate(icicle); if (!LibsChecker.CheckVitamioLibs (this)) return; SetContentView (Resource.Layout.videobuffer); mVideoView = FindViewById<VideoView> (Resource.Id.buffer); pb = FindViewById<ProgressBar> (Resource.Id.probar); downloadRateView = FindViewById<TextView> (Resource.Id.download_rate); loadRateView = FindViewById<TextView> (Resource.Id.load_rate); if (path == "") { // Tell the user to provide a media file URL/path. Toast.MakeText (this, "Please edit VideoBuffer Activity, and set path" + " variable to your media file URL/path", ToastLength.Long).Show (); return; } else { // // * Alternatively,for streaming media you can use // * mVideoView.setVideoURI(Uri.parse(URLstring)); // uri = Android.Net.Uri.Parse (path); mVideoView.SetVideoURI (uri); mVideoView.SetMediaController (new MediaController (this)); mVideoView.RequestFocus (); mVideoView.SetOnInfoListener (this); mVideoView.SetOnBufferingUpdateListener (this); mVideoView.Prepared += (object sender, MediaPlayer.PreparedEventArgs e) => { e.P0.SetPlaybackSpeed(1.0f); }; } }
protected override void OnCreate(Bundle icicle) { //base.OnCreate(icicle); if (!LibsChecker.CheckVitamioLibs(this)) { return; } SetContentView(Resource.Layout.videobuffer); mVideoView = FindViewById <VideoView> (Resource.Id.buffer); pb = FindViewById <ProgressBar> (Resource.Id.probar); downloadRateView = FindViewById <TextView> (Resource.Id.download_rate); loadRateView = FindViewById <TextView> (Resource.Id.load_rate); if (path == "") { // Tell the user to provide a media file URL/path. Toast.MakeText(this, "Please edit VideoBuffer Activity, and set path" + " variable to your media file URL/path", ToastLength.Long).Show(); return; } else { // // * Alternatively,for streaming media you can use // * mVideoView.setVideoURI(Uri.parse(URLstring)); // uri = Android.Net.Uri.Parse(path); mVideoView.SetVideoURI(uri); mVideoView.SetMediaController(new MediaController(this)); mVideoView.RequestFocus(); mVideoView.SetOnInfoListener(this); mVideoView.SetOnBufferingUpdateListener(this); mVideoView.Prepared += (object sender, MediaPlayer.PreparedEventArgs e) => { e.P0.SetPlaybackSpeed(1.0f); }; } }