0

What I'm doing

Basically I'm writing simple a Q&A site with an option to create links to specific positions in media files. As of now the app is intended to be used in LAN environment only.

I have put a video in appRoot/public folder and created a view using html5 video tag.
It works and even seeking is available. Wow...

What I don't understand

I'm clueless as to the tech behind and its limitations.
It just worked, so I don't even know a key word to hit google with.

What I know

With the way I'm doing:

  1. No encryption
  2. No way to prevent users to save video files
  3. No automatic trans-coding available

The real question

What is the name of the tech behind.
How well can rails handle streaming and seeking requests with the way I did as compared to using dedicated video streaming servers or gems.

TastyCatFood
  • 1,632
  • 1
  • 15
  • 27

1 Answers1

1

As long as your underlying web server understands how to handle the MIME types for video, and responds correctly to byte range requests - as it seems to be - that's all you need. The underlying mechanics of streaming video with HTML5 is that the browser asks for a chunk of content as a range of bytes from the source (enough to keep the buffer full) and the server delivers it.

You might want to look at using ffmpeg to optimize your videos so that the metadata is in the right place in the file to start streaming quicker.

You've correctly pointed out the limitations of the solution in your environment. The other thing to be aware of is capacity - if the videos are long and a lot of people are accessing them concurrently then without caching (in a LAN via a caching proxy or on the internet via a CDN service) your server capacity may be stretched

Offbeatmammal
  • 7,970
  • 2
  • 33
  • 52
  • Thanks for your pointer. Now I get that it's the underlying HTTP server, my case puma, that is handling the streaming task and not the rails, so the tech behind depends on which HTTP server or even which server plug-in. And from the way you put it, I guess streaming is mostly about caching, load balancing and the speed of IO operation and which protocol or which server is not too significant a factor. – TastyCatFood May 21 '17 at 17:12