问题描述
这是我正在使用的代码,但即使在代码中使用 :input-repeat=65535 后也无法循环播放视频。我需要循环播放视频,而无需对 vlc 播放器进行任何更改。
string url = "https://demo.mp4";
int lastIndex = url.LastIndexOf("/");
string Path_1 = url.Substring(lastIndex + 1); //filename
string savePath = @"D:" + Path_1;
WebClient client = new WebClient();
client.DownloadFile(url,savePath);
FileInfo file = new FileInfo(@"D:\Demo\" + Path_1);
var currentDirectory = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
var libDirectory = new DirectoryInfo(Path.Combine(currentDirectory,"libvlc",IntPtr.Size == 4 ? "win-x86" : "win-x64"));
using (var mediaPlayer = new Vlc.DotNet.Core.VlcmediaPlayer(libDirectory))
{
var mediaOptions = new[]
{ ":sout=#gather:rtp{sdp=rtsp://127.0.0.1:8022/test}",":sout-keep",":network-caching = 150",":clock-jitter=0",":clock-synchro=0",":input-repeat=65535"};
mediaPlayer.SetMedia(file,mediaOptions);
mediaPlayer.Play();
Console.WriteLine("Streaming on rtsp://127.0.0.1:8022/test");
Console.WriteLine("Press any key to exit");
Console.ReadKey();
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)