how can android play video by inputstream -
i got input stream socket cctv,but not know how display video,is there apis?in words,how can android display cctv???
my question:i have used video framework display video,which display string path. want displaying stream...how can figure out???
help me....
`void playfunction(){ string path = ""; videoview mvideoview; edittext medittext; medittext = (edittext) findviewbyid(r.id.url); mvideoview = (videoview) findviewbyid(r.id.surface_view); // path="http://dlqncdn.miaopai.com/stream/mvaux41a4lkuwlobbgugaq__.mp4"; path = environment.getexternalstoragedirectory().getabsolutepath() + "/cctvwatch.mp4"; if (path == "") { // tell user provide media file url/path. toast.maketext(videoviewdemo.this, "please edit videoviewdemo activity, , set path" + " variable media file url/path", toast.length_long).show(); return; } else { /* * alternatively,for streaming media can use * mvideoview.setvideouri(uri.parse(urlstring)); */ mvideoview.setvideopath(path); mvideoview.setmediacontroller(new mediacontroller(this)); mvideoview.requestfocus(); mvideoview.setonpreparedlistener(new mediaplayer.onpreparedlistener() { @override public void onprepared(mediaplayer mediaplayer) { // optional need vitamio 4.0 mediaplayer.setplaybackspeed(1.0f); } }); } }
}`
Comments
Post a Comment