Ejemplo n.º 1
0
        public Player_Events(Activity Act, PlaybackControlView controlView)
        {
            try
            {
                ActContext = Act;

                if (controlView != null)
                {
                    videoPlayButton     = controlView.FindViewById <ImageButton>(Resource.Id.exo_play);
                    videoResumeButton   = controlView.FindViewById <ImageButton>(Resource.Id.exo_pause);
                    Loadingprogress_bar = ActContext.FindViewById <ProgressBar>(Resource.Id.progress_bar);
                }
            }
            catch (Exception exception)
            {
                Crashes.TrackError(exception);
            }
        }
Ejemplo n.º 2
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);
            }
        }