General ActiveX Control Usage Info
Posted: 17 Jan 2006 14:03
After looking around on the forum to see if others were doing interesting things with the VLC ActiveX control, I mostly found a bunch of unanswered questions.
Without too much trouble I managed to use the ActiveX control in Visual Studio.NET 2003 with C#. A lot of people were lost in trying to figure out what the methods/functions were to do even the simplest of things, since there didn't seem to be much obvious documentation, aside from that in the autogenerated code docs.
I know someone had posted a full list of the functions they knew of in order to help others put together a more sensible reference on the ActiveX control. However, it's important to note that you can get a list of public properties, methods and events available from any ActiveX control's embedded DLLs. This is good for any new undocumented features that the VLC ActiveX control may eventually contain, and also good for figuring out how to use any other ActiveX control you may run into (though not a 100% substitute for actual documentation)
One app I know that lets you inspect ActiveX controls is ActiveXXX HardCore, which you can download from Moon Valley Software's site at: http://www.activex.moonvalley.com/samples/activex.zip
As a note, make sure you have the ActiveX control registered, otherwise it won't show up in the list, and there isn't an option to inspect an ActiveX control by browsing for it. You would need it registered anyway before it would show up in Visual Studio if you were planning to drop it into your app.
Luckily you don't have to rely solely on that as there's some VLC ActiveX control documentation on the wiki, http://wiki.videolan.org/index.php/ActiveX
It's important to note that the majority of the public control functions and properties are intended for basic video playing and playlist handling. In order to make use of VLC's more complex and extended features, you can set VLC command line options for each video in the playlist as well as setting variables during play that effect how it's played. You manage this by passing the options as the second parameter of addTarget(), or setting variables with setVariable("variable",value)
Also, with ActiveX controls, don't forget that you can attach eventhandlers for events in order to run your own code. VLC only has 3 events: play, pause and stop, but they're important to know because VLC still responds to features like double-click video to fullscreen and spacebar to play/pause, etc. If you are running statements that work under the assumption the video is playing and you aren't handling the events, then if one of it's built-in key/mouse events occur and the play state changes without you knowing it, your statement could run into a wall and OOPS, program crashes.
Parameter Options List (useful for options that must be set before a video loads)
-- http://wiki.videolan.org/index.php/VLC_ ... -line_help
Some Current State Variables (Search for var_Create)
-- http://trac.videolan.org/vlc/file/trunk/src/libvlc.c
Config/Option Variables (Search for add_int, add_bool, add_string, etc.)
-- http://trac.videolan.org/vlc/file/trunk/src/libvlc.h
Overall, you can make pretty good use of VLC's features without running into too many issues. Hope some of this info is useful.
-Crache
Without too much trouble I managed to use the ActiveX control in Visual Studio.NET 2003 with C#. A lot of people were lost in trying to figure out what the methods/functions were to do even the simplest of things, since there didn't seem to be much obvious documentation, aside from that in the autogenerated code docs.
I know someone had posted a full list of the functions they knew of in order to help others put together a more sensible reference on the ActiveX control. However, it's important to note that you can get a list of public properties, methods and events available from any ActiveX control's embedded DLLs. This is good for any new undocumented features that the VLC ActiveX control may eventually contain, and also good for figuring out how to use any other ActiveX control you may run into (though not a 100% substitute for actual documentation)
One app I know that lets you inspect ActiveX controls is ActiveXXX HardCore, which you can download from Moon Valley Software's site at: http://www.activex.moonvalley.com/samples/activex.zip
As a note, make sure you have the ActiveX control registered, otherwise it won't show up in the list, and there isn't an option to inspect an ActiveX control by browsing for it. You would need it registered anyway before it would show up in Visual Studio if you were planning to drop it into your app.
Luckily you don't have to rely solely on that as there's some VLC ActiveX control documentation on the wiki, http://wiki.videolan.org/index.php/ActiveX
It's important to note that the majority of the public control functions and properties are intended for basic video playing and playlist handling. In order to make use of VLC's more complex and extended features, you can set VLC command line options for each video in the playlist as well as setting variables during play that effect how it's played. You manage this by passing the options as the second parameter of addTarget(), or setting variables with setVariable("variable",value)
Also, with ActiveX controls, don't forget that you can attach eventhandlers for events in order to run your own code. VLC only has 3 events: play, pause and stop, but they're important to know because VLC still responds to features like double-click video to fullscreen and spacebar to play/pause, etc. If you are running statements that work under the assumption the video is playing and you aren't handling the events, then if one of it's built-in key/mouse events occur and the play state changes without you knowing it, your statement could run into a wall and OOPS, program crashes.
Parameter Options List (useful for options that must be set before a video loads)
-- http://wiki.videolan.org/index.php/VLC_ ... -line_help
Some Current State Variables (Search for var_Create)
-- http://trac.videolan.org/vlc/file/trunk/src/libvlc.c
Config/Option Variables (Search for add_int, add_bool, add_string, etc.)
-- http://trac.videolan.org/vlc/file/trunk/src/libvlc.h
Overall, you can make pretty good use of VLC's features without running into too many issues. Hope some of this info is useful.
-Crache