leykan
leykan

Reputation: 389

Using LibVLC and Creation of a LibVLC object failed (Android)

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.

Upvotes: 0

Views: 1039

Answers (2)

Payam Mobarraei
Payam Mobarraei

Reputation: 197

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);

Upvotes: 2

liorlis
liorlis

Reputation: 216

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

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

Upvotes: -1

Related Questions