Exemplo n.º 1
0
        /// <summary>
        /// 停止
        /// </summary>
        public void Stop()
        {
            CheckAlive();
            Status = GraphState.Stopped;
            MediaControl.Stop();
            long pos = 0;

            MediaSeeking.SetPositions(ref pos, AMSeekingSeekingFlags.AbsolutePositioning, ref pos, AMSeekingSeekingFlags.NoPositioning);
            MediaControl.StopWhenReady();
            if (MediaStop != null)
            {
                MediaStop(this, EventArgs.Empty);
            }
        }
Exemplo n.º 2
0
        public override void SetCurrentPosition(long time)
        {
            if (IsGraphSeekable)
            {
                var state = GraphState;
                PauseGraph();
                long pStop = 0;
                MediaSeeking.SetPositions(ref time, SeekingFlags.AbsolutePositioning, ref pStop, SeekingFlags.NoPositioning);

                switch (state)
                {
                case GraphState.Running:
                    ResumeGraph();
                    break;

                case GraphState.Stopped:
                    MediaControl.Stop();
                    GraphState = GraphState.Stopped;
                    break;
                }
            }
        }