public void DisplayInvisibleLayout() //Muestra el layout invisible para los eventos outside TOUCH
        {
            transparentLayout = new LinearLayout(this);

            _action = DisplayAdvertising;

            StartTimer();

            transparentLayout.Touch += (s, e) =>
            {
                StartTimer();
            };

            _param = new WindowManagerLayoutParams( //layout params de la vista "invisible" solo para el evento touch
                1,
                1,
                WindowManagerTypes.Phone,
                WindowManagerFlags.NotFocusable |
                WindowManagerFlags.NotTouchModal |
                WindowManagerFlags.WatchOutsideTouch,
                Format.Transparent);
            _param.Gravity = GravityFlags.Top | GravityFlags.Left;

            if (_advertisingView != null)
            {
                _windowManager.RemoveViewImmediate(_advertisingView);
                mVideoView.Suspend();
            }
            _windowManager.AddView(transparentLayout, _param);
        }
        private void SetVideoStory(string url)
        {
            try
            {
                StoryImageView.Visibility = StoryImageView.Visibility switch
                {
                    ViewStates.Visible => ViewStates.Gone,
                    _ => StoryImageView.Visibility
                };

                StoryVideoView.Visibility = StoryVideoView.Visibility switch
                {
                    ViewStates.Gone => ViewStates.Visible,
                    _ => StoryVideoView.Visibility
                };

                PlayIconVideo.Visibility = ViewStates.Visible;
                PlayIconVideo.Tag        = "Play";
                PlayIconVideo.SetImageResource(Resource.Drawable.ic_play_arrow);

                switch (StoryVideoView.IsPlaying)
                {
                case true:
                    StoryVideoView.Suspend();
                    break;
                }

                if (url.Contains("http"))
                {
                    StoryVideoView.SetVideoURI(Uri.Parse(url));
                }
                else
                {
                    var file = Uri.FromFile(new File(url));
                    StoryVideoView.SetVideoPath(file?.Path);
                }
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
Exemple #3
0
        //public void OnCompletion(MediaPlayer mp)
        //{
        //    Console.Write("Video Player Error : ");
        //    throw new NotImplementedException();
        //}

        //public void OnPrepared(MediaPlayer mp)
        //{
        //    throw new NotImplementedException();
        //}


        public override void OnBackPressed()
        {
            //if (VideoPlayer.IsPlaying)
            //{
            //    VideoPlayer.StopPlayback();
            //    //this.RequestedOrientation = ScreenOrientation.Portrait;
            //    VideoPlayer.Visibility = ViewStates.Gone;
            //    // As soon as the video starts, bring all the buttons back.
            //    ButtonCarCamera.Visibility = ViewStates.Visible;
            //    ButtonTrackCamera.Visibility = ViewStates.Visible;
            //    ButtonOverheadCamera.Visibility = ViewStates.Visible;
            //    ButtonTVFeed.Visibility = ViewStates.Visible;
            //}
            //else
            //{
            //    base.OnBackPressed();
            //}
            previewVideoPlayer.Suspend();
            base.OnBackPressed();
        }
Exemple #4
0
        public void SetvideoStory(string url)
        {
            try
            {
                if (imagstoryDisplay.Visibility == ViewStates.Visible)
                {
                    imagstoryDisplay.Visibility = ViewStates.Gone;
                }

                if (videoView.Visibility == ViewStates.Gone)
                {
                    videoView.Visibility = ViewStates.Visible;
                }

                Btn_Video_icon.Visibility = ViewStates.Visible;

                Btn_Video_icon.Tag = "Play";
                Btn_Video_icon.SetImageResource(Resource.Drawable.ic_play_arrow);

                LoadingProgressBarview.Visibility = ViewStates.Visible;

                if (videoView.IsPlaying)
                {
                    videoView.Suspend();
                }

                if (url.Contains("http"))
                {
                    videoView.SetVideoURI(Android.Net.Uri.Parse(url));
                }
                else
                {
                    var file = Android.Net.Uri.FromFile(new File(url));
                    videoView.SetVideoPath(file.Path);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        private void SetVideoStory(string url)
        {
            try
            {
                TxtEdit.Visibility = ViewStates.Gone;

                if (StoryImageView.Visibility == ViewStates.Visible)
                {
                    StoryImageView.Visibility = ViewStates.Gone;
                }

                if (StoryVideoView.Visibility == ViewStates.Gone)
                {
                    StoryVideoView.Visibility = ViewStates.Visible;
                }

                PlayIconVideo.Visibility = ViewStates.Visible;
                PlayIconVideo.Tag        = "Play";
                PlayIconVideo.SetImageResource(Resource.Drawable.ic_play_arrow);

                if (StoryVideoView.IsPlaying)
                {
                    StoryVideoView.Suspend();
                }

                if (url.Contains("http"))
                {
                    StoryVideoView.SetVideoURI(Android.Net.Uri.Parse(url));
                }
                else
                {
                    var file = Android.Net.Uri.FromFile(new File(url));
                    StoryVideoView.SetVideoPath(file.Path);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
 public override void OnBackPressed()
 {
     base.OnBackPressed();
     VideoPlayer.StopPlayback();
     VideoPlayer.Suspend();
 }