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
- Play any media type supported by VLC.
- Transcode one media format to another.
- Embed video output in any window, container, or control.
- Works in console applications (video output will display in a window).
- 64-bit ready.
- Read and write media metadata (IDv3 tags, etc.)
- Open, create, play, and save playlists.
- Sound equalization controls.
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.
- Download the RB-libvlc project either in ZIP archive format or by cloning the repository with your Git client.
- Open the RB-libvlc project in REALstudio or Xojo. Open your project in a separate window.
- Copy the libvlc module into your project and save.
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.