コード例 #1
0
ファイル: MainReceive.cs プロジェクト: Pzkgw/Camera-Support
        //Graphics g;

        //private void OnNewFrameCallback(System.Drawing.Bitmap frame)        {
        //g.DrawImage(frame, Point.Empty);        }

        private void MainReceive_StateChanged(object sender, MediaStateChange e)
        {
            try
            {
                switch (e.NewState)
                {
                case MediaState.Opening:
                    break;

                case MediaState.Buffering:
                    break;

                case MediaState.Playing:
                    //_mPlayer.Play();
                    break;

                case MediaState.Paused:
                case MediaState.Stopped:
                case MediaState.Ended:
                case MediaState.Error:
                    //_mPlayer.Stop();
                    break;

                case MediaState.NothingSpecial:
                    break;
                }

                //CLogger.VideoOnPlay = _info.Cam.Data.IsPlaying;
            }
            finally
            {
            }
        }
コード例 #2
0
 private void Events_StateChanged(object sender, MediaStateChange e)
 {
     if ((e.NewState.ToString() == "Error") || ((e.NewState.ToString() == "Stopped")))
     {
         _videoPlayState = false; // 结束播放
         Log4NetHelper.Instance.Info("执行从VLC控件播放视频:" + e.NewState.ToString());
     }
 }
コード例 #3
0
 /// <summary>
 /// Callback receives the new media state
 /// </summary>
 void Events_StateChanged(object sender, MediaStateChange e)
 {
     _Status = e.NewState;
     if (OnMediaStatusEvent != null)
     {
         OnMediaStatusEvent(this, e.NewState);
     }
 }
コード例 #4
0
        private void Events_StateChanged(object sender, MediaStateChange e)
        {
            var locked = false;

            Monitor.Enter(_lockStateModif, ref locked);
            try
            {
                switch (e.NewState)
                {
                case MediaState.Opening:
                    _info.Cam.Data.IsOpening = true;
                    break;

                case MediaState.Buffering:
                    _info.Cam.Data.IsBuffering = true;
                    break;

                case MediaState.Playing:
                    _info.Cam.Data.IsPlaying = true;
                    break;

                case MediaState.Paused:
                    _info.Cam.Data.IsPaused = true;
                    break;

                case MediaState.Stopped:
                    if (!SessionInfo.FullScreen && !_info.Cam.Data.IsStopped)
                    {
                        _form.BeginInvoke((Action)(() => SetBtnsVisibilityOnPlay(false)));
                    }
                    _info.Cam.Data.IsStopped = true;
                    break;

                case MediaState.Ended:
                    _form.BeginInvoke((Action)(() => StartVlcReinit(true)));
                    break;

                case MediaState.Error:
                    _form.BeginInvoke((Action)(() => StartVlcReinit(false)));
                    break;

                case MediaState.NothingSpecial:
                    break;
                }

                //CLogger.VideoOnPlay = _info.Cam.Data.IsPlaying;
            }
            finally
            {
                if (locked)
                {
                    Monitor.Exit(_lockStateModif);
                }
            }
        }
コード例 #5
0
ファイル: VLCStream.cs プロジェクト: mrgoodman2014/iSpy
 void EventsStateChanged(object sender, MediaStateChange e)
 {
     switch (e.NewState)
     {
     case MediaState.Ended:
     case MediaState.Stopped:
     case MediaState.Error:
         _abort?.Set();
         break;
     }
 }
コード例 #6
0
        void Events_StateChanged(object sender, MediaStateChange e)
        {
            UISync.Execute(() => label1.Text = e.NewState.ToString());
            switch (e.NewState)
            {
            case MediaState.Playing:
                UISync.Execute(() => btnPlayPause.Text = LocRm.GetString("Pause"));
                break;

            default:
                UISync.Execute(() => btnPlayPause.Text = LocRm.GetString("Play"));
                break;
            }
        }
コード例 #7
0
ファイル: VLCStream.cs プロジェクト: gxliu/ispyconnect
        void EventsStateChanged(object sender, MediaStateChange e)
        {
            lock (_lock)
            {
                switch (e.NewState)
                {
                case MediaState.Ended:
                case MediaState.Stopped:
                case MediaState.Error:
                    if (_isrunning || _starting)
                    {
                        DisposePlayer();
                        Duration = Time = 0;

                        _starting  = false;
                        _isrunning = false;
                        Thread.Sleep(1000);     //lets buffered frames stop before raising finished event
                        //if file source then dont reconnect
                        if (!Seekable && !_stoprequested)
                        {
                            if (PlayingFinished != null)
                            {
                                PlayingFinished(sender, ReasonToFinishPlaying.DeviceLost);
                            }
                            if (AudioFinished != null)
                            {
                                AudioFinished(sender, ReasonToFinishPlaying.DeviceLost);
                            }
                        }
                        else
                        {
                            if (PlayingFinished != null)
                            {
                                PlayingFinished(sender, ReasonToFinishPlaying.StoppedByUser);
                            }
                            if (AudioFinished != null)
                            {
                                AudioFinished(sender, ReasonToFinishPlaying.StoppedByUser);
                            }
                        }
                    }
                    _stoprequested = false;
                    break;
                }
            }
        }
コード例 #8
0
ファイル: Events.cs プロジェクト: wxmiswxm/Camera-Support
        private void Events_StateChanged(object sender, MediaStateChange e)
        {
            switch (e.NewState)
            {
            case MediaState.Opening:
                _info.Cam.Data.IsOpening = true;
                break;

            case MediaState.Buffering:
                _info.Cam.Data.IsBuffering = true;
                break;

            case MediaState.Playing:
                _info.Cam.Data.IsPlaying = true;
                break;

            case MediaState.Paused:
                _info.Cam.Data.IsPaused = true;
                break;

            case MediaState.Stopped:
                if (!_info.Cam.Data.IsStopped)
                {
                    UiSync.Execute(() => SetBtnsVisibilityOnPlay(false));
                }
                _info.Cam.Data.IsStopped = true;
                break;

            case MediaState.Ended:
                UiSync.Execute(() => StartVlcReinit(true));
                break;

            case MediaState.Error:
                UiSync.Execute(() => StartVlcReinit(false));
                break;

            case MediaState.NothingSpecial:
                break;
            }

            if (_mPlayer != null)
            {
                SessionInfo.Playing = _mPlayer.IsPlaying;
            }
        }
コード例 #9
0
 void EventsStateChanged(object sender, MediaStateChange e)
 {
     switch (e.NewState)
     {
     case MediaState.Ended:
     case MediaState.Stopped:
     case MediaState.Error:
         if (_stopEvent != null && !_stopping)
         {
             _stopping = true;
             try
             {
                 _stopEvent.Set();
             }
             catch { }
         }
         break;
     }
 }
コード例 #10
0
ファイル: PlayerVLC.cs プロジェクト: Sirendium/IQ-RVS
        void EventsStateChanged(object sender, MediaStateChange e)
        {
            UISync.Execute(() => label1.Text = e.NewState.ToString());
            switch (e.NewState)
            {
            case MediaState.Playing:
                UISync.Execute(() => btnPlayPause.Text = "||");
                break;

            case MediaState.Ended:
                if (chkRepeatAll.Checked)
                {
                    Go(1);
                }

                UISync.Execute(() => btnPlayPause.Text = ">");
                break;

            default:
                UISync.Execute(() => btnPlayPause.Text = ">");
                break;
            }
        }
コード例 #11
0
 void Events_StateChanged(object sender, MediaStateChange e)
 {
     this.Dispatcher.BeginInvoke(new Action(delegate
     {
     }));
 }
コード例 #12
0
ファイル: Form1.cs プロジェクト: todatamining/nVLC
 void Events_StateChanged(object sender, MediaStateChange e)
 {
     UISync.Execute(() => label1.Text = e.NewState.ToString());
 }
コード例 #13
0
 void Events_StateChanged(object sender, MediaStateChange e)
 {
 }