private void 关闭窗口事件(object sender, EventArgs e) { 播放状态 = false; new Task((() => { try { Play_STOP(); //listener.Close(); listener.Dispose(); try { VLCV.MediaPlayer.Dispose(); } catch (Exception) { } try { //不能回收这玩意,回收了最后启动的一个实例就会挂掉,奇了个怪 //_mediaPlayer.Dispose(); } catch (Exception) { } try { _libVLC.Dispose(); } catch (Exception) { } try { VLCV.Dispose(); } catch (Exception) { } //this.VlcControl.SourceProvider.MediaPlayer.Stop();//这里要开线程处理,不然会阻塞播放 } catch (Exception) { } })).Start(); DD.DownIofo.播放状态 = false; 窗口是否打开 = false; }
private void 关闭窗口事件(object sender, EventArgs e) { 播放状态 = false; new Task((() => { try { Play_STOP(); //this.VlcControl.SourceProvider.MediaPlayer.Stop();//这里要开线程处理,不然会阻塞播放 } catch (Exception) { } })).Start(); listener.Close(); listener.Dispose(); DD.DownIofo.播放状态 = false; 窗口是否打开 = false; }