This UDF is a continuation of the outdated work done by j_stam_84 back in 2006. Here is a link to his topic -> VLC Media Player. That UDF utilises an older version of the VLC ActiveX object that is no longer supported in versions of VLC greater than 0.8.5. My UDF works with the current version of VLC at the time of writing this topic (version 1.0.5).
There have been many attempts to create VLC controls for AutoIT, and have them embed successfully in AutoIT GUIs. The biggest issue has been that the VLC ActiveX object doesn't seem to work if created in an AutoIT GUI using the GUICtrlCreateObj function. The Help page on GUICtrlCreateObj also states "Not every (ActiveX) control can be embedded (inside an AutoIT GUI).".
So far j_stam_84 seems to have been the only person in the forums to go the path of creating the VLC ActiveX object within an embedded Webbrowser object. This approach works with AutoIT, and is the reason for the success of this UDF.
The main reason I created this UDF was to provide users with a free video playback solution for their AutoIT GUIs that supports the maximum number of codecs possible. VLC player has been well known for some time for it's support and compatibility with a wide range of video formats. Media Player Classic is also a popular choice of video player for the same reasons, though it unfortunately doesn't provide an ActiveX or COM object for use in an AutoIT GUI. Other media player UDFs exist, such as Windows Media Player UDFs, though I still favour the performance and better support of codecs that VLC player provides.
The example below also remembers the video that was playing when the example is closed, so that next time the script is run, the same video is automatically played.
- AutoIt3 3.2 or higher
- A VLC version greater than 0.8.5 installed
_GUICtrlVLC_Create($left, $top, $width, $height)
_VLCErrorHandlerRegister($s_functionName = "__VLCInternalErrorHandler")
The following example demonstrates how the VLC UDF can be used to create an embedded video player in an AutoIT GUI. On running the script, the user may select a video to play, whereupon playback will commence immediately. Using the keyboard or GUI buttons, the user may skip forward and backward through the video (using the arrow keys), and pause and unpause playback (spacebar), all in realtime. Whilst the video is paused, the Rewind and FForward functions also work. A progress slider always indicates the playback position of the video, and the user may drag the slider anytime to a different location in the video. The video will automatically loop back to the start if it reaches the end.
VLC UDF Example.au3 6.93KB 2761 downloads
Latest Version - v0.3 (17/05/10)
VLC.au3 18.24KB 2882 downloads
Edited by seangriffin, 21 May 2010 - 10:59 PM.