I'm doing a PoC involving videoJS. To see how it works, I set up an AWS S3 Bucket and uploaded a video and set it's ACL to public-read. Then I set its URL to the src of the video tag and hooked it up using VideoJS from their Getting Started guide.
All of that worked. The video player shows up on the screen and I can watch it without issue.
What I'm not understanding is how VideoJS handles its initial request (which I'm assuming is a metadata request).
The first request is a GET to my S3 URL containing the following header:
Range: bytes=0-
The response then sends back the following relevant headers:
Accept-Ranges: bytes
Content-Length: 195936293
Content-Range: bytes 0-195936292/195936293
Content-Type: video/quicktime
ETag: "%S3ETagOfObject%"
This really looks like its requesting the entire file to me. The response looks like it's sending back that the server accepts range requests, and gives relevant metadata of the file, and I can only assume that its streaming the data down from the server as though the entire file was requested.
What I don't get is that according to the network tab, the request completes in 329ms and only sends back 19.5kB of data. If I run the exact same request in Postman, it eventually times out after about 15 seconds and warns "Error: Maximum response size reached"
The only thing that makes any sense to me here is that VideoJS (or the browser itself) is requesting the entire file, but then cancelling the request as soon as it receives enough of the metadata to start streaming. It gets back the 206 PARTIAL CONTENT with the ETag, Content-Type, and Content-Length of the entire file and then cuts bait? I would have assumed I could see that in the network tab, but it just shows Status=206.
Can anyone shed any light here as to how its working and why I'm seeing the difference in Postman vs. the Browser?
Thanks!