Exemplo n.º 1
0
        private void buttonPause_Click(object sender, EventArgs e)
        {
            logger.Debug("buttonPause_Click(...)");

            if (videoRenderer != null)
            {
                //videoRenderer.Pause();

                presentationClock.GetState(0, out ClockState state);
                if (state == ClockState.Running)
                {
                    presentationClock.Pause();
                }
                else if (state == ClockState.Paused)
                {
                    presentationClock.Start(long.MaxValue);
                }
                else
                {
                    logger.Warn("Pause() return invalid clock state: " + state);
                }

                sampleSource.Pause();
            }
        }
Exemplo n.º 2
0
        private void PlatformGetState(ref MediaState result)
        {
            if (_clock != null)
            {
                ClockState state;
                _clock.GetState(0, out state);

                switch (state)
                {
                case ClockState.Running:
                    result = MediaState.Playing;
                    return;

                case ClockState.Paused:
                    result = MediaState.Paused;
                    return;
                }
            }

            result = MediaState.Stopped;
        }