I have a VLC Player in my form. In it, I need to get basic information like video duration and current position. but no event works.
Am I doing something wrong? Here is the code:
public Form1()
{
InitializeComponent();
vlc.play += vlc_play;
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "AVI (*.avi)|*.avi|MP4|*.mp4"; //Definindo o filtro (extensões dos vídeos pelos quais o OpenFileDialog buscará).
if (ofd.ShowDialog() == DialogResult.OK) //Teste para verificar se o arquivo foi selecionado.
{
//MessageBox.Show(ofd.FileName);
vlc.playlist.items.clear();
vlc.playlist.add(new Uri(ofd.FileName).AbsoluteUri); //Adicionando vídeo à playlist.
vlc.playlist.play();
}
}
void vlc_play(object sender, EventArgs e)
{
MessageBox.Show(Convert.ToString(vlc.input.Position));
}
My solution, unfortunately, is to use a timer to get information.