I write a simple exampe app for testing vlc,but can only hear the sound,my code looks like this:
Code: Select all
public class MainActivity extends ActionBarActivity implements IVideoPlayer{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.player);
setVolumeControlStream(AudioManager.STREAM_MUSIC);
v=getLibVlcInstance(ctxt);
attachsurface();
v.eventVideoPlayerActivityCreated(true);
loadMedia();
}
void attachsurface(){
mSurface = (SurfaceView)findViewById(R.id.player_surface);
mSurfaceHolder = mSurface.getHolder();
String chroma = set().getString("chroma_format", "");
if (LibVlcUtil.isGingerbreadOrLater() && chroma.equals("YV12")) {
mSurfaceHolder.setFormat(ImageFormat.YV12);
} else if (chroma.equals("RV16")) {
mSurfaceHolder.setFormat(PixelFormat.RGB_565);
} else {
mSurfaceHolder.setFormat(PixelFormat.RGBX_8888);
}
mSurfaceHolder.addCallback(mSurfaceCallback);
}