I need to streaming video from samba server, and I use nanohttpd to create simple server in my project. When I use fileinputstream from my local file, the videoview is work to play video by set "http://localhost:8080"
public class Server extends NanoHTTPD {
public Server() {
super(8080);
}
@Override
public Response serve(String uri, Method method,
Map<String, String> header, Map<String, String> parameters,
Map<String, String> files) {
fis = new FileInputStream(filePath);
return new NanoHTTPD.Response(Status.OK,"video/mp4", fis);
}
}
JCIFS don't have fileinputstream, so I only get smbfileinputstream, when I change
fis = new SmbFile(filePath,auth).getInputStream();
it doesn't work, I need to know what's different between fileinputstream and smbfileinputsteam so that I can streaming video from samba ...
If you hava others solution to streaming video from samba on android, please help me...
Thanks a lot..
FileInputStream
, do something like:InputStream is = smbFile.getInputStream(); BufferedInputStream bis = new BufferedInputStream(is); return new Response( HTTP_OK, mime, bis);
– Middle