Mithun Sasidharan
Mithun Sasidharan

Reputation: 20920

Stream Videos Online and Access Rights

I have a web application that i have developed in RoR 2.1. In the app, users have the privilege of uploading media files. Currently, only FLV videos can be streamed online since i have given FLV player browser support.I have used the gem Mime Types to identify the file fomats of the media files being uploaded.

I would like to get the feasibility and ways to implement two new requirements

Upvotes: 0

Views: 811

Answers (1)

Jonathan
Jonathan

Reputation: 16349

1) for streaming you should use a CDN, this should not be the responsibility of your rails app. Lots of options, I have enjoyed working with S3/Cloudfront. Streaming through your app will really hurt the scalability of your platform. Lets the good folks at the CDN deal with this.

2) To throttle the usage -- I would do the following. When a web user wants to watch a video give them a link you your app (vs directly to the CDN) so http://myapp/video/watch. In that method(VideosController#watch) you can count concurrent views, and if under the threshold then perform a secure redirect to the video.


If you must serve files directly from your server use send_file method (doc)

If you are looking for video playback, there a bunch of javascript/html5 video solutions: VideoJS is a pretty good one: http://videojs.com/, It should be able to handle many different types of video formats enter link description here

Good luck

Upvotes: 1

Related Questions