如果他们使用版本1.0.6,一切正常,但我们targetSdkVersion 23会收到错误。在 SDK V 3.0.0 版本中,源代码不起作用。有一个简单的示例,VLC sdk v3?
来自 1.0.6 的代码是工作,而来自 3.0.0 的代码不是工作:
mSurfaceView = (SurfaceView) findViewById(R.id.player_surface);
mSurfaceHolder = mSurfaceView.getHolder();
mSurfaceFrame = (FrameLayout) findViewById(R.id.player_surface_frame);
mMediaUrl = getIntent().getExtras().getString("videoUrl");
try {
mLibVLC = new LibVLC();
mLibVLC.setAout(mLibVLC.AOUT_AUDIOTRACK);
mLibVLC.setVout(mLibVLC.VOUT_ANDROID_SURFACE);
mLibVLC.setHardwareAcceleration(LibVLC.HW_ACCELERATION_FULL);
mLibVLC.setSubtitlesEncoding("");
mLibVLC.setTimeStretching(false);
mLibVLC.setFrameSkip(true);
mLibVLC.setChroma("RV16");
mLibVLC.setVerboseMode(true);
mLibVLC.setAout(-1);
mLibVLC.setDeblocking(0);
mLibVLC.setNetworkCaching(0);
mLibVLC.init(getApplicationContext());
} catch (LibVlcException e){
Log.e(TAG, e.toString());
}
mSurface = mSurfaceHolder.getSurface();
mLibVLC.attachSurface(mSurface, VideoVLCActivity.this);
mLibVLC.playMRL(mMediaUrl);
这里有一个基于 SDK 3.0.0 的示例