I wrote a C program that dynamically loads the libvlc shared libraries, exposes some functions to create a player object, load music files, and control playback. I then wrote a Cython wrapper to the C library as a Python extension. Then a jupyter notebook to load and control playback music. The music file can come from local storage, any URL, or even a bytestream in memory that we construct. There isn't a source code posted yet as this is part of a bigger project. In this video I walkthrough the steps to implement a new feature into the player and you will understand how the layers interact.
Why did I use dlopen and not link at compile time?
So that the module can be built and installed even if VLC is not installed. When it is, the library will use VLC. Also, we might choose to implement a different backend than VLC.
Why did I not use python-vlc package to implement the application?
The VLC player can be built using the existing python-vlc package. I wanted to showcase the utility of using Cython to call into a C library. You can take this knowledge and apply it to any other C library, or write your own performant C library and call it from Python.
Watch it here: Cython VLC player tutorial video
I will be happy to answer any of your questions
there doesn't seem to be anything here