Android SDK: streaming video for Samba for Android using VideoView?

I need to play video from samba to an Android streaming device. I was looking for this question , and someone said that:

I already use JCIFS to get the SmbFile in my project, and I also get the input stream (smbfile.getInputStream ()).
Now I import NanoHttpd and I create a simple HTTP server that has the http address http://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 the correct http address and put it in VideoView.
I do not know how to get the path like http://localhost/myvideo .
Thanks for the help....

Another question: can I use VideoView to play videos from InputStream?

0
source share

Source: https://habr.com/ru/post/1489429/


All Articles