1

I have an S3 integration set up in an API Gateway endpoint and it works well in most cases when uploading/downloading content to/from my S3 bucket. One problem that I have is that I can play mp4 files via my API Gateway in Safari on MacOS.

I followed that post (<video> plays in other browsers, but not Safari) and I learned that default MacOS player requires an http server to allow byte-range responses in order to properly play mp4 files. So what I did is I allowed passing Range parameter in request header in API Gateway and, in response, I return Accept-Ranges: 'bytes' in header. Additionally API Gateway responds with 206 status which is a proper one for data returned in chunks.

The one thing I spotted is that the request from the web browser goes with Range: bytes=0- indicating that the file is requested in one chunk. And, as a result I receive single response with whole file. On the other hand, when examining request/response with this stock video (https://assets.mixkit.co/videos/preview/mixkit-waves-in-the-water-1164-large.mp4), also sourced from S3 according to what I see in the response header, the requests are separated into chunks and response is provided in pieces as well.

So, is there something I'm missing in API Gateway to make it work?

smigiel
  • 11
  • 1

0 Answers0