LibMPlayerCommon.MPlayer.Pause C# (CSharp) Method

Pause() public method

Pause the current video. If paused it will unpause.
public Pause ( ) : void
return void
        public void Pause()
        {
            if (this.CurrentStatus != MediaStatus.Playing && this.CurrentStatus != MediaStatus.Paused)
            {
                return;
            }

            try
            {
                MediaPlayer.StandardInput.WriteLine("pause");
                MediaPlayer.StandardInput.Flush();
            }
            catch (Exception ex)
            {
                Logging.Instance.WriteLine(ex);
                return;
            }

            if (this.CurrentStatus == MediaStatus.Paused)
            {
                this.CurrentStatus = MediaStatus.Playing;
            }
            else
            {
                this.CurrentStatus = MediaStatus.Paused;
            }
        }

Usage Example

Esempio n. 1
0
        public void Pause()
        {
            if (!_canPlay || _mPlayer.CurrentStatus == MediaStatus.Stopped)
            {
                return;
            }

            _mPlayer.Pause();
        }