I need play video from samba to android device streaming. I've been look for this question and someone say that :
- Using JCIFS to scan for and "see" the share: http://jcifs.samba.org/
- Implementing a simple HTTP server (NanoHttpd) to stream the content via http: https://github.com/NanoHttpd/nanohttpd
- Passing the
http://localhost/myvideo
link to the VideoView
I'm already use JCIFS to get SmbFile in my project and I also get inputstream( smbfile.getInputStream() ).
Now I import NanoHttpd and I create simple HTTP server that http address ishttp://localhost:8080
private class MyHTTPD extends NanoHTTPD {
public MyHTTPD() throws IOException {
super(8080);
}
@Override
public Response serve(String uri, String method, Properties header, Properties parms, Properties files) {
InputStream is = new SmbFile(filePath,auth).getInputStream();
//return index as response
return new NanoHTTPD.Response(HTTP_OK, "video/mp4", is);
}
}
server = new MyHTTPD();
server.start();
But my http address is different from http://localhost/myvideo
, I don't know how to get right http address and put it in to VideoView.
I don't know how to get path like http://localhost/myvideo
.
Thanks for help....
The other question : Can I use VideoView playing video from InputStream ?
来源:https://stackoverflow.com/questions/20929880/android-sdk-samba-server-streaming-video-to-android-using-videoview