protected void OnButtonPlayClicked(object sender, System.EventArgs e) { if (_play != null) { _play.Stop(); } int handle = (int)this.drawingareaVideo.Handle; if (System.IO.File.Exists(VideoPath) == false) { throw new System.IO.FileNotFoundException("File not found", VideoPath); } _play = new MPlayer(handle, MplayerBackends.GL, MPlayerPath); _play.Play(VideoPath); }
public void Play(string file) { if (!_canPlay) { return; } Console.WriteLine("======================="); Console.WriteLine($"播放{file}"); _mPlayer.Play(file); Console.WriteLine("======================="); Console.WriteLine($"音量{_config.Volume}"); _mPlayer.Volume(_config.Volume); Console.WriteLine("======================="); Console.WriteLine($"位置{_config.CurrentPosition}"); _mPlayer.MovePosition(_config.CurrentPosition); Console.WriteLine("======================="); Console.WriteLine("全屏"); _mPlayer.FullScreen = true; }
private void buttonPlay_Click(object sender, EventArgs e) { if (_play != null) { _play.Stop(); } int handle = (int)this.panelVideo.Handle; if (System.IO.File.Exists(MPlayerPath) == false) { throw new System.IO.FileNotFoundException("File not found", MPlayerPath); } if (System.IO.File.Exists(VideoPath) == false && VideoPath.StartsWith("http") == false) { throw new System.IO.FileNotFoundException("File not found", VideoPath); } _play = new MPlayer(handle, MplayerBackends.Direct3D, MPlayerPath); _play.Play(VideoPath); }
private void buttonPlay_Click(object sender, RoutedEventArgs e) { if (_play != null) { _play.Stop(); } int handle = (int)this.windowsFormsHost1.Handle; if (System.IO.File.Exists(MPlayerPath) == false) { throw new System.IO.FileNotFoundException("File not found", MPlayerPath); } if (System.IO.File.Exists(VideoPath) == false) { throw new System.IO.FileNotFoundException("File not found", VideoPath); } _play = new MPlayer(handle, MplayerBackends.Direct3D, MPlayerPath); _play.Play(VideoPath); }