java - Android - Preview video captured with custom camera in VideoView before saving it -


i recording 20 max seconds videos in android app custom camera. preview automatically recorded video before saving (on phone or on server). know have use videoview can't find how.

i stop recording if exceed 20 seconds , launch automatically preview (videoview) or when user stops capture sooner. 2 buttons "delete" , "ok".

anyone knows how it? have create new activity , using intent?

here current code record video :

private boolean preparevideorecorder(){      // 1. open camera          mmediarecorder = new mediarecorder();      // step 1: unlock , set camera mediarecorder     mcamera.unlock();     mmediarecorder.setcamera(mcamera);      // step 2: set sources     mmediarecorder.setaudiosource(mediarecorder.audiosource.camcorder);     mmediarecorder.setvideosource(mediarecorder.videosource.camera);      // step 3: set camcorderprofile     mmediarecorder.setprofile(camcorderprofile.get(camcorderprofile.quality_high));      // step 4: set output file     mmediarecorder.setoutputfile(getoutputmediafile(media_type_video).tostring());     //set video duration 20 seconds max     int clipsduration = 20000;     mmediarecorder.setmaxduration(clipsduration);      // step 5: set preview output     mmediarecorder.setpreviewdisplay(mpreview.getholder().getsurface());      if (currentcameraid == camera.camerainfo.camera_facing_back){         mmediarecorder.setorientationhint(90);     } else {          mmediarecorder.setorientationhint(270);     }      // step 6: prepare configured mediarecorder     try {         mmediarecorder.prepare();     } catch (illegalstateexception e) {         log.d(tag, "illegalstateexception preparing mediarecorder: " + e.getmessage());         releasemediarecorder();         return false;     } catch (ioexception e) {         log.d(tag, "ioexception preparing mediarecorder: " + e.getmessage());         releasemediarecorder();         return false;     }     return true; } 

thank !


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -