I thought when streaming a mp4 file on a browser, the browser needs to download the whole MP4 file before playing, because the player needs to know metadata like video codec, audio codec, etc. and MP4's metadata can only be known only after downloading the whole file.
But today when I uploaded a 2 Gigabyte MP4 video on AWS S3, it plays instantly on Microsoft Edge (actually there is 1 or 2 seconds' delay, but still obviously the browser did not download the whole MP4 file before playing). By the way I have CloudFront (CDN) before S3, so Microsoft Edge first request the video url to CloudFront, then CoudFront request the MP4 file in S3.
How is it possible? What is the magic behind AWS S3? Don't we have to download the whole MP4 file before knowing MP4's metadata then streaming?