YouTube视频已通过iframe代码提供,但无法在Safari浏览器中运行

时间:2019-06-25 07:18:19

标签: html video iframe youtube

<iframe width="100%" height="500" src="https://www.youtube.com/embed/alswD2tCc_Q?rel=0" frameborder="0" allowfullscreen=""></iframe>

大家好,

以上是我的代码。该视频在Safari之外的所有浏览器中均可正常播放。你们能帮我解决此问题吗?

谢谢。

1 个答案:

答案 0 :(得分:0)

Safari要求Web服务器支持“ [Range] [1]”请求标头才能播放媒体内容。

https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariWebContent/CreatingVideoforSafarioniPhone/CreatingVideoforSafarioniPhone.html#//apple_ref/doc/uid/TP40006514-SW6

对于合法的“ Range”请求响应,您的Webserve需要返回状态码“ 206”。

相关问题