Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method LoadWithOptions() constantly ignore options #267

Open
M0n7y5 opened this issue Apr 5, 2018 · 2 comments
Open

Method LoadWithOptions() constantly ignore options #267

M0n7y5 opened this issue Apr 5, 2018 · 2 comments

Comments

@M0n7y5
Copy link

M0n7y5 commented Apr 5, 2018

I have one problem ... When i try load media with custom options via method LoadMediaWithOptions(url, options) it completely ignore options no matter what values it has ...

I am trying play RTSP stream with --network-caching=SOMEVALUE option and during runtime i want change SOMEVALUE and restart stream with changed options, but it doesn't work :(

@saM21785
Copy link

saM21785 commented Apr 7, 2018

I have the same problem when i want to record and set the network-caching at the same time. Setting one option work but not multiple options..

@ghost
Copy link

ghost commented May 25, 2018

For those interested, here is my workaround:

public class VlcPlayerExt : VlcPlayer
{
    public VlcPlayerExt()
    {
    }

    public new void LoadMediaWithOptions(string url, params string[] options)
    {
        VlcMediaPlayer.Media?.Dispose();
        VlcMediaPlayer.Media = VlcMediaPlayer.VlcInstance.CreateMediaFromLocation(url);
        if (options != null)
        {
            foreach (var option in options)
            {
                if (string.IsNullOrEmpty(option)) continue;

                VlcMediaPlayer.Media.AddOption(option);
            }
        }

        VlcMediaPlayer.Media.ParseAsync();
    }

    public new void LoadMediaWithOptions(Uri uri, params string[] options)
    {
        LoadMediaWithOptions(uri.ToString(), options);
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants