Question

I know that i can play music with path with vlcj with this code :

    AudioPlayer.getMediaPlayer().playMedia(path)

but it want to know if i can play blob(or binaryfile) file with vlcj ?

Was it helpful?

Solution

This can not be done with vlcj as the required functionality simply does not exist in LibVLC.

What you want is usually achieved by using the VLC imem plugin, but this plugin is not exposed by LibVLC.

There have been attempts to patch VLC to expose imem (at least the "access" aspect of it), but they were not so far acceptable.

Even if it were possible there would be limitations. If you want to play from an InputStream, you can't seek (at least not usefully) - in fact you can't properly seek a Java InputStream generally anyway. That leaves using something like RandomAccessFile if you want to seek, but if you are going to use RandomAccessFile that implies you have access to a local file anyway, so you would just play the file normally. But that's all moot.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top