android - how to share recorded video to social media -


i new in android developer.i recorded video , store in sd card problem when record current video after click on ok button video share social media. here open social media not send record video social media.please check below code

       submit.setonclicklistener(new view.onclicklistener() {         @override         public void onclick(view v) {              intent camera_intent=new intent(mediastore.action_video_capture);             file video_file=getfilepath();              video_uri= uri.fromfile(video_file);             camera_intent.putextra(mediastore.extra_output, video_uri);             camera_intent.putextra(mediastore.extra_video_quality,1);             startactivityforresult(camera_intent,video_request_code);            // log.e("video_uri",video_uri);         }     });   public file getfilepath(){     file folder = new file("sdcard/video_app");     if(!folder.exists()){         folder.mkdir();                 }     file video_file = new file(folder,"sample_video.mp4");     return video_file; } 

and in onactivity result

if(resultcode==result_ok){ intent sharingintent = new intent(intent.action_send);   //uri screenshoturi = uri.parse(mediastore.action_video_capture); file video_file=getfilepath(); video_uri= uri.fromfile(video_file); sharingintent.settype("video/mp4"); sharingintent.putextra(intent.extra_stream, video_uri); startactivity(intent.createchooser(sharingintent, "share image using")); toast.maketext(getapplicationcontext(),"video save successfully",toast.length_short).show(); 

}else{ toast.maketext(getapplicationcontext(),"video faile",toast.length_short).show(); }

above code submit button open video recording , file use store video sd card.so i want share recording video social media , recoding limits 3 min.


Comments

Popular posts from this blog

javascript - Create a stacked percentage column -

Optimising Firebase database by automatically overwriting data -

javascript - Angular UI-Grid customTemplate directive causing rows to load slowly/? -