Example #1
0
 /// <summary>
 /// 再生
 /// </summary>
 public void Play()
 {
     CheckAlive();
     Status = GraphState.Playing;
     MediaControl.Run();
     if (MediaStart != null)
     {
         MediaStart(this, EventArgs.Empty);
     }
 }
Example #2
0
        /// <summary>
        /// The background thread entry point
        /// this is where the graph is created and run from
        /// </summary>
        /// <param name="arg"></param>
        private void StartAsync(object arg)
        {
            try
            {
                Trace("Starting ...");
                _url = arg.ToString();
                Trace(_url);

                Trace("Checking Status");
                CheckSystemStatus();

                Trace("Create Sample Grabber Callback");
                _capGrabber = new SampleGrabberCallback();

                Trace("Building Graph");
                _graph = (IGraphBuilder) new FilterGraph();


                BuildGraph(Graph, _url);

                InitializeSampleGrabber();

                //debug
                rot = new DsROTEntry(Graph);

                Trace("Running Graph");
                int hr = MediaControl.Run();
                CheckHr(hr, "Can't run the graph");
                RunGraph();
            }
            catch (Exception ex)
            {
                ExceptionHelper.HandleException(ex);
                Trace("ERROR: Creating Graph");
            }
        }
Example #3
0
 /// <summary>
 /// Invoked when the Play command is executed
 /// </summary>
 /// <param name="sender">Sender</param>
 private void DoPlay(object sender)
 {
     MediaControl.Run();
 }