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.

leykan
  • 389
  • 2
  • 4
  • 24
  • There are no logcat output on Android Studio but i'm gona search if there are logcat on my smartphone – leykan Jun 16 '15 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. – shkschneider Jun 16 '15 at 12:34
  • 1
    Check [here](http://stackoverflow.com/questions/16817566/logcat-is-gone-on-android-studio). – takendarkk Jun 16 '15 at 12:35
  • @Takendarkk No vlc_logcat or vlc_crash... – leykan Jun 16 '15 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 – leykan Jun 16 '15 at 12:40

2 Answers2

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);
Payam Mobarraei
  • 197
  • 1
  • 8
-1

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

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

liorlis
  • 216
  • 3
  • 14
  • 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 – leykan Jun 16 '15 at 12:46