I
I
id_coder2020-05-27 01:02:43
safari
id_coder, 2020-05-27 01:02:43

How to play audio from another server in Safari on iOS?

Hello!

I've been scratching my head for a few days now on how to get Safari on iOS to get an audio file and play it NOT in live mode, but as a normal audio with a time stamp and the ability to rewind.
5ecd8e021ea70875235697.png
The problem is that other browsers, including Safari on macOS, do a great job, but iOS, other things being equal, makes a request, but does not receive anything in response.

5ecd7e8be035c351911024.png

Initially, I thought that the problem was in the PHP script that is responsible for returning the data, but by connecting the iPhone to the proxy via Charles, the audio started playing normally (not as a stream). From this, I concluded that the problem was not in the script, but most likely in my server or CloudFlare.
My server responds to all requests, but the response does not come only on iOS.
I tried to change the CloudFlare caching settings, disabled gzip for audio files in the Nginx configs, tortured the headers in the PHP script, smoked a bunch of forums on similar problems, but I did not find a solution.

Perhaps someone reading this has encountered a similar problem and knows / suggests possible solutions.
I will be glad for any help))

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
id_coder, 2020-05-31
@id_coder

The solution has been found!
It turned out the whole problem was in CloudFlare. If you disable SSL and https redirect, everything works fine on any device, but I don’t want to lose CF goodies at all, I found an elegant, in my opinion, crutch.
The solution comes down to creating a subdomain. Having configured a subdomain in nginx identically to the main one, it can also be proxied through CF, but the "Page Rules" for https will not apply to it, so you can safely send audio files through it. The key is to use http, not https.

B
Buvaysar, 2020-05-27
@Buvaysar

No way. Do not mind it

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question