//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 { } }
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()); } }
/// <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); } }
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); } } }
void EventsStateChanged(object sender, MediaStateChange e) { switch (e.NewState) { case MediaState.Ended: case MediaState.Stopped: case MediaState.Error: _abort?.Set(); break; } }
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; } }
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; } } }
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; } }
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; } }
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; } }
void Events_StateChanged(object sender, MediaStateChange e) { this.Dispatcher.BeginInvoke(new Action(delegate { })); }
void Events_StateChanged(object sender, MediaStateChange e) { UISync.Execute(() => label1.Text = e.NewState.ToString()); }
void Events_StateChanged(object sender, MediaStateChange e) { }