Page 1 of 1

libVLC and android

Posted: 15 Feb 2020 14:10
by mckn
Hello,

I am trying to integrate libVLC in my android application but I can't get the video to be displayed properly.
I don't get any errors in the logs and the video is being played as in the attached video below.

Logfile:
[url]https://pastebin.com/raw/czCZ03hE[/url]

Video example:
[url]https://imgur.com/7Rr3aNf[/url]

I am basically doing this:

Code: Select all

ArrayList<String> args = new ArrayList<>(); args.add("-vvv"); args.add("--http-reconnect"); LibVLC libVLC = new LibVLC(context, args); MediaPlayer player = new MediaPlayer(libVLC); SurfaceTexture texture = textureEntry.surfaceTexture(); IVLCVout videoOut = player.getVLCVout(); videoOut.setVideoSurface(texture); videoOut.attachViews(); Media media = new Media(libVLC, uri); player.setMedia(media); mediaPlayer.play();

Any ideas on how to make this work properly?
Thanks in advance!

Re: libVLC and android

Posted: 15 Feb 2020 19:11
by someusername
works for me

~
VLCVideoLayout vlcVideoLayout = //findViewById VLCVideoLayout

MediaPlayer mediaPlayer = new MediaPlayer(new Media(new LibVLC(context, args), /*url path etc*/ ));

mediaPlayer.attachViews(vlcVideoLayout, null, false, false);
mediaPlayer.play();