#Video files on the Internet sometimes need to be encoded in a special way to play when downloaded. For Flash-based video to work properly, data should be moved from the end of the stream to the beginning. A program called mp4 FastStart can do this for you.
Programs like HandBrake have a "web" option that also allows you to do this while encoding. You need to make sure that your web server does not apply gzip or deflate compression on top of the compression in the mp4 file.
Compression allows your web server to serve smaller file sizes, resulting in faster loading times for your website users. Gzip is a method of compressing files (making them smaller) to speed up network transfers. In computing, DEFLATE is a lossless data compression algorithm and related file format that uses a combination of the LZ77 algorithm and Huffman coding.
Check by your web server using curl -I http://example/video.mp4. HTTP response headers should contain Content-Type - video/mp4 and Accept-Ranges - bytes, and not Content-Encoding.
The above is the detailed content of How to stream large .mp4 files in HTML5?. For more information, please follow other related articles on the PHP Chinese website!