libvlc is the open-source multimedia library that powers VLC Media Player. RB-libvlc is libvlc binding for Realbasic and Xojo ("classic" framework) projects.
This screen shot depicts the RB-libvlc demo running on Windows 10
If you use this code in a commercial project, or just want to show your appreciation, please consider sponsoring me through GitHub. https://github.com/sponsors/charonn0
There are two main modes of operation: using the VLCPlayer class to play media without a GUI and the VLCMediaPlayer which provides a GUI. libvlc also supports playlists through a separate PlayList interface.
Object Class | Comment |
---|---|
VLCPlayer |
A media player session. |
VLCMediaPlayer |
A media player session embedded in a Canvas control. |
Medium |
A media resource such as a file or internet stream. |
Equalizer |
An audio equalizer. |
PlayList |
A list of Medium objects. |
ListPlayer |
A specialized player for playing PlayLists . |
To play a media file or stream, create an instance of the Medium class by converting from a URL(as string) or a FolderItem.
Dim vlc As New VLCPlayer
vlc.Media = GetFolderItem("C:\example\music.mp3")
vlc.Play()
Playback occurs asynchronously on a separate preemptive thread. You can determine the player state by querying the CurrentState property and/or by handling the ChangedState event.
Most systems do not have VLC (or libvlc) installed by default. You will need to ship the all the necessary files with your application. On Windows, these are libvlc.dll
, libvlccore.dll
, and the desired plugins in the plugins
directory. For macOS refer to this forum thread for how to properly bundle the dylibs with your app.
RB-libvlc will raise a PlatformNotSupportedException when used if all required DLLs/SOs/DyLibs are not available at runtime.