protected override void OnCreate (Bundle icicle)
		{
			base.OnCreate (icicle);
			if (!LibsChecker.CheckVitamioLibs (this))
				return;
			SetContentView (Resource.Layout.subtitle2);
			mVideoView = FindViewById<VideoView> (Resource.Id.surface_view);
			mSubtitleView = FindViewById<TextView> (Resource.Id.subtitle_view);

			if (path == "") {
				// Tell the user to provide a media file URL/path.
				Toast.MakeText (this, "Please edit VideoViewSubtitle 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 MediaController(this));
				mVideoView.RequestFocus ();
				mVideoView.Prepared += (object sender, MediaPlayer.PreparedEventArgs e) => {
					// optional need Vitamio 4.0
					e.P0.SetPlaybackSpeed (1.0f);
					mVideoView.AddTimedTextSource (subtitle_path);
					mVideoView.SetTimedTextShown (true);	
				};

				mVideoView.SetOnTimedTextListener (this);

			}
		}
        protected override void OnElementChanged(ElementChangedEventArgs <Page> e)
        {
            base.OnElementChanged(e);

            if (e.OldElement != null || this.Element == null)
            {
                return;
            }


            activity = this.Context as Activity;

            videoView = new IO.Vov.Vitamio.Widget.VideoView(Forms.Context);

            videoView.SetVideoPath(UrlCamera.Url);
            videoView.SetMediaController(new IO.Vov.Vitamio.Widget.MediaController(activity));
            videoView.RequestFocus();

            var ll = new LinearLayout(Forms.Context);

            ll.LayoutParameters = new LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent);
            ll.SetPadding(10, 50, 10, 50);


            videoView.Start();

            ll.AddView(videoView);
            AddView(ll);
            NativeView = ll;
        }
 public async void initData()
 {
     //register battery change broadcast
     RegisterBatteryChangedReceiver();
     //check vitamio installed?
     if (!LibsChecker.CheckVitamioLibs(Activity))
     {
         return;
     }
     //get video_url
     video_url = Utils.EncodeURL(getVideoUrl());
     if (!string.IsNullOrEmpty(video_url))
     {
         vv.SetVideoURI(Android.Net.Uri.Parse(Utils.EncodeURL(video_url)));
     }
     else
     {
         DialogFactory.ToastDialog(Activity, "Connect error", "Connect error,please try again later!", Constants.RETURN_LIST);
     }
     vv.RequestFocus();
     vv.Prepared += delegate(object sender, IO.Vov.Vitamio.MediaPlayer.PreparedEventArgs e) {
         e.P0.SetPlaybackSpeed(1.0f);                 //start play
         vv.Start();
         //put duration
         string duration = Utils.formatMillis(vv.Duration);                 //set duration
         tv_duration.Text = duration;
         sb_video.Max     = (int)vv.Duration;
         updateCurrentPosition();
         btn_play.SetBackgroundResource(Resource.Drawable.selector_btn_pause);                                                                //set play button
         tv_title.Text = Activity.Intent.GetStringExtra(Constants.LESSON_TITLE) + ":" + Activity.Intent.GetStringExtra(Constants.LESSON_DES); //set video title
         //hide the loading progress bar
         hideLoadingCtl();
     };
     //control volume
     initVolume();
     // scale volume
     maxVlumeScreenHeightScale = ((float)maxVolume) / Utils.getWindowWidth(Activity);
     //set screen width and height
     screenWidth  = Utils.getWindowWidth(Activity);
     screenHeight = Utils.getWindowHeight(Activity);
 }
        protected override void OnCreate(Bundle icicle)
        {
            base.OnCreate(icicle);
            if (!LibsChecker.CheckVitamioLibs(this))
            {
                return;
            }
            SetContentView(Resource.Layout.subtitle2);
            mVideoView    = FindViewById <VideoView> (Resource.Id.surface_view);
            mSubtitleView = FindViewById <TextView> (Resource.Id.subtitle_view);

            if (path == "")
            {
                // Tell the user to provide a media file URL/path.
                Toast.MakeText(this, "Please edit VideoViewSubtitle 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 MediaController(this));
                mVideoView.RequestFocus();
                mVideoView.Prepared += (object sender, MediaPlayer.PreparedEventArgs e) => {
                    // optional need Vitamio 4.0
                    e.P0.SetPlaybackSpeed(1.0f);
                    mVideoView.AddTimedTextSource(subtitle_path);
                    mVideoView.SetTimedTextShown(true);
                };

                mVideoView.SetOnTimedTextListener(this);
            }
        }