i'm trying to control the VLC Media Player from C#. I tried getting a handle on the window with the FindWindow() command from .Net but as i found out the name of the window changes every time a file is played. The biggest problem i have is sending wm_commands to vlc..This approach worked with Winamp and Windows Media Player but with VLC it appears that it won't work.
I read that VLC can be controlled from a browser but i don't whant that...i've seen in it's settings that it has some hot keys that can be called..but they can be changed and if i call them from my code somehow...and the user changes them..bummer...
i'm a little bit stuck..any help would be fantastic... Sorin
Meet VLC media player's most compatible, up-to-date and user-friendly partner—VLC Mobile Remote for Android. VLC Remote is the most convenient way of controlling VLC Player from your smartphones and tablets. No more couch-to-computer workout.
After installation, make sure your phone and computer are on the same network/WiFi, then open the VLC Mobile Remote app on your phone. As soon as you open the app, it will detect and allows you to connect to your computer. Once connected by tapping your computer name, you can control your PC or Mac.
To activate the web interface, click the Tools menu in VLC and select Preferences. Click the All option under Show settings to view VLC's advanced settings. Scroll down in the list of advanced settings and select Main interfaces under the Interface header. Click the Web check box to enable the HTTP interface.
I have some code that is able to control it using sockets on the RC interface. This worked to a degree but has a lot of quirks. go to full screen seems to do nothing for a few seconds after play is invoked. Overall it sort of works.
The other options are:
Write a DirectDraw filter (very hard) but once this is done VLC can be used instead of or in conjunction with FFMPEG. Existing code that drives media player could use vlc.
Write an interop wrapper for libvlc, recently the VLC team split out libvlccore
from libvlc
so to the best of my knowledge all the interop is out of date. Once you write a wrapper you could embed vlc in a windows app. (if you need to support x64 you need to compile these libs under x64.
Look through the VLC code and find out if there is a way to send these windows messages.
EDIT This appears to have come out this week.
As Eoin mentioned, libvlc
can be used to interact with VLC. As a C# user, you may want to try the .NET bindings offered by the libvlc-sharp
project.
Edit: Seems like this project has not been maintained for years. I will leave the link anyway, in case you wish to take a look at it and maybe put some of its source to use.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With