简体   繁体   English

Safari IPhone 4.3上通过HTTPS播放HTML5音频

[英]HTML5 audio playback over HTTPS on safari IPhone 4.3

I have written a simple HTML code to play an audio file using the HTML5 audio tag on IPhone. 我编写了一个简单的HTML代码,以使用iPhone上的HTML5音频标签播放音频文件。

<audio controls="controls" autoplay="autoplay">
<source src="http://192.168.1.130/ab.wav>" type="audio/wav" preload="auto"/>
Your browser does not support the audio element.
</audio>

The above code works perfectly fine over safari. 上面的代码在safari上运行良好。 The problem comes when I change the Source URL from HTTP to HTTPS. 当我将源URL从HTTP更改为HTTPS时,就会出现问题。

I started getting "This movie could not be played" error message. 我开始收到“无法播放此电影”错误消息。

I am using a certificate chain which is as follows: 我使用的证书链如下:

VeriSign Trial Secure Server Root CA - G2 -> VeriSign Trial Secure Server CA - G2 -> ucbu-aricent-vm200 VeriSign试用版安全服务器根CA-G2-> VeriSign试用版安全服务器CA-G2-> ucbu-aricent-vm200

The certificate of the Root CA (above) is not available in Safari by default. 默认情况下,Safari中不提供根CA的证书(上述)。

So I had attached the certificate for the certificate authority (both Root and Intermediate) to an email, and then added them in IPhone by clicking the attachments in the email. 因此,我已将证书颁发机构的证书(“根”证书和“中级证书”)附加到电子邮件中,然后通过单击电子邮件中的附件将它们添加到iPhone中。

But still I see that the SSL Handshake fails when Safari created a TCP session to transfer the WAV file. 但是,我仍然看到Safari创建TCP会话来传输WAV文件时SSL握手失败。

NOTE: The SSL handshake goes successful when the TCP session is created to fetch the HTML file from the server. 注意:创建TCP会话以从服务器获取HTML文件时,SSL握手成功。 I had compared the network packets of the SSL handshake of HTML and WAV file scenarios and both of them were identical. 我已经比较了HTML和WAV文件方案的SSL握手的网络数据包,并且两者都是相同的。

This was mentioned above by ceejoyez and again by the OP (Thank you both!), but I almost missed it as it wasn't an actual answer : 上面ceejoyez和OP再次提到了这一点(谢谢你们!),但是我几乎错过了它,因为这不是实际的答案

If you are serving the content over https you need to have a valid certificate or it will not play on iOS devices (or on Safari on a Mac). 如果您通过https提供内容,则需要具有有效的证书,否则它将无法在iOS设备(或Mac的Safari)上播放。

See here for a related question. 有关相关问题,请参见此处

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM