【发布时间】:2021-10-18 13:52:27
【问题描述】:
这个问题参考了我之前的问题Embedding VLC player in WInform Application in .Net Core. Core.Intialize() Giving Exception
我想运行播放器一段时间,在此期间视频应该重复播放。目前的代码看起来像这样......
Core.Initialize();
var libvlc = new LibVLC();
// Make VideoView control
VideoView vv = new VideoView();
vv.MediaPlayer = new MediaPlayer(libvlc);
vv.Dock = DockStyle.Fill;
// Add it to the form
Controls.Add(vv);
var uri = new Uri(@"C:\vid.3gp");
// Use command line options as Options for media playback (https://wiki.videolan.org/VLC_command-line_help/)
var media = new Media(libvlc, uri, ":input-repeat=65535");
vv.MediaPlayer.Play(media);
//Set fullscreen
this.FormBorderStyle = FormBorderStyle.None;
this.Size = Screen.PrimaryScreen.Bounds.Size;
this.Location = Screen.PrimaryScreen.Bounds.Location;
如何在特定时间后关闭播放器。目前,即使我关闭带有播放器视频的表单,也会在后台继续播放,直到我关闭整个应用程序。
只是为了通知这个winform应用程序是在.netcore3.1中创建的。
问候。
【问题讨论】: