android - vitamio.MediaPlayer not playing 2nd video -
i using vitamio library playing flv videos. following videowrapper activity:
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); } }
i call activity moviewrapper activity handling playing videos , quizes etc. starting activity following:
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);
1st time video playing correctly. when play next video calling above code. both activities being closed , getting no error well. following 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): software (vitamio) 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): software (vitamio) 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): software (vitamio) 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): software (vitamio) 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) @ 0x00002840 (code=1), thread 31871 (.humanfocus.hfi) 04-18 15:36:05.809: a/libc(31808): fatal signal 11 (sigsegv) @ 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 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
when playback next, should release before videoview.
Comments
Post a Comment