0

I need play video from samba to android device streaming. I've been look for this question and someone say that :

  1. Using JCIFS to scan for and "see" the share: http://jcifs.samba.org/
  2. Implementing a simple HTTP server (NanoHttpd) to stream the content via http: https://github.com/NanoHttpd/nanohttpd
  3. 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 ?

Community
  • 1
  • 1
henry4343
  • 3,871
  • 5
  • 22
  • 30
  • Hi - I'm not sure what the problem is? Is your server working fine? When it's running can you go to a browser on your device and access http://localhost:8080 and you get a video? – Ken Wolf Jan 06 '14 at 09:01
  • If I use FileInputStream from local file then I can get a video, but it didn't work from smbfileinputstream... I think that it's different between fileinputstream and smbfileinputstream. this is the other question i asked http://stackoverflow.com/questions/20945482/whats-different-between-sambafileinputstream-and-fileinputstream – henry4343 Jan 06 '14 at 09:39
  • Finally, I find a sample code for Android samba stream... [android-smb-streamer](https://code.google.com/p/android-smb-streaming/) – henry4343 Jan 07 '14 at 14:46
  • @henry4343 can you please share you code you have implemented to play video with samba sharing.. I am searching for it very long please tell if you can help me – Abhishek Mar 12 '16 at 10:46

0 Answers0