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;
        }
Example #3
0
 public MyHandler(TextView tv_system_time, TextView tv_position, IO.Vov.Vitamio.Widget.VideoView vv, SeekBar sb, BaseVideoFragment vp)
 {
     this.tv_system_time = tv_system_time;
     this.tv_position    = tv_position;
     this.vv             = vv;
     this.sb             = sb;
     this.vp             = vp;
 }
 protected override void Dispose(bool disposing)
 {
     if (videoView != null)
     {
         videoView.StopPlayback();
         videoView = null;
     }
     base.Dispose(disposing);
 }
Example #5
0
 private void initView()
 {
     vv = view.FindViewById <IO.Vov.Vitamio.Widget.VideoView> (Resource.Id.video_view);
     //TextView control
     tv_title            = view.FindViewById <TextView> (Resource.Id.tv_title);
     tv_system_time      = view.FindViewById <TextView> (Resource.Id.tv_system_time);
     tv_current_position = view.FindViewById <TextView> (Resource.Id.tv_current_position);
     tv_duration         = view.FindViewById <TextView> (Resource.Id.tv_duration);
     iv_battery          = view.FindViewById <ImageView> (Resource.Id.iv_battery);
     //seekbar
     sb_voice = view.FindViewById <SeekBar> (Resource.Id.sb_voice);
     sb_video = view.FindViewById <SeekBar> (Resource.Id.sb_video);
     //button
     btn_play              = view.FindViewById <Button> (Resource.Id.btn_play);
     btn_share             = view.FindViewById <Button> (Resource.Id.btn_share);
     btn_voice             = view.FindViewById <Button> (Resource.Id.btn_voice);
     btn_exit              = view.FindViewById <Button> (Resource.Id.btn_exit);
     ll_loading            = view.FindViewById <LinearLayout> (Resource.Id.ll_loading);
     tv_loading            = view.FindViewById <TextView> (Resource.Id.tv_loading);
     ll_loading.Visibility = ViewStates.Visible;
     handler = new MyHandler(tv_system_time, tv_current_position, vv, sb_video, this);
 }
Example #6
0
        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);
            }
        }