Skip to content
Guyb edited this page Feb 9, 2018 · 4 revisions

Welcome to the vlc-android-sdk wiki!

## Example use

// Display surface

private SurfaceView surfaceView;

private SurfaceHolder holder;

// MediaPlayer setup

private MediaPlayer mediaPlayer;

private LibVLC libVLC;

private Surface surface;

private IVLCVout vout;

private Media media;

private String URL_TO_STREAM = "https://example.url:8002/stream"

surfaceView = (SurfaceView) findViewById(R.id.playChannelVideoView);

holder = surfaceView.getHolder();

// Create the player

libVLC = new LibVLC(context, options);

mediaPlayer = new MediaPlayer(libVLC);

//Create the media

media = new Media(libVLC, AndroidUtil.LocationToUri(URL_TO_STREAM));

mediaPlayer.setMedia(media);

// Setup the surface surface = surfaceHolder.getSurface();

vout = mediaPlayer.getVLCVout();

vout.setVideoSurface(surface, surfaceHolder);

vout.attachViews();

mediaPlayer.play();

Clone this wiki locally