8,735
社区成员
发帖
与我相关
我的任务
分享
sourceProvider.MediaPlayer.EndReached += MediaPlayer_EndReached;
private void MediaPlayer_EndReached(object sender, Vlc.DotNet.Core.VlcMediaPlayerEndReachedEventArgs e)
{
Task.Factory.StartNew(() => {
this.sourceProvider.Dispose();
//this.sourceProvider = null;
Application.Current.Dispatcher.BeginInvoke(new Action(() => {
this.sourceProvider = new VlcVideoSourceProvider(Application.Current.Dispatcher);
this.sourceProvider.CreatePlayer(libDirectory);
sourceProvider.MediaPlayer.Audio.Volume = 0;
this.sourceProvider.MediaPlayer.Play(new FileInfo(AppDomain.CurrentDomain.BaseDirectory + @"\" + PalyFileName2));
sourceProvider.PropertyChanged += SourceProvider_PropertyChanged1;
sourceProvider.MediaPlayer.EndReached += MediaPlayer_EndReached;
sourceProvider.MediaPlayer.VideoOutChanged += MediaPlayer_NewVideoOutChanged;
}));
});
}
myVlcControl.State == Vlc.DotNet.Core.Interops.Signatures.LibVlc.Media.States.Ended
myVlcControl是你的VlcControl实例对象,检测一下在什么地方播放结束,播放下一个就行了,除此之外:
Vlc.DotNet.Core.Interops.Signatures.LibVlc.Media.States.Error播放错误
Vlc.DotNet.Core.Interops.Signatures.LibVlc.Media.States.Playing正在播放
Vlc.DotNet.Core.Interops.Signatures.LibVlc.Media.States.Stopped 停止播放状态
Vlc.DotNet.Core.Interops.Signatures.LibVlc.Media.States.Paused 暂停状态
还有很多你自己看看需要什么,点之后看英文,慢慢摸索吧