WEBrick DocumentRoot for MP4s

84 Views Asked by At

I have a very simply ruby script to Serve the file system from one computer over the local host to my other PCs. I want MP4s to be watchable directly in the browser window. I've added the mime_type for mp4's, which has set the content-type to video/mp4 as required instead of the default octet-stream, however the videos are still unplayable?

require 'webrick'

mime_types = WEBrick::HTTPUtils::DefaultMimeTypes
mime_types.store 'mp4', 'video/mp4'

server = WEBrick::HTTPServer.new(:Port => 12345,
                            :SSLEnable => false,
                            :DocumentRoot => '/',
                            :AccessLog => [],
                            :MimeTypes => mime_types)
trap 'INT' do server.shutdown end

server.start

The server indicates it's OK:

network trace

But the video isn't play-able?:

video not playable

How does one fix this issue? Is this a WEbrick issue?

0

There are 0 best solutions below