示例#1
0
		protected override void OnCreate(Bundle icicle)
		{
			base.OnCreate(icicle);
			if (!LibsChecker.CheckVitamioLibs(this))
				return;
			SetContentView(Resource.Layout.videoview);
			mEditText = FindViewById<EditText>(Resource.Id.url);
			mVideoView = (VideoView) FindViewById<VideoView>(Resource.Id.surface_view);
			if (path == "")
			{
				// Tell the user to provide a media file URL/path.
				Toast.MakeText(this, "Please edit VideoViewDemo 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));
				//			 
				mVideoView.SetVideoPath(path);
				mVideoView.SetMediaController(new IO.Vov.Vitamio.Widget.MediaController(this));
				mVideoView.RequestFocus();
				mVideoView.Prepared += (object sender, MediaPlayer.PreparedEventArgs e) => e.P0.SetPlaybackSpeed (1.0f);
			}

		}
示例#2
0
 protected override void OnCreate(Bundle icicle)
 {
     base.OnCreate(icicle);
     if (!LibsChecker.CheckVitamioLibs(this))
     {
         return;
     }
     SetContentView(Resource.Layout.videoview);
     mEditText  = FindViewById <EditText>(Resource.Id.url);
     mVideoView = (VideoView)FindViewById <VideoView>(Resource.Id.surface_view);
     if (path == "")
     {
         // Tell the user to provide a media file URL/path.
         Toast.MakeText(this, "Please edit VideoViewDemo 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));
         //
         mVideoView.SetVideoPath(path);
         mVideoView.SetMediaController(new IO.Vov.Vitamio.Widget.MediaController(this));
         mVideoView.RequestFocus();
         mVideoView.Prepared += (object sender, MediaPlayer.PreparedEventArgs e) => e.P0.SetPlaybackSpeed(1.0f);
     }
 }