private void Initialize()
        {
            try
            {
                PlayerListener = new PlayerEvents(ActivityContext, ControlView);

                if (ActivityName != "FullScreen")
                {
                    SimpleExoPlayerView = ActivityContext.FindViewById <PlayerView>(Resource.Id.player_view);
                    SimpleExoPlayerView.SetControllerVisibilityListener(PlayerListener);
                    SimpleExoPlayerView.RequestFocus();

                    //Player initialize
                    ControlView    = SimpleExoPlayerView.FindViewById <PlayerControlView>(Resource.Id.exo_controller);
                    PlayerListener = new PlayerEvents(ActivityContext, ControlView);

                    MFullScreenIcon   = ControlView.FindViewById <ImageView>(Resource.Id.exo_fullscreen_icon);
                    MFullScreenButton = ControlView.FindViewById <FrameLayout>(Resource.Id.exo_fullscreen_button);

                    MainVideoFrameLayout = ActivityContext.FindViewById <FrameLayout>(Resource.Id.root);
                    MainVideoFrameLayout.SetOnClickListener(this);

                    switch (MFullScreenButton.HasOnClickListeners)
                    {
                    case false:
                        MFullScreenButton.SetOnClickListener(this);
                        break;
                    }
                }
                else
                {
                    FullscreenPlayerView = ActivityContext.FindViewById <PlayerView>(Resource.Id.player_view2);
                    ControlView          = FullscreenPlayerView.FindViewById <PlayerControlView>(Resource.Id.exo_controller);
                    PlayerListener       = new PlayerEvents(ActivityContext, ControlView);

                    MFullScreenIcon   = ControlView.FindViewById <ImageView>(Resource.Id.exo_fullscreen_icon);
                    MFullScreenButton = ControlView.FindViewById <FrameLayout>(Resource.Id.exo_fullscreen_button);

                    switch (MFullScreenButton.HasOnClickListeners)
                    {
                    case false:
                        MFullScreenButton.SetOnClickListener(this);
                        break;
                    }
                }
            }
            catch (Exception exception)
            {
                Methods.DisplayReportResultTrack(exception);
            }
        }
Ejemplo n.º 2
0
        private void Initialize()
        {
            try
            {
                if (ActivityName != "FullScreen")
                {
                    SimpleExoPlayerView = ActivityContext.FindViewById <PlayerView>(Resource.Id.player_view);
                    ControlView         = SimpleExoPlayerView.FindViewById <PlayerControlView>(Resource.Id.exo_controller);
                    PlayerListener      = new PlayerEvents(this, ActivityContext, ControlView);
                    SimpleExoPlayerView.SetControllerVisibilityListener(PlayerListener);
                    SimpleExoPlayerView.RequestFocus();
                    //Player initialize
                    ExoTopLayout         = ControlView.FindViewById <LinearLayout>(Resource.Id.topLayout);
                    ExoBackButton        = ControlView.FindViewById <ImageView>(Resource.Id.BackIcon);
                    DownloadIcon         = ControlView.FindViewById <ImageView>(Resource.Id.Download_icon);
                    MFullScreenIcon      = ControlView.FindViewById <ImageView>(Resource.Id.exo_fullscreen_icon);
                    MFullScreenButton    = ControlView.FindViewById <FrameLayout>(Resource.Id.exo_fullscreen_button);
                    ShareIcon            = ControlView.FindViewById <ImageView>(Resource.Id.share_icon);
                    MenueButton          = ControlView.FindViewById <FrameLayout>(Resource.Id.exo_menue_button);
                    MainVideoFrameLayout = ActivityContext.FindViewById <FrameLayout>(Resource.Id.root);
                    MainRoot             = ActivityContext.FindViewById <FrameLayout>(Resource.Id.Mainroot);
                    ExoTopAds            = ControlView.FindViewById <LinearLayout>(Resource.Id.exo_top_ads);
                    ExoEventButton       = ControlView.FindViewById <LinearLayout>(Resource.Id.exo_event_buttons);
                    BtnSkipIntro         = ControlView.FindViewById <TextView>(Resource.Id.exo_skipIntro);

                    BtnSkipIntro.Visibility = ViewStates.Gone;
                    ExoTopAds.Visibility    = ViewStates.Gone;

                    //SimpleExoPlayerView.HideController();
                    //SimpleExoPlayerView.RequestDisallowInterceptTouchEvent(true);
                    //SimpleExoPlayerView.ControllerHideOnTouch = true;

                    MainVideoFrameLayout.SetOnClickListener(this);
                    LoadingProgressBar = ActivityContext.FindViewById <ProgressBar>(Resource.Id.progress_bar);

                    if (!MFullScreenButton.HasOnClickListeners)
                    {
                        MFullScreenButton.SetOnClickListener(this);
                    }

                    if (!ExoBackButton.HasOnClickListeners)
                    {
                        //ExoBackButton.Click += BackIcon_Click;
                        DownloadIcon.Click += Download_icon_Click;
                        ShareIcon.Click    += ShareIcon_Click;
                        MenueButton.Click  += Menu_button_Click;
                        BtnSkipIntro.Click += BtnSkipIntroOnClick;
                        ExoTopAds.Click    += ExoTopAdsOnClick;
                    }
                }
                else
                {
                    FullScreenPlayerView = ActivityContext.FindViewById <PlayerView>(Resource.Id.player_view2);
                    ControlView          = FullScreenPlayerView.FindViewById <PlayerControlView>(Resource.Id.exo_controller);
                    PlayerListener       = new PlayerEvents(this, ActivityContext, ControlView);

                    ExoTopLayout      = ControlView.FindViewById <LinearLayout>(Resource.Id.topLayout);
                    ExoBackButton     = ControlView.FindViewById <ImageView>(Resource.Id.BackIcon);
                    DownloadIcon      = ControlView.FindViewById <ImageView>(Resource.Id.Download_icon);
                    MFullScreenIcon   = ControlView.FindViewById <ImageView>(Resource.Id.exo_fullscreen_icon);
                    MFullScreenButton = ControlView.FindViewById <FrameLayout>(Resource.Id.exo_fullscreen_button);
                    ShareIcon         = ControlView.FindViewById <ImageView>(Resource.Id.share_icon);
                    MenueButton       = ControlView.FindViewById <FrameLayout>(Resource.Id.exo_menue_button);
                    ExoTopAds         = ControlView.FindViewById <LinearLayout>(Resource.Id.exo_top_ads);
                    ExoEventButton    = ControlView.FindViewById <LinearLayout>(Resource.Id.exo_event_buttons);
                    BtnSkipIntro      = ControlView.FindViewById <TextView>(Resource.Id.exo_skipIntro);

                    BtnSkipIntro.Visibility = ViewStates.Gone;
                    ExoTopAds.Visibility    = ViewStates.Gone;

                    if (!MFullScreenButton.HasOnClickListeners)
                    {
                        MFullScreenButton.SetOnClickListener(this);
                    }

                    if (!ExoBackButton.HasOnClickListeners)
                    {
                        ExoBackButton.Click += BackIcon_Click;
                        DownloadIcon.Click  += Download_icon_Click;
                        ShareIcon.Click     += ShareIcon_Click;
                        MenueButton.Click   += Menu_button_Click;
                        BtnSkipIntro.Click  += BtnSkipIntroOnClick;
                        ExoTopAds.Click     += ExoTopAdsOnClick;
                    }
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
Ejemplo n.º 3
0
        public void Initialize()
        {
            try
            {
                PlayerLitsener = new Player_Events(ActivityContext, controlView);

                if (ActivityName != "FullScreen")
                {
                    simpleExoPlayerView = ActivityContext.FindViewById <PlayerView>(Resource.Id.player_view);
                    simpleExoPlayerView.SetControllerVisibilityListener(PlayerLitsener);
                    simpleExoPlayerView.RequestFocus();

                    //Player initialize
                    controlView    = simpleExoPlayerView.FindViewById <PlaybackControlView>(Resource.Id.exo_controller);
                    PlayerLitsener = new Player_Events(ActivityContext, controlView);

                    Exo_topLayout     = controlView.FindViewById <LinearLayout>(Resource.Id.topLayout);
                    Exo_back_button   = controlView.FindViewById <ImageView>(Resource.Id.backIcon);
                    Download_icon     = controlView.FindViewById <ImageView>(Resource.Id.Download_icon);
                    mFullScreenIcon   = controlView.FindViewById <ImageView>(Resource.Id.exo_fullscreen_icon);
                    mFullScreenButton = controlView.FindViewById <FrameLayout>(Resource.Id.exo_fullscreen_button);
                    ShareIcon         = controlView.FindViewById <ImageView>(Resource.Id.share_icon);
                    Menue_button      = controlView.FindViewById <FrameLayout>(Resource.Id.exo_menue_button);
                    videoPlayButton   = controlView.FindViewById <ImageButton>(Resource.Id.exo_play);
                    videoResumeButton = controlView.FindViewById <ImageButton>(Resource.Id.exo_pause);

                    MainvideoFrameLayout = ActivityContext.FindViewById <FrameLayout>(Resource.Id.root);
                    MainvideoFrameLayout.SetOnClickListener(this);

                    Loadingprogress_bar = ActivityContext.FindViewById <ProgressBar>(Resource.Id.progress_bar);

                    QualityiconView             = ActivityContext.FindViewById <TextView>(Resource.Id.Qualityicon);
                    ViewsiconView               = ActivityContext.FindViewById <TextView>(Resource.Id.Viewsicon);
                    ShareiconView               = ActivityContext.FindViewById <TextView>(Resource.Id.Shareicon);
                    MoreiconView                = ActivityContext.FindViewById <TextView>(Resource.Id.Moreicon);
                    ShowMoreDiscriptioniconView = ActivityContext.FindViewById <TextView>(Resource.Id.video_ShowDiscription);
                    videoDescriptionLayout      = ActivityContext.FindViewById <LinearLayout>(Resource.Id.videoDescriptionLayout);


                    Share_Button        = ActivityContext.FindViewById <LinearLayout>(Resource.Id.ShareButton);
                    Share_Button.Click += ShareIcon_Click;

                    More_Button        = ActivityContext.FindViewById <LinearLayout>(Resource.Id.moreButton);
                    More_Button.Click += MoreButton_OnClick;

                    Video_Titile           = ActivityContext.FindViewById <TextView>(Resource.Id.video_Titile);
                    Video_QualityTextView  = ActivityContext.FindViewById <TextView>(Resource.Id.QualityTextView);
                    Video_ViewsNumber      = ActivityContext.FindViewById <TextView>(Resource.Id.ViewsNumber);
                    Video_videoDate        = ActivityContext.FindViewById <TextView>(Resource.Id.videoDate);
                    Video_videoDescription = ActivityContext.FindViewById <AutoLinkTextView>(Resource.Id.videoDescriptionTextview);
                    Video_videoCategory    = ActivityContext.FindViewById <TextView>(Resource.Id.videoCategorytextview);

                    Video_Stars = ActivityContext.FindViewById <TextView>(Resource.Id.videoStarstextview);
                    Video_Tag   = ActivityContext.FindViewById <TextView>(Resource.Id.videoTagtextview);

                    TextSanitizerAutoLink = new TextSanitizer(Video_videoDescription, ActivityContext);

                    IMethods.Set_TextViewIcon("1", QualityiconView, IonIcons_Fonts.RibbonA);
                    IMethods.Set_TextViewIcon("1", ViewsiconView, IonIcons_Fonts.Eye);
                    IMethods.Set_TextViewIcon("1", ShareiconView, IonIcons_Fonts.ReplyAll);
                    IMethods.Set_TextViewIcon("1", MoreiconView, IonIcons_Fonts.PlusCircled);
                    IMethods.Set_TextViewIcon("1", ShowMoreDiscriptioniconView, IonIcons_Fonts.ArrowDownB);

                    ShowMoreDiscriptioniconView.Visibility = ViewStates.Gone;

                    videoDescriptionLayout.Visibility = ViewStates.Visible;

                    if (!mFullScreenButton.HasOnClickListeners)
                    {
                        mFullScreenButton.SetOnClickListener(this);
                    }

                    if (!Exo_back_button.HasOnClickListeners)
                    {
                        Exo_back_button.Click += BackIcon_Click;
                        Download_icon.Click   += Download_icon_Click;
                        ShareIcon.Click       += ShareIcon_Click;
                        //Menue_button.Click += Menue_button_Click;

                        Menue_button.Visibility = ViewStates.Gone;
                    }
                }
                else
                {
                    FullscreenplayerView = ActivityContext.FindViewById <PlayerView>(Resource.Id.player_view2);
                    controlView          = FullscreenplayerView.FindViewById <PlaybackControlView>(Resource.Id.exo_controller);
                    PlayerLitsener       = new Player_Events(ActivityContext, controlView);

                    Exo_topLayout     = controlView.FindViewById <LinearLayout>(Resource.Id.topLayout);
                    Exo_back_button   = controlView.FindViewById <ImageView>(Resource.Id.backIcon);
                    Download_icon     = controlView.FindViewById <ImageView>(Resource.Id.Download_icon);
                    mFullScreenIcon   = controlView.FindViewById <ImageView>(Resource.Id.exo_fullscreen_icon);
                    mFullScreenButton = controlView.FindViewById <FrameLayout>(Resource.Id.exo_fullscreen_button);
                    ShareIcon         = controlView.FindViewById <ImageView>(Resource.Id.share_icon);
                    Menue_button      = controlView.FindViewById <FrameLayout>(Resource.Id.exo_menue_button);
                    videoPlayButton   = controlView.FindViewById <ImageButton>(Resource.Id.exo_play);
                    videoResumeButton = controlView.FindViewById <ImageButton>(Resource.Id.exo_pause);

                    if (!mFullScreenButton.HasOnClickListeners)
                    {
                        mFullScreenButton.SetOnClickListener(this);
                    }

                    if (!Exo_back_button.HasOnClickListeners)
                    {
                        Exo_back_button.Click += BackIcon_Click;
                        Download_icon.Click   += Download_icon_Click;
                        ShareIcon.Click       += ShareIcon_Click;
                        //Menue_button.Click += Menue_button_Click;

                        Menue_button.Visibility = ViewStates.Gone;
                    }
                }
            }
            catch (Exception exception)
            {
                Crashes.TrackError(exception);
            }
        }
Ejemplo n.º 4
0
        public void Initialize()
        {
            try
            {
                PlayerListener = new PlayerEvents(ActivityContext, ControlView);

                if (ActivityName != "FullScreen")
                {
                    SimpleExoPlayerView = ActivityContext.FindViewById <PlayerView>(Resource.Id.player_view);
                    SimpleExoPlayerView.SetControllerVisibilityListener(PlayerListener);
                    SimpleExoPlayerView.RequestFocus();

                    //Player initialize
                    ControlView    = SimpleExoPlayerView.FindViewById <PlayerControlView>(Resource.Id.exo_controller);
                    PlayerListener = new PlayerEvents(ActivityContext, ControlView);

                    FullScreenIcon    = ControlView.FindViewById <ImageView>(Resource.Id.exo_fullscreen_icon);
                    FullScreenButton  = ControlView.FindViewById <FrameLayout>(Resource.Id.exo_fullscreen_button);
                    VideoPlayButton   = ControlView.FindViewById <ImageButton>(Resource.Id.exo_play);
                    VideoResumeButton = ControlView.FindViewById <ImageButton>(Resource.Id.exo_pause);

                    MainVideoFrameLayout = ActivityContext.FindViewById <FrameLayout>(Resource.Id.root);
                    MainVideoFrameLayout.SetOnClickListener(this);

                    LoadingProgressBar = ActivityContext.FindViewById <ProgressBar>(Resource.Id.progress_bar);

                    if (!AppSettings.ShowFullScreenVideoPost)
                    {
                        FullScreenIcon.Visibility   = ViewStates.Gone;
                        FullScreenButton.Visibility = ViewStates.Gone;
                    }
                    else
                    {
                        if (!FullScreenButton.HasOnClickListeners)
                        {
                            FullScreenButton.SetOnClickListener(this);
                        }
                    }
                }
                else
                {
                    FullScreenPlayerView = ActivityContext.FindViewById <PlayerView>(Resource.Id.player_view2);
                    ControlView          = FullScreenPlayerView.FindViewById <PlayerControlView>(Resource.Id.exo_controller);
                    PlayerListener       = new PlayerEvents(ActivityContext, ControlView);

                    FullScreenIcon    = ControlView.FindViewById <ImageView>(Resource.Id.exo_fullscreen_icon);
                    FullScreenButton  = ControlView.FindViewById <FrameLayout>(Resource.Id.exo_fullscreen_button);
                    VideoPlayButton   = ControlView.FindViewById <ImageButton>(Resource.Id.exo_play);
                    VideoResumeButton = ControlView.FindViewById <ImageButton>(Resource.Id.exo_pause);

                    if (!AppSettings.ShowFullScreenVideoPost)
                    {
                        FullScreenIcon.Visibility   = ViewStates.Gone;
                        FullScreenButton.Visibility = ViewStates.Gone;
                    }
                    else
                    {
                        if (!FullScreenButton.HasOnClickListeners)
                        {
                            FullScreenButton.SetOnClickListener(this);
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }