Symfony + 奏鸣曲包 - Iphone 用户无法播放我的流式音频文件

Symfony + sonata bundle - Iphone users can't play my streamed audio file

我有一个提供音频课程的网络应用程序,几天前我刚刚将它迁移到新服务器。 从那时起,我陷入了一个可怕的 Iphone 问题:他们无法再访问我的任何流式音频文件。

预期行为如下:在任何设备(PC、Mac、Android)上 link 访问音频资源工作正常,我有一个播放该课程的 classical 浏览器播放器。

working player

在 IOS 上的错误行为:在 Ios 设备上,播放器被交叉,网络请求无法访问资源。

wrong player

问题详情 :

快速查看 HTML 内容表明以下 class“媒体文档 iPhone 无效视频”

网络显示 4 个请求:

4 network requests overview

Request 1

Request 2

Request 3

Request 4

技术环境如下

带有奏鸣曲包的 Symfony 应用程序(媒体和用户管理库)。

具有 HTTP2 和有效证书的 Nginx 服务器。

音频文件本身是 .mp3,但 sonata media 以 .mpga 格式提供

在此先感谢您的帮助!

iOs 媒体播放器不支持 .mpga 因此您必须将文件转换为 MP3(与 .mpga 文件基本相同)。

可以看到more infos here.

支持的扩展(来自前面提到的link中的@flycomputer):

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

我认为如果您尝试将扩展名更改为 .mp3,它应该可以在不进行转换的情况下工作。

但如果没有,您可能必须将文件转换为其中一种受支持的格式。