#Description Are you tired of having to server all you videos out of public? Want a simple solution that keeps your videos private but is super easy to use?
token-auth-video-server is your solution. token-auth-video-server is a simple sinatra application and client that allows you to render videos that are protected by an auth token.
#Usage Add the following line to your Gemfile:
gem 'token-auth-video-server', :git => "git://github.com/rweald/token-auth-video-server.git"
If you only want to require the client library in your rails app simply
add :require => "token-auth-video-server/client"
to the above
line.
To generate an auth token that will be valid for 3 mins simply
TAVideoServer::Client.generate_url("test.webm")
This will generate a url poiting to the video on your server with the name test.webm.
This token will expire after 3 mins at which point you will get a 403 response code.
To Run the server simply
bundle exec token_auth_video_server
#Configuration You can set the host that you want to use for the url generated by the client library.
TAVideoServer::Client.url_host = "http://example.com"
If you want to have a seperate url for the token request. Perhaps not using a public url you can configure it using:
TAVideoServer::Client.token_host = "http://127.0.0.1:4250"
By default the server will look for video files in a directory called videos relative to the directory where server is started.
If you want to customize the root path for videos simple set an ENV variable
ENV["VIDEO_SERVICE_ROOT"] = "/SomeUser/media"