internal void StopDelay() { if (CanStopDelay()) { _loopPlayToken.Stop(); _loopPlayToken = null; //_innerPlayout.StopDelay(); //OnStateChanged(); } }
private void StopDelay(ILoopPlayToken token) { if (CanStopDelay(token)) { _loopPlayToken.RequestStop -= LoopPlayToken_RequestStop; _loopPlayToken = null; } else { throw new InvalidOperationException(); } }
//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); }
public bool CanStopDelay(ILoopPlayToken token = null) { return(_isRunning && !_forcePlayRequest && _loopPlayToken != null && _loopPlayToken == token); }