java - VLCJ Can' t open audio streaming using http on client-side -


I am using VLCJ to stream audio between a server and the client. Once server-side runs as a set of all, I can only open the stream using VLC and I am able to hear any file that I have selected on the server. However, on the client-side, I am doing the following:

  string url = "http://127.0.0.1:" 555 "; MediaPlayerFactory mediaPlayerFactory = New MediaPlayerFactory (); Headless Media Player MediaPlayer = MediaplayfactineNeheldless Media Player (); mediaPlayer.startMedia (url);   

But no sound is available at all. If I vlc http://127.0.0.1/ 555 in the terminal, it opens the VLC and runs back to the music track which can be any problem Or without the server being streamed.

Recently, I came to know that the problem is with the path. Using System.out.println (mediaPlayer.mrl ()) ; indicates that this is opening the file: ///home/user/workspace/audioProject/http%3A//127.0.0.1.13A 5555 MRL directly from the HTML address Instead ( http://127.0.0.155555 ).

, this shows an example how the customer opens a stream.

What's wrong with me Any guess about what I am doing? And what's the solution?

Thanks in advance!

The version of VLC you are using is incompatible with the VLCJ version you are using.

There are two ways to set media, a "local" file is set to media, and the other is "location" - essentially a URL: < pre- libvlc_media_new_location (example, media); libvlc_media_new_path (e.g., media);

In previous versions of VLC, using one of these functions to set up the media It is possible to do it, whether it is a local file based media or a URL, a function, libvlc_media_new_path will work for both types of media.

It has changed with the recent version of VLC (I do not remember what version this version was).

At that time, due to this change in VLC, VLCJ was changed to estimate the type of media (file or URL) and the proper Libil function was called.

So, the solution is to use a compatible version of VLC / VLCJ The change in VLCJ was version 2.2.0, but of course I advise you to use the latest version of VLCJ which is 3.0.1 at the time of writing.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -