Ejemplo n.º 1
0
        public void Stop()
        {
            _scheduler.Stop();
            _playlist.Stop();

            _isRunning        = false;
            _loopPlayToken    = null;
            _forcePlayRequest = false;
        }
Ejemplo n.º 2
0
 private void StopDelay(ILoopPlayToken token)
 {
     if (CanStopDelay(token))
     {
         _loopPlayToken.RequestStop -= LoopPlayToken_RequestStop;
         _loopPlayToken              = null;
     }
     else
     {
         throw new InvalidOperationException();
     }
 }
Ejemplo n.º 3
0
        //public bool CanForcePlay(IPlayItem playItem)
        //{
        //    return _isRunning && !_forcePlayRequest && _loopPlayToken == null &&
        //        _nextItem == null && _currentItem != null && _currentItem.PlayItem != playItem && _playlist.CanForcePlay(playItem);
        //}

        public bool StartDelay(out ILoopPlayToken token)
        {
            token = null;
            if (CanStartDelay())
            {
                if (_currentItem.PlayerToken.RemainTime >= TimeSpan.FromSeconds(2.0))
                {
                    _loopPlayToken              = new LoopPlayToken();
                    _loopPlayToken.RequestStop += LoopPlayToken_RequestStop;
                    token = _loopPlayToken;
                    return(true);
                }
            }

            return(false);
        }