Serving over plain HTTP
The simplest possible solution is HTTP on the server in combination with an Android client with a video player that can do HTTP streaming, such as VLC, Nova Video Player, mpv for android, MxPlayer (ad-supported). There are plenty HTTP servers to choose from:
Here are some one liners.
Python 2.x (❗️no seek support)
$ python -m SimpleHTTPServer 8000
Python 3.x (❗️no seek support)
$ python -m http.server 8000
Twisted (Python)
First, install the twisted package if not already present with pip install -U twisted
(pip3 install -U twisted
), then:
$ twistd -n web -p 8000 --path .
After you start the web server, open the browser on your Android device and type the IP and port of your Ubuntu box e.g. http://192.168.1.123:8000
You can use ifconfig
on Ubuntu to see the IP address.
A more extended list of HTTP oneliner servers: https://gist.github.com/willurd/5720255
Caddyserver
My preferred choice is caddy
with the built-in file-server
plugin. Caddy is written in Go and unlike the python options above is production level software, works faster and can do range requests that will allow to seek videos. Start caddy with:
caddy file-server --listen :2030 --browse --root /
The line :2030
will make caddy listen on port 2030
so you you'll be able to access it at something like http://192.168.1.100:2030 (replace with the correct IP).
If needed, with caddy
you can also enable basic authentication.
Samba server-side + VLC/Kodi client-side
If you need to access your ubuntu box in a home network then you can also enable Samba on the Ubuntu server and then on your client device (Android/Linux/Mac/Windows) add an SMB share as in the SAMBA HOWTO — search for Add SMB share to Kodi Method 1|2. Kodi can also generate previews and fetch IMDB info for your movies if that's what you are after.
VLC (mobile versions) will be able to discover and browse your Samba shares without extra fiddling. Desktop OS's normally have built-in support for samba shares so you can browse them pretty much like a local file system.
Client-side caddy-based media browser
Given that caddy
's file-server
built-in plugin can also return a directory listing as JSON I created a client-side media browser that is pure js+html and only requires caddy
to be running on the server with a custom Caddyfile
. It's more of a proof-of-concept project and not meant for anything serious:
It works in the browser and will only play video formats that the browsers can play, so no proper MKV support.