android - Load a video from gallery into VideoView -
what want same images. when user clicks on button (in case videoview itself) want let them open gallery , load video videoview.
vv_video = (videoview) findviewbyid(r.id.vv_video); vv_video.setontouchlistener(new view.ontouchlistener() { @override public boolean ontouch(view v, motionevent event) { intent intent = new intent(); intent.settype("video/*"); intent.setaction(intent.action_get_content); startactivityforresult(intent.createchooser(intent, "complete action using"), load_video); return false; } }); @override public void onactivityresult(int requestcode, int resultcode, intent data) { if (resultcode != result_ok) return; switch (requestcode) { case load_video: toast.maketext(newbucketactivity.this, "test", toast.length_short).show(); //this appears! bundle video = data.getextras(); mvideocaptureuri = video.getparcelable("data"); vv_video.setvideouri(mvideocaptureuri); break; } }
but nothing happens when select video in gallery. toast msg appears messed sg bundle or uri. should displayed in videoview, right?
after startactivity
intent
uri mvideouri = data.getdata(); vv_video.setvideouri(mvideouri); vv_video.start();
it work(i think )
Comments
Post a Comment