How to stream large .mp4 files in HTML5?

HTMLJavascriptProgramming Scripts

Video files on the web sometimes need to be encoded in a special way in order for them to be played while downloading. In order for flash-based videos to work, data should be moved from the end to the start of the stream. A program called mp4 FastStart can do this for you.

Programs like HandBrake have a "web" option that also does this when encoding. You need to ensure that your web server is not applying to gzip or deflate compression on top of the compression in the mp4 file.

Compression allows your webserver to provide smaller file sizes, which load faster for your website users. Gzip is a method of compressing files (making them smaller) for faster network transfers. In

computing, DEFLATE is a lossless data compression algorithm and associated file format that uses a combination of the LZ77 algorithm and Huffman coding.

Check the headers being sent by your web server using curl -I http://example/video.mp4. The HTTP Response Header should include Content-Type − video/mp4and Accept-Ranges − bytes, and no Content-Encoding.

Updated on 24-Jun-2020 13:33:51