Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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 ?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
520 views
Welcome To Ask or Share your Answers For Others

1 Answer

Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...