kakone/VLC.MediaElement

Using ShowLoginDialog

Closed this issue ยท 3 comments

arc95 commented

Hi @kakone, I need to pass credentials to the video stream that's being opened. I saw this issue, where it talks about listening to ShowLoginDialog and subscribing to it. I'm looking at the sample app and wondering where I would do this. Can you provide an example code of how to do this? Thanks.

It's easy:

public void MediaElement_ShowLoginDialog(object sender, VLC.LoginDialogEventArgs e)
{
e.DialogResult = new VLC.LoginDialogResult();
e.DialogResult.Username = "username";
e.DialogResult.Password = "password";
e.DialogResult.StoreCredentials = true;
}

You can also use a Dialog box and get Inputs from there.

arc95 commented

Thanks, @nograx. Sorry for my beginner question, but is it possible in that handler to prevent the dialog from appearing to the user so we just give the video the necessary credentials seamlessly? Thanks ๐Ÿ‘

The Event is called "ShowLoginDialog", but no dialog will be shown at all. Just use the code above and provide your credentials with Username and Password.