jLuger.de - Serve a video with golang

In my last two posts I've shown how to generate a mp4 video file. In this post I show some go code to serve the generated file via http. It basically boils down to a call of ServeContent in the http package.
package main

import (

func main() {
fileName := flag.String("f","","filename to stream")
if fileName==nil || *fileName=="" {
log.Println("File needed")
baseName := path.Base(*fileName)
file,err := os.Open(*fileName)
if err!=nil {
log.Println("Couldn't open file",fileName)
http.HandleFunc("/stream",func(w http.ResponseWriter, r *http.Request) {
To start the program type ./prog -f cool_movie.mp4 and then enter in a browser on your smartphone (assuming you PC has the IP I've tested it with Firefox and Chrome. Both could play the file but Firefox has no full screen mode and thus leaves the navigation bars active. A resized and shrinked video isn't what you want when playing around with cardboard VR.