private void WaitTimer_Tick(object sender, EventArgs e)
        {
            _waitTimer.IfNotNull(i => i.Stop());

            if (IsRetrying)
            {
                SetMediaSource();
            }
            else
            {
                StopRetrying();
                RetryFailed.IfNotNull(i => i(this));
            }
        }
        private void GiveupTimer_Tick(object sender, EventArgs e)
        {
            _giveupTimer.Stop();

            if (_waitTimer.IsEnabled)
            {
                _waitTimer.Stop();
                RetryFailed.IfNotNull(i => i(this));
                StopRetrying();
            }
            else
            {
                exitOnFail = true;
            }
        }
        private void MediaPlugin_MediaFailed(IMediaPlugin mediaPlugin, Exception error)
        {
            if (_successTimer.IsEnabled)
            {
                _successTimer.Stop();
            }

            if (!exitOnFail)
            {
                RetryAttemptFailed.IfNotNull(i => i(this, error));
                // start up a timer to try again
                _waitTimer.Start();
            }
            else
            {
                exitOnFail = false;
                RetryFailed.IfNotNull(i => i(this));
                Deployment.Current.Dispatcher.BeginInvoke(StopRetrying);
            }
        }