Videos on website don't play , only affects iOS users

Video website , doesn’t play videos for iOS users , exact error message :
The media could not be loaded, either because the server or network failed or b…

if I access the video file directly ( direct URL … /video.mp4 , then it plays perfectly fine ) . But on the webpage with the video player , it’s showing the error

If cloudflare disabled. Then there are no issues whatsoever.

Everything works fine on Android devices , desktops …

the issue only occurs with iOS devices on both safari and chrome browsers .
Tested on multiple fully updated iOS devices , emulators , same issue .

Any ideas to what could be causing it?

I am drawing blank for solving it .

Hello user33612,

This issue might be due to how Cloudflare handles byte-range requests which are essential for iOS devices to play media files. Please check your server configuration to ensure it allows byte-range requests. If this doesn’t solve the issue, setting a Page Rule in Cloudflare to bypass caching for the path of your media files can be a potential solution.

Here’s how to set a Page Rule:

  1. Log into your Cloudflare account.
  2. Select your domain.
  3. Go to the “Page Rules” section.
  4. Click “Create Page Rule”.
  5. In the “If the URL matches” field, input the path to your media files.
    Eg, *yourdomain.com/*.mp4*
  6. Under “Then the settings are”, choose “Cache Level” and select “Bypass”.
  7. Click “Save and Deploy”.

This rule should bypass Cloudflare’s cache for your media files, allowing them to play correctly on iOS devices.

Please see : Understanding and configuring Cloudflare Page Rules (Page Rules Tutorial) · Cloudflare Support docs

Regards

1 Like

I have encountered the same problem and upon searching on Google, I discovered that it has been a recurring issue. I attempted to solve it using the suggested solution, but unfortunately, it did not work. It appears that the rule is being disregarded or has no impact.

Has anyone found a solution that doesn’t involve completely disabling Cloudflare?

So all available solutions failed, all suggestions from support didn’t help either .

I paused cloudflare for 2 days, and after restarting it with all earlier being disabled, it finally started to work .

Not sure what or how

I think I found something… in my case I use an Apache webserver and:

  1. I modified the htaccess file like this:
SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI .(mp4|ogv|webm)$ no-gzip dont-vary
  1. I cleared the cache.

I haven’t added any Page Rules.

It seems that videos are now playing on iOS as well.

Thank you, Cloudflare, for making me waste two days and a bunch of hair…

5 Likes

Thanks , I will try that if it stops working again

Hi just wanted to say this solution worked for me, thanks so much!!

It seems this has been fixed for me as well! Many thanks.

Thank you, this worked for me, I knew it was the server.

Hi all, I’m having the same problem but my content is stored in B2 (backblaze), so… I can’t update the server response for mp4 files as recommended above in the answers… would you have any tips for fixing this problem in this type of situation?

Yes it works. Thank you sooo sooo sooo much :heart: