ActiveX AxVLCPlugin2 no event works

1

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.

    
asked by anonymous 17.03.2014 / 19:35

1 answer

1

More interesting in this case would be to use the MediaPlayerPositionChanged event itself to get the current position.

In case, just assign the event handler

vlc.MediaPlayerPositionChanged += vlc_play;

And change the parameter of it, since the class EventArgs does not appear in the delegate definition it refers to:

void vlc_play(object sender, AxAXVLC.DVLCEvents_MediaPlayerPositionChangedEvent e)
{
    MessageBox.Show(Convert.ToString(axVLCPlugin21.input.Position));
}
    
18.03.2014 / 17:46