--repeat comand在Vlc.DotNet.WPF中不起作用

问题描述

我正在尝试从服务器中检索rtsp流,并且当我断开vlc的连接(发送Teardown请求后)时,我希望vlc重新连接。 从控制台(vlc --repeat --rtsp-tcp rtsp://ip:port)运行时,一切正常。但是,从wpf应用程序运行时,--repeat命令不起作用。

var libDirectory = new DirectoryInfo(Path.Combine(currentDirectory,"libvlc",IntPtr.Size == 4 ? "win-x86" : "win-x64"));

this.VlcControl.sourceProvider.CreatePlayer(libDirectory,new string[] { "--rtsp-tcp","--repeat" });

string liveLink = $"rtsp://{ip}:{port}/{kid}";

this.VlcControl.sourceProvider.MediaPlayer.Play(liveLink);

已经尝试使用命令--loop--insert-repeat=65535

什么都没有。

有人可以提出解决方案吗?

解决方法

    // Declare a Delegate
    delegate void delegate_vlc_play(Uri file,string[] pars); 

    // Make sure to link the Event
    private void OnEndReached(object sender,Vlc.DotNet.Core.VlcMediaPlayerEndReachedEventArgs e)
    {

        if (_AutoLoop) // private field of externally visible Property "AutoLoop"
        {
            // Get a new instance of the delegate
            delegate_vlc_play del_vlc = new delegate_vlc_play(myVLCControl.Play);
            // Call asyncroneously (save _CurrentFile somewhere when you call the Play() in the first place)
            del_vlc.BeginInvoke(new Uri(_CurrentFile),new string[] { },null,null);
        }

    }

来自https://github.com/ZeBobo5/Vlc.DotNet/issues/96

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...