1

I am displaying a video with the html5 video element. The source is a pre-signed url from Wasabi s3. It works well on Chrome but it won't play on Safari. I did some research and it seems like this is usually due to the server not being configured to return a 206 code. However, I did check the server and it seems to support byte-range requests.

enter image description here

Here is the network tab. Any help would be greatly appreciated. enter image description here

Max
  • 754
  • 8
  • 24

1 Answers1

2

Ok, it seems like I usually get stuck on those minuscule problems. Turns out that Safari, unlike Chrome, doesn't like to play files without file extension. Adding ".mp4" to my files solved the problem...

Max
  • 754
  • 8
  • 24
  • 1
    I have the same issue, have the exact same headers as you and ".mp4" in the file name but safari still refuses to play my video, any suggestions? – Eli Zatlawy Dec 26 '21 at 09:10
  • 1
    Did you check if you get 206 responses from your server? – Max Dec 27 '21 at 14:14
  • 1
    Yes I do get 206, I'm using AWS S3 to get my mp4 videos, they work well on Chrome but not on Safari, my response looks exactly as yours. – Eli Zatlawy Dec 27 '21 at 14:37
  • What happens in the browser in terms of the video not playing? Do you get that struck through play button? – Max Dec 30 '21 at 14:29
  • I get: `VIDEOJS: – "ERROR:" – "(CODE:4 MEDIA_ERR_SRC_NOT_SUPPORTED)"` – Eli Zatlawy Dec 30 '21 at 16:14
  • I still have this issue. I have uploaded files recorded using iPhone to S3, now when Safari fires byte-range requests, few of them are shown failed though the status is still 206. I am really not sure why they are failing. Also after that Safari keep on firing multiple requests endlessly which can be seen in the resource and data shared stats which becomes in GBs. I don't know what is wrong? – shivamragnar Jan 29 '22 at 15:56
  • @EliZatlawy Did you ever get this working? I have the same issue – Kevin May 16 '23 at 22:29
  • @Kevin Unfortunately no, we drop support for Safari at this point. – Eli Zatlawy May 17 '23 at 07:39
  • @Max it seems like several of us are having exactly the same problem, with all roads leading to Safari being the issue. But you have got it working - can you help? My videos are stored with an MP4 extension but i get the struck-through play button – Kevin May 21 '23 at 17:47
  • @Kevin Adding the .mp4 file extension to saved files was the way to fix the issue in my case. This particular project is quite old and I am not actively maintaining it anymore so unfortunately won't have time to dive back into the code. However, you can find the full source of that project in this repo: https://github.com/maxibenner/cardboard. Feel free to take a look. I also found an issue on Github where a server wasn't returning certain properties that were necessary for the video to be properly served to Safari (https://github.com/VeliovGroup/Meteor-Files/issues/568). – Max May 21 '23 at 18:47