These headers should just always be here. In Chrome if the video is a media file then it causes problems (like being unable to skip around or not pre-loading the whole file). I would also suggest that we store the filesize in bytes instead of with the "kb" or "mb" text. I was able to add them manually since API::getPrivateFile() returns a \Illuminate\Http\Response class instance which solved my issue. This could just be baked in though.
In my case I was also using s3 with files as "private" so it was piping the file through laravel but I imagine it would have the same issue without it coming from s3.
These headers should just always be here. In Chrome if the video is a media file then it causes problems (like being unable to skip around or not pre-loading the whole file). I would also suggest that we store the filesize in bytes instead of with the "kb" or "mb" text. I was able to add them manually since
API::getPrivateFile()
returns a\Illuminate\Http\Response
class instance which solved my issue. This could just be baked in though.In my case I was also using s3 with files as "private" so it was piping the file through laravel but I imagine it would have the same issue without it coming from s3.
Example if file size is
1234
bytes.Some examples of others with this problem (in general): https://stackoverflow.com/questions/45805177/chrome-cant-fast-forward-firefox-can-display-mp4-file-with-php https://stackoverflow.com/questions/61022041/unable-to-skip-audio-in-chrome https://stackoverflow.com/questions/10583931/cant-seek-html5-video-or-audio-in-chrome