Search code examples
javaandroidmemorystreamingnanohttpd

NanoHttpd server cannot stream large videos on android


NanoHttpd server code can be found here.

I'm starting a new Thread in a service that uses NanoHttpd server to stream large videos (about 150mb) but it just pauses right while the loading dialog is shown. I tried increasing and decreasing the buffer reads to no avail. It seems that the server cannot run properly on an Android device.

Same code works fine when I start the server via desktop application. I can stream more than 150mb. When running the server from the phone, I only tried 20mb files and they were good too. However I need to stream much more than that.


Solution

  • Solved my own problem. The issue is that the MediaPlayer(s) (wmp, vlc, android player), issue a GET request with a specified RANGE. Served that request correctly, problem solved.