I do not think that you are doing something wrong. It seems; these events were not implemented (or not implemented) for any reason (even in the latest version of ActiveX). I read that these events are either too distorted or not triggered at all in some versions of browser plug-ins.
However, he still has 3 useful and working events that you can count on.
Event Burning: playEvent , pauseEvent and stopEvent
No Shooting Events: All events starting with MediaPlayer ...
In any case, the code below works with the events I mentioned:
AxVLCPlugin vlc; public MainWindow() { InitializeComponent(); vlc = new AxVLCPlugin(); windowsFormsHost1.Child = vlc; vlc.pauseEvent += new EventHandler(vlc_pauseEvent); vlc.playEvent += new EventHandler(vlc_playEvent); vlc.stopEvent += new EventHandler(vlc_stopEvent); } void vlc_playEvent(object sender, EventArgs e) { Debug.WriteLine("playEvent fired!"); } void vlc_pauseEvent(object sender, EventArgs e) { Debug.WriteLine("pauseEvent fired!"); } void vlc_stopEvent(object sender, EventArgs e) { Debug.WriteLine("stopEvent fired!"); } private void button1_Click(object sender, RoutedEventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); ofd.ShowDialog(); if (ofd.FileName != "") { Debug.WriteLine(ofd.FileName); vlc.addTarget("file:///" + ofd.FileName, null, AXVLC.VLCPlaylistMode.VLCPlayListReplaceAndGo, 0); vlc.play(); } }
However, these events do not inform you of any streaming errors. IMO, only you can do it; try-catch where you execute vlc.addTarget(...) and vlc.play() . Check if the URL is valid (also remember to include the "file:///" infront of the file path with the latest versions of the plugin). And reapply videoURL (as you like) only if the caught error is not related to a nonexistent file or an invalid path, etc.
OR , you can try other shells / user libraries:
Onur yıldırım
source share