void Events_PlayerPositionChanged(object sender, MediaPlayerPositionChanged e) { UISync.Execute(() => trackBar1.Value = (int)(e.NewPosition * 100)); }
private void EventsPlayerPositionChanged(object sender, MediaPlayerPositionChanged e) { Size size = _player.GetVideoSize(0); if (!size.IsEmpty) { _player.Events.PlayerPositionChanged -= EventsPlayerPositionChanged; _player.Events.PlayerEncounteredError -= EventsPlayerEncounteredError; UISync.Execute(() => SetVideoSize(size)); UISync.Execute(StopPlayer); UISync.Execute(() => btnGetStreamSize.Enabled = true); } }
void Events_PlayerPositionChanged(object sender, MediaPlayerPositionChanged e) { this.Dispatcher.BeginInvoke(new Action(delegate { if (!m_isDrag) { slider1.Value = (double)e.NewPosition; } })); }
void EventsPlayerPositionChanged(object sender, MediaPlayerPositionChanged e) { var newpos = (int) (e.NewPosition*100); if (newpos<0) newpos = 0; if (newpos>100) newpos = 100; UISync.Execute(() => vNav.Value = newpos); if (_needsSize) { Size sz = _mPlayer.GetVideoSize(0); if (sz.Width > 0) { if (sz.Width < 320) sz.Width = 320; if (sz.Height < 240) sz.Height = 240; if (Width != sz.Width) UISync.Execute(() => Width = sz.Width); if (Height != sz.Height + tableLayoutPanel1.Height) UISync.Execute(() => Height = sz.Height + tableLayoutPanel1.Height); _needsSize = false; } } }
private void Events_PlayerPositionChanged(object sender, MediaPlayerPositionChanged e) { this.Dispatcher.BeginInvoke(new Action(delegate { process.Value = (double) e.NewPosition*100; })); }