goober10 Posted May 8, 2008 Posted May 8, 2008 Does anyone know how I can place a VLC player within a GUI of a program. I can do this with Windows Media Player, however, I would prefer VLC simply because it is more universal with file formats. Thanks A Bunch!
ptrex Posted May 9, 2008 Posted May 9, 2008 @ I did give it a try sometime ago, but not got very far. This will give you a startingpoint. expandcollapse popupopt("GUIOnEventMode", 1) #include <GUIConstantsEX.au3> #include <WindowsConstants.au3> #include <ButtonConstants.au3> ;VLCPlaylistMode Const $VLCPlayListInsert = 1 Const $VLCPlayListInsertAndGo = 9 Const $VLCPlayListReplace = 2 Const $VLCPlayListReplaceAndGo = 10 Const $VLCPlayListAppend = 4 Const $VLCPlayListAppendAndGo = 12 Const $VLCPlayListCheckInsert = 16 ; Initialize error handler $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") ; ---------------------------------- Declare objects ------------------------------- $oVLC = ObjCreate("VideoLAN.VLCPlugin") ; Default to version less Object With $oVLC .AutoLoop = 0 ;False .AutoPlay = 0 ;False .MRL = "" .Visible = -1 ;True .Volume = 50 EndWith ; -------------------------------------------- Main Gui --------------------------------- $hGui = GuiCreate("VLC Viewer", 802, 590,-1, -1, Bitor($WS_SYSMENU, $WS_VISIBLE)) GUISetOnEvent($GUI_EVENT_CLOSE, "GUIeventClose") $oVLC_Object = GUICtrlCreateObj ($oVLC, 10, 70 , @DesktopWidth-60 , 660) GUICtrlSetStyle ( $oVLC_Object, $WS_VISIBLE ) ;GUICtrlSetResizing ($oVLC_Object,$GUI_DOCKAUTO) ; $GUI_DOCKAUTO Auto Resize Object GuiSetState() While 1 Sleep(100) WEnd Func GUIeventClose() Exit EndFunc ;==>GUIeventClose ;This is custom error handler Func MyErrFunc() $HexNumber=hex($oMyError.number,8) Msgbox(0,"AutoItCOM Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & $HexNumber & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) SetError(1) ; to check for after this function returns Endfunc regards ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New
goober10 Posted May 10, 2008 Author Posted May 10, 2008 @ I did give it a try sometime ago, but not got very far. This will give you a startingpoint. expandcollapse popupopt("GUIOnEventMode", 1) #include <GUIConstantsEX.au3> #include <WindowsConstants.au3> #include <ButtonConstants.au3> ;VLCPlaylistMode Const $VLCPlayListInsert = 1 Const $VLCPlayListInsertAndGo = 9 Const $VLCPlayListReplace = 2 Const $VLCPlayListReplaceAndGo = 10 Const $VLCPlayListAppend = 4 Const $VLCPlayListAppendAndGo = 12 Const $VLCPlayListCheckInsert = 16 ; Initialize error handler $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") ; ---------------------------------- Declare objects ------------------------------- $oVLC = ObjCreate("VideoLAN.VLCPlugin") ; Default to version less Object With $oVLC .AutoLoop = 0 ;False .AutoPlay = 0 ;False .MRL = "" .Visible = -1 ;True .Volume = 50 EndWith ; -------------------------------------------- Main Gui --------------------------------- $hGui = GuiCreate("VLC Viewer", 802, 590,-1, -1, Bitor($WS_SYSMENU, $WS_VISIBLE)) GUISetOnEvent($GUI_EVENT_CLOSE, "GUIeventClose") $oVLC_Object = GUICtrlCreateObj ($oVLC, 10, 70 , @DesktopWidth-60 , 660) GUICtrlSetStyle ( $oVLC_Object, $WS_VISIBLE ) ;GUICtrlSetResizing ($oVLC_Object,$GUI_DOCKAUTO) ; $GUI_DOCKAUTO Auto Resize Object GuiSetState() While 1 Sleep(100) WEnd Func GUIeventClose() Exit EndFunc ;==>GUIeventClose ;This is custom error handler Func MyErrFunc() $HexNumber=hex($oMyError.number,8) Msgbox(0,"AutoItCOM Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & $HexNumber & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) SetError(1) ; to check for after this function returns Endfunc regards ptrex DUDE! That is awesome, works perfectly. You are the man!
MaximusCZ Posted January 8, 2019 Posted January 8, 2019 Sory for reviving old topics, but after hours of googling I cant get it. When I try to run the code, I get "Invalid class string", err.number is 800401F3, script line 20 $oVLC = ObjCreate("VideoLAN.VLCPlugin") ; Default to version less Object I tried to google new way, only found "VideoLAN.VLCPlugin.1", which is not working either, and then point to direction of using "autoitObject.au3" and "_autoitobject_createobjectex()", which I dont understand, isnt working out of the box (requires more parameters) and would likely break rest of the script above. Can anyone please enlighten me how to create an vlc object these days?
water Posted January 8, 2019 Posted January 8, 2019 This thread is > 10 years old. A lot has changed since in VLC and AutoIt. I wouldn't expect this old code to work. Did you have a look at the VLC UDFs described in the wiki? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
MaximusCZ Posted January 9, 2019 Posted January 9, 2019 (edited) I must have missed the UDF. The second one uses same COM object as I have problems with, the first one is giving me error when I try to "_IEDocWriteHTML($oIE, $html)" error: _GUICtrlVLC_Create failed. The most likely cause is that you dont have VLC installed. Make sure VLC, and the ActiveX component, is installed. I just downloaded VLC and made a fresh install to make sure all is up to date. I have no idea how to check if ActiveX is installed, those are the waters I never stumbled upon. I tried to check inside VLC for plugins (no trace of ActiveX installed nor not), tried to google checks if I have ActiveX installed, but to no avail. When I set GUISetState(@SW_SHOW) right after GUI is created, I can see it creates IE page OK and navigate to about:blank (even some random site loads ok), but when the "write html" function triggers I see only black cross in a box (failed activex?). Is ActiveX one plugin, or is it class of plugins and I need to have VLCs one speciffically? How can I make sure I have it running, or that its enabled? How can I enable it if I do not? Ah, I needed to install 64 bit version, now the installator asks if to install activeX too Ah, And when I selected to compile au3 script in 64 bit it works! finally seeing yellow white cone in embeded window. Thanks! Edited January 9, 2019 by MaximusCZ
water Posted January 9, 2019 Posted January 9, 2019 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now