Home > OS >  Symfony sonata bundle - Iphone users can't play my streamed audio file
Symfony sonata bundle - Iphone users can't play my streamed audio file

Time:11-29

I have a web app which proposes audio courses, and I just migrated it a few days ago to a new server. Since that point, I'm getting stuck with a terrible Iphone issue : they can't access any of my streamed audio files anymore.

The expected behaviour is the following : on any device (PC, Mac, Android) the link to access the audio resource is working fine, and I have a classical browser player that plays the course.

working player

Wrong behaviour on IOS : On Ios devices, the player is crossed and network request fails to access resource.

wrong player

Issue details :

A quick view to the HTML content indicates the following class "media-document iPhone invalid video"

Network show 4 requests :

4 network requests overview

Request 1

Request 2

Request 3

Request 4

Technical environment is the following :

Symfony app with sonata bundle (medias and users management library).

Nginx server with HTTP2 and valid certificate.

Audio file is natively .mp3 but served as .mpga by sonata media

Thanks in advance for your help !

CodePudding user response:

iOs media player do not support .mpga so you have to convert your file into a MP3 (which is basically the same as a .mpga file).

You can see more infos here.

Supported extensions (from @flycomputer in link mentionned previously):

The audio playback formats supported in iOS are the following:

AAC (AAC-LC)
HE-AAC (v1 and v2)
xHE-AAC - supported since iOS 13.0
AC-3 (Dolby Digital) - supported since iOS 9.3
E-AC-3 (Dolby Digital Plus) - supported since iOS 9.3
MP3 (MPEG-1 audio layer 3
AMR (Adaptive Multi-Rate, a format for speech) - not supported since iOS 4.3
ALAC (Apple Lossless)
iLBC (internet Low Bitrate Codec, another format for speech)
IMA4 (IMA/ADPCM)
linear PCM (uncompressed)
µ-law and a-law

The audio recording formats supported in iOS are the following:

AAC (on supported devices only)
ALAC (Apple Lossless)
iLBC (internet Low Bitrate Codec, for speech)
IMA4 (IMA/ADPCM)
linear PCM
µ-law and a-law

I think it should work without conversion if you try to change the extension to .mp3 instead.

But if it doesn't, you may have to convert your file into one of the supported formats.

CodePudding user response:

Thanks Dylan, I tried to change the extension to .mp3 and it seemed to work. I will apply this to all my files and see how it reacts.

  • Related