Using ShowLoginDialog
Closed this issue ยท 3 comments
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.
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.