예제 #1
0
        public void OnSelection(MaterialDialog p0, View p1, int itemId, ICharSequence itemString)
        {
            try
            {
                if (OnClickActionFor == OnClickAction.Quality)
                {
                    Controller.VideoData.QualityVideoSelect = itemString.ToString();
                    QualityText.Text = Context.GetString(Resource.String.Lbl_Quality) + " - " + itemString.ToString();

                    var url = AppTools.GetLinkWithQuality(Controller.VideoData, itemString.ToString());
                    if (!string.IsNullOrEmpty(url))
                    {
                        Controller.PlayVideo(url, Controller.VideoData, VideoController.Player.CurrentPosition);
                    }
                }
                else if (OnClickActionFor == OnClickAction.PlaybackSpeed)
                {
                    PlaybackSpeedText.Text = Context.GetString(Resource.String.Lbl_Playback_Speed) + " - " + itemString.ToString();
                    var playbackParameters = new PlaybackParameters(AppTools.GetSpeed(itemString.ToString()));
                    Controller.ChangePlaybackSpeed(playbackParameters);
                }

                OnClickActionFor = OnClickAction.None;
                Dismiss();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }