2013-04-18 3 views
0

저는 flv 비디오를 재생할 때 vitamio 라이브러리를 사용하고 있습니다.vitamio.MediaPlayer가 두 번째 비디오를 재생하지 않습니다.

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

1 시간 비디오는 : 나는 다음과 같이 내가 활동을 시작하고 비디오 및 퀴즈 등을 재생 처리하는 내 MovieWrapper 활동에서이 활동을 호출

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

: 다음은 내 VideoWrapper 활동입니다 올바르게 재생. 하지만 위의 코드를 호출하여 다음 비디오를 재생할 때. 내 두 활동 모두 폐쇄되고 오류도 발생하지 않습니다. 다음은 내 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 

답변

0

다음에 재생할 때 videoView 전에 출시해야합니다.

0

잘 작동하는 코덱을 변경했을 때 같은 문제가 발생했습니다. 이 코덱을 사용하십시오. recorder.setVideoCodec (avcodec.AV_CODEC_ID_H264);

관련 문제