ActiveX events no longer firing in VLC 2.2.1

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
teambailey
New Cone
New Cone
Posts: 3
Joined: 09 Mar 2015 19:29

ActiveX events no longer firing in VLC 2.2.1

Postby teambailey » 11 Aug 2015 23:57

In VLC 2.2.1 using C# WinForms, the ActiveX (AxAXVLC.AxVLCPlugin2) events (like MediaPlayerTimeChanged and MediaPlayerEndReached) are no longer firing during video playback. I have seen conflicting information on the web about the fact that either these events are no longer supported by-design or that these events are supported using a new interface (i.e. as per https://wiki.videolan.org/Documentation:WebPlugin/). I have also seen some posts that say that the previously mentioned wiki page is out of date and not correct. (In C# I have not been able to discover the new-style interface methods mentioned in the wiki article.)

Can anyone say definitively whether the ActiveX events are still supported in 2.2.1 and if so, how does one properly register a handler for them? THANKS!

da2424
Cone that earned his stripes
Cone that earned his stripes
Posts: 310
Joined: 16 Apr 2013 16:57

Re: ActiveX events no longer firing in VLC 2.2.1

Postby da2424 » 14 Aug 2015 18:53

Can anyone say definitively whether the ActiveX events are still supported in 2.2.1 and if so, how does one properly register a handler for them? THANKS!
Yes, they are still supported. Only Internet Explorer 11 has problems with ActiveX events.
Here are instructions for VB/C# to create an event handler: ​https://msdn.microsoft.com/en-us/librar ... 71%29.aspx

(In C# I have not been able to discover the new-style interface methods mentioned in the wiki article.)
Try this (tested in Visual Studio 2010 and 2013):
-> Right click in the Toolbox -> click "Choose Items..."
-> Go to "COM Components"
-> Check "VideoLAN VLC ActiveX Plugin v2" (Caution: Use v2.2.2 nightly. v2.2.1 and some earlier versions returns an error message.)
-> Now there is a new entry for the VLC plugin in the Toolbox, which you can drag & drop to your form1.
-> Now you can access to all methods, properties and events.

I have also seen some posts that say that the previously mentioned wiki page is out of date and not correct.
For a few months, the wiki page should be up to date.

teambailey
New Cone
New Cone
Posts: 3
Joined: 09 Mar 2015 19:29

Re: ActiveX events no longer firing in VLC 2.2.1

Postby teambailey » 14 Aug 2015 19:21

Good news and bad news too. Thought I'd update this thread with additional information on the issue.

Using the nightly named "vlc-2.2.0-20150813-0202", I was able to prove that this version (2.2.2) does work and the events fire as expected. I reproduced this success in C# using a bare bones WinForms sample app that only includes the below code statements: // note: some statements not included that relate to adding the control to the parent form, etc. //

AxAXVLC.AxVLCPlugin2 vlc = new AxAXVLC.AxVLCPlugin2();
vlc.Enabled = true;
vlc.Location = new System.Drawing.Point(48, 41);
vlc.Name = "vlc";
vlc.Size = new System.Drawing.Size(735, 550);
vlc.TabIndex = 0;
vlc.MediaPlayerEndReached += new System.EventHandler(vlc_MediaPlayerEndReached);
vlc.MediaPlayerTimeChanged += new AxAXVLC.DVLCEvents_MediaPlayerTimeChangedEventHandler(vlc_MediaPlayerTimeChanged);
vlc.playlist.add(@"file:///" + @"C:\whatever\myVideoFile.mp4");
vlc.playlist.playItem(0);

However, I have another more complicated WinForms C# application when running against this same nightly (vlc-2.2.0-20150813-0202) that:
1) contains two different instances of the VLC ActiveX control on the same parent container form
2) sets additional properties on the ActiveX control (in addition to the ones in the code snipet above...like those that control audio, play speed, options-string, etc)
3) registers additional events other than just the MediaPlayerEndReached and MediaPlayerTimeChanged events
...and...
4) reproduces the bug (i.e. events not being fired at runtime while the video playback is in progress)

I plan to invest additional time in the short term to incrementally mold the above simple code snipet (that works) into the same logic in use in the more complicated WinForms application (that does not work) to see if I can determine what is introduced to cause the bug scenario to occur.


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 17 guests