The wiki link you mentionned is outdated. This link provides more "up-to-date" info : https://github.com/ZeBobo5/Vlc.DotNet/wiki/Getting-started#vlcdotnetforms
You can also look at this sample to see how it works : https://github.com/ZeBobo5/Vlc.DotNet/tree/develop/src/Samples/Samples.WinForms.Minimal
Regarding authentication, you could use the credentials in the URL, like rtsp://user:pass@.../
, but this is considered a bad practice and will result in a warning.
The new way since VLC 3.0 is to use the libvlc dialog API.
With Vlc.DotNet, you use that by implementing IVlcDialogManager
. You can see an example implementation here (for WPF, but the same logic applies to all platforms): https://github.com/ZeBobo5/Vlc.DotNet/blob/develop/src/Samples/Samples.Wpf.Dialogs/MetroDialogManager.cs
For example, you could do something like:
public class MyDialogManager : IVlcDialogManager
{
public async Task<LoginResult> DisplayLoginAsync(IntPtr userdata, IntPtr dialogId, string title, string text, string username, bool askstore,
CancellationToken cancellationToken)
{
return new LoginResult
{
Username = "username",
Password = "password",
StoreCredentials = false
};
}
public Task DisplayErrorAsync(IntPtr userdata, string title, string text)
{
// You could log errors here, or show them to the user
return Task.CompletedTask;
}
public async Task DisplayProgressAsync(IntPtr userdata, IntPtr dialogId, string title, string text, bool indeterminate, float position,
string cancelButton, CancellationToken cancellationToken)
{
return Task.CompletedTask;
}
public void UpdateProgress(IntPtr userdata, IntPtr dialogId, float position, string text)
{
}
public async Task<QuestionAction?> DisplayQuestionAsync(IntPtr userdata, IntPtr dialogId, string title, string text, DialogQuestionType questionType,
string cancelButton, string action1Button, string action2Button, CancellationToken cancellationToken)
{
return Task.FromResult<QuestionAction?>(null);
}
}
Use it like this:
mediaPlayer.Dialogs.UseDialogManager(new MyDialogManager(this));