vitamio.MediaPlayer не воспроизводит второе видео
Я использую библиотеку vitamio для воспроизведения FLV-видео. Следующее - моя активность VideoWrapper:
public class VideoWrapperActivity extends Activity {
private String videoPath = null;
private VideoView mVideoView;
int chaperPlaying = 0;
MediaController mController;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (!io.vov.vitamio.LibsChecker.checkVitamioLibs(this))
return;
setContentView(R.layout.videoview);
mVideoView = (VideoView) findViewById(R.id.surface_view);
Constants.gotCourse = true;
if (!io.vov.vitamio.LibsChecker.checkVitamioLibs(this))
return;
setContentView(R.layout.videoview);
init();
mVideoView = (VideoView) findViewById(R.id.surface_view);
mVideoView.setVideoPath(videoPath);
mVideoView.setVideoQuality(MediaPlayer.VIDEOQUALITY_HIGH);
mVideoView.setMediaController(new MediaController(this));
mVideoView.setOnCompletionListener(new OnCompletionListener() {
@Override
public void onCompletion(MediaPlayer arg0) {
Log.d(Constants.TAG,"Completed");
Intent returnIntent = new Intent();
setResult(RESULT_CANCELED, returnIntent);
finish();
}
});
}
private void init(){
Bundle extras = getIntent().getExtras();
chaperPlaying = extras.getInt("chaptertoplay",1);
if(extras.getString("videofile").length() >0){
videoPath = extras.getString("videofile");
}
Log.d(Constants.TAG,"Video File: "+videoPath);
Log.d(Constants.TAG,"Current Chapter: "+chaperPlaying);
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
if (mVideoView != null)
mVideoView.setVideoLayout(VideoView.VIDEO_LAYOUT_SCALE, 0);
super.onConfigurationChanged(newConfig);
}
}
Я вызываю это упражнение из моего MovieWrapper Activity, которое обрабатывает воспроизведение видео, тесты и т. Д.
Intent intent = new Intent(MovieWrapperActivity.this, VideoWrapperActivity.class);
intent.putExtra("chaptertoplay", currentChap);
intent.putExtra("videofile", Constants.mCourse.getmChapters().get(currentChap).getVideoURL());
startActivityForResult(intent, MOVIE_WRAPPER);
Первое время Видео воспроизводится правильно. но когда я играю следующее видео, позвонив по вышеуказанному коду. Обе мои действия закрываются и тоже не получают ошибок. ниже мой logcat:
04-18 15:36:05.169: D/HFI(31808): Video File: http://server.com/VC_701_02.flv
04-18 15:36:05.169: D/HFI(31808): Current Chapter: 1
04-18 15:36:05.169: D/HardwareRenderer(31808): Disabling v-sync
04-18 15:36:05.269: W/Adreno200-EGLSUB(31808): SetSwapInterval() interval: 0 not set
04-18 15:36:05.319: I/Vitamio[Player](31808): VPLAYER INIT BEGIN
04-18 15:36:05.319: I/Vitamio[Player](31808): Copyright (c) VOV IO (http://vov.io).
04-18 15:36:05.319: I/Vitamio[Player](31808): THIS SOFTWARE (Vitamio) IS WORK OF VOV IO (http://vov.io)
04-18 15:36:05.319: I/Vitamio[Player](31808): Application package name: uk.org.humanfocus.hfi
04-18 15:36:05.319: D/Vitamio[Player](31808): RENDER RGB
04-18 15:36:05.319: I/Vitamio[Player](31808): VPLAYER INIT END
04-18 15:36:05.319: I/Vitamio[Player](31808): Copyright (c) VOV IO (http://vov.io).
04-18 15:36:05.319: I/Vitamio[Player](31808): THIS SOFTWARE (Vitamio) IS WORK OF VOV IO (http://vov.io)
04-18 15:36:05.319: I/Vitamio[Player](31808): Application package name: uk.org.humanfocus.hfi
04-18 15:36:05.319: D/Vitamio[Player](31808): SURFACE INIT OK
04-18 15:36:05.319: I/Vitamio[Player](31808): Copyright (c) VOV IO (http://vov.io).
04-18 15:36:05.319: I/Vitamio[Player](31808): THIS SOFTWARE (Vitamio) IS WORK OF VOV IO (http://vov.io)
04-18 15:36:05.319: I/Vitamio[Player](31808): Application package name: uk.org.humanfocus.hfi
04-18 15:36:05.319: D/Vitamio[Player](31808): SURFACE INIT OK
04-18 15:36:05.319: D/Vitamio[Player](31808): prepareAsync
04-18 15:36:05.319: I/Vitamio[Player](31808): PREPARE SIG: 0
04-18 15:36:05.329: D/Vitamio[Player](31808): THREAD NOTIFY START
04-18 15:36:05.339: I/Vitamio[Player](31808): THREAD PREPARE START
04-18 15:36:05.339: I/Vitamio[Player](31808): THREAD PREPARE ATTACHED
04-18 15:36:05.339: I/Vitamio[Player](31808): Copyright (c) VOV IO (http://vov.io).
04-18 15:36:05.339: I/Vitamio[Player](31808): THIS SOFTWARE (Vitamio) IS WORK OF VOV IO (http://vov.io)
04-18 15:36:05.349: I/Vitamio[Player](31808): OPEN FILE http://83.170.72.102/content/700_719/VC_701_02.flv
04-18 15:36:05.739: D/Vitamio[Player](31808): pthread_kill 0
04-18 15:36:05.749: I/Vitamio[Player](31808): PREPARE HANDLER 12
04-18 15:36:05.749: I/Vitamio[Player](31808): THREAD PREPARE DETTACHED
04-18 15:36:05.749: D/Vitamio[Player](31808): pthread_join 0
04-18 15:36:05.749: I/Vitamio[Player](31808): FILE CLOSE BEGIN
04-18 15:36:05.749: I/Vitamio[Player](31808): CLOSE AVFORMAT BEGIN
04-18 15:36:05.769: I/Vitamio[Player](31808): CLOSE AVFORMAT END
04-18 15:36:05.769: I/Vitamio[Player](31808): FREE VIDEOPIC BEGIN
04-18 15:36:05.769: I/Vitamio[Player](31808): FREE VIDEOPIC 2 END
04-18 15:36:05.769: I/Vitamio[Player](31808): FREE SUBPIC BEGIN
04-18 15:36:05.769: I/Vitamio[Player](31808): FREE SUBPIC 4 END
04-18 15:36:05.769: I/Vitamio[Player](31808): FREE AUDIOFRAME BEGIN
04-18 15:36:05.769: I/Vitamio[Player](31808): FREE AUDIOFRAME 8 END
04-18 15:36:05.769: I/Vitamio[Player](31808): DELETE GLOBAL REF BEGIN
04-18 15:36:05.769: I/Vitamio[Player](31808): DELETE GLOBAL REF END
04-18 15:36:05.769: I/Vitamio[Player](31808): FILE CLOSE END
04-18 15:36:05.769: I/Vitamio[Player](31808): VPLAYER RELEASE BEGIN
04-18 15:36:05.769: D/Vitamio[Player](31808): THREAD NOTIFY END
04-18 15:36:05.769: I/Vitamio[Player](31808): VPLAYER RELEASE END
04-18 15:36:05.769: A/libc(31808): Fatal signal 11 (SIGSEGV) at 0x00002840 (code=1), thread 31871 (.humanfocus.hfi)
04-18 15:36:05.809: A/libc(31808): Fatal signal 11 (SIGSEGV) at 0x00002814 (code=1), thread 31869 (.humanfocus.hfi)
04-18 15:36:08.359: E/Trace(31904): error opening trace file: No such file or directory (2)
04-18 15:36:08.379: V/ActivityThread(31904): uk.org.humanfocus.hfi white listed for hwui
04-18 15:36:08.959: D/HardwareRenderer(31904): Disabling v-sync
04-18 15:36:08.989: D/HardwareRenderer(31904): Disabling v-sync
04-18 15:36:09.069: D/libEGL(31904): loaded /system/lib/egl/libEGL_adreno200.so
04-18 15:36:09.089: D/libEGL(31904): loaded /system/lib/egl/libGLESv1_CM_adreno200.so
04-18 15:36:09.089: D/libEGL(31904): loaded /system/lib/egl/libGLESv2_adreno200.so
04-18 15:36:09.189: D/OpenGLRenderer(31904): Enabling debug mode 0
2 ответа
При следующем воспроизведении вы должны выпустить видео до просмотра.
У меня та же проблема, когда я сменил кодек, он работает нормально. Пожалуйста, используйте этот кодек Recorder.setVideoCodec(avcodec.AV_CODEC_ID_H264);