Skip to content
Andrew Lambert edited this page May 17, 2019 · 14 revisions

RB-libvlc

This project wraps libvlc, the open-source multimedia library behind VLC Media Player. It is designed and tested on Windows 7 using REALstuio 2011R4.3. Other platforms supported by libvlc should work, but have not been tested.

RB-libvlc under Windows 7

This screen shot depicts the RB-libvlc demo running on Windows 7

Synopsis

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.

To play a media file or stream, create an instance of the Medium class by converting from a URL(as string) or a FolderItem.

Example

 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.

How to incorporate libvlc into your Realbasic/Xojo project

Import the libvlc module

  1. Download the RB-libvlc project either in ZIP archive format or by cloning the repository with your Git client.
  2. Open the RB-libvlc project in REALstudio or Xojo. Open your project in a separate window.
  3. Copy the libvlc module into your project and save.

Ensure the VLC shared libraries are installed

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.

RB-libvlc will raise a PlatformNotSupportedException when used if all required DLLs/SOs/DyLibs are not available at runtime.

Clone this wiki locally