0

I am working on a Android project and I want to creat a media player using the LibVLC. To creat a media player with this lib I need to instantiate a LibVLC object. But when I try to do that the instantiation will failed and the app will close automatically.

Here is where I creat a LibVLC object :

public class MediaPlayerActivity extends Activity  {

private static final String TAG = "MediaPlayerDemo";
private int mVideoWidth;
private int mVideoHeight;
private MediaPlayer mMediaPlayer;
private SurfaceView mPreview;
private SurfaceHolder holder;
private String path;
private Bundle extras;
private static final String MEDIA = "media";
private boolean mIsVideoSizeKnown = false;
private boolean mIsVideoReadyToBePlayed = false;


   @Override
   public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        setContentView(R.layout.row);

        LibVLC lib = new LibVLC();
       // path = (String) getIntent().getSerializableExtra("path");
   }
}

I am using the LibVLC get on the master branch. So I don't understand why it failed.

5
  • There are no logcat output on Android Studio but i'm gona search if there are logcat on my smartphone Commented Jun 16, 2015 at 12:33
  • @leykan we just ask for any error log/error... Android Studio should complain and tell you something if "it fails" as you say. Commented Jun 16, 2015 at 12:34
  • 1
    Check here. Commented Jun 16, 2015 at 12:35
  • @Takendarkk No vlc_logcat or vlc_crash... Commented Jun 16, 2015 at 12:36
  • @Takendarkk Well yes there are normal logcat but when I click on the button that load the MediaPlayerActivity and so creat the LibVLC object, the logcat is clean I don't know why Commented Jun 16, 2015 at 12:40

2 Answers 2

2

you should do this to make new object of LibVLC

LibVLC libvlc = LibVLC.getInstance();
libvlc.setHardwareAcceleration(LibVLC.HW_ACCELERATION_FULL);
libvlc.eventVideoPlayerActivityCreated(true);
libvlc.setSubtitlesEncoding("");
libvlc.setAout(LibVLC.AOUT_OPENSLES);
libvlc.setTimeStretching(true);
libvlc.setChroma("RV32");
libvlc.setVerboseMode(true);
Sign up to request clarification or add additional context in comments.

Comments

-1

Try to check if some of the requirements here are missing Hopefully it will assist you .

https://bitbucket.org/edwardcw/libvlc-android-sample

1 Comment

No everithing is good, and I have build vlc-android and it works on my phone, but when I try to re-creat a LibVLC object it failed

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.